Participants were asked to report the standard output of 84 tiny (3-22 line) programs chosen in pairs randomly from 126 total. There is also a CSV version of this list.

DetailsObfuscatedTransformed

Implicit Predicate

  • Obfuscated ID: 1
  • Transformed ID: 2
  • Obfuscated Answer: false
  • Transformed Answer: false
void main(){
   int V1 = 10, V2 = 3;
   if (! (V1 % V2)){
      printf("%s\n", "true");
   }
   else{
      printf("%s\n", "false");
   }
}

void main(){
   int V1 = 1, V2 = 2;
   if ( (V2 - V1) == 0){
      printf("%s\n", "true");
   }
   else{
      printf("%s\n", "false");
   }
}

Implicit Predicate

  • Obfuscated ID: 3
  • Transformed ID: 4
  • Obfuscated Answer: true
  • Transformed Answer: true
  • Errata
void main() { 
   int V1 = 7; 
   if (V1 = 8) 
      printf("true\n"); 
   else
      printf("false\n"); 
}
void main()
{
   int V1 = 7;
   if ((V1 = 8) != 0)
      printf("true");
   else
      printf("false");
}

Implicit Predicate

  • Obfuscated ID: 5
  • Transformed ID: 6
  • Obfuscated Answer: true
  • Transformed Answer: true
void main() {
   if ("V1")
      printf("true");
   else
      printf("false");
}
void main() {
   if ("V1" != '\0')
      printf("true\n");
   else
      printf("false\n");
}

Infix Operator Precedence

  • Obfuscated ID: 7
  • Transformed ID: 8
  • Obfuscated Answer: 0
  • Transformed Answer: 6
void main() { 
   int V1;
   V1 = 2 - 4 / 2;
   printf("%d\n", V1);
}
void main() { 
   int V1;
   V1 = 3 + (9 / 3);
   printf("%d\n", V1);
}

Infix Operator Precedence

  • Obfuscated ID: 9
  • Transformed ID: 10
  • Obfuscated Answer: true
  • Transformed Answer: true
void main() {
   if (! 0 && 2) {
      printf("true");
   } else {
      printf("false");
   }
}
void main() {
   if ( 1 && (! 0) ) {
      printf("true");
   } else {
      printf("false");
   }
}

Infix Operator Precedence

  • Obfuscated ID: 11
  • Transformed ID: 12
  • Obfuscated Answer: true
  • Transformed Answer: true
void main() {
   if (0 && 1 || 2) {
      printf("true");
   } else {
      printf("false");
   }
}
void main() {
   if ((2 && 0) || 5) {
      printf("true");
   } else {
      printf("false");
   }
}

Post-Increment/Decrement

  • Obfuscated ID: 13
  • Transformed ID: 14
  • Obfuscated Answer: 3 5
  • Transformed Answer: 3 5
void main() { 
   int V1 = 2;
   int V2 = 3 + V1++;
   printf("%d %d\n", V1, V2);
}
void main() { 
   int V1 =  2, V2;
   V2 = V1 + 3;
   V1++;
   printf("%d %d\n", V1, V2);
}

Post-Increment/Decrement

  • Obfuscated ID: 15
  • Transformed ID: 16
  • Obfuscated Answer: true 1
  • Transformed Answer: true 1
void main() { 
   int V1 = 0;
   if (V1++ == 0) {
      printf("true ");
   }
   else {
      printf("false ");
   }
   printf("%d", V1);
}
void main() { 
   int V1 = 0;
   if (V1 == 0) {
      printf("true ");
   }
   else {
      printf("false ");
   }
   V1++;
   printf("%d", V1);
}

Post-Increment/Decrement

  • Obfuscated ID: 17
  • Transformed ID: 18
  • Obfuscated Answer: false 1
  • Transformed Answer: false 1
void main() { 
   int V1 = 2;
   if (V1-- == 1) {
      printf("true ");
   }
   else {
      printf("false ");
   }
   printf("%d", V1);
}
void main() { 
   int V1 = 2;
   if (V1 == 1) {
      printf("true ");
   }
   else {
      printf("false ");
   }
   V1--;
   printf("%d", V1);
}

Pre-Increment/Decrement

  • Obfuscated ID: 19
  • Transformed ID: 20
  • Obfuscated Answer: 3 1
  • Transformed Answer: 6 -1
void main() { 
   int V1 = 2;
   int V2 = ++V1 - 2;
   printf("%d %d\n", V1, V2);
}
void main() { 
   int V1 = 5, V2;
   ++V1;
   V2 = 5 - V1;
   printf("%d %d\n", V1, V2);
}

Pre-Increment/Decrement

  • Obfuscated ID: 21
  • Transformed ID: 22
  • Obfuscated Answer: true 1
  • Transformed Answer: true 1
void main() { 
   int V1 = 2;
   if (--V1 == 1) {
      printf("true ");
   }
   else {
      printf("false ");
   }
   printf("%d", V1);
}
void main() { 
   int V1 = 2;
   V1--;
   if (V1 == 1) {
      printf("true ");
   }
   else {
      printf("false ");
   }
   printf("%d", V1);
}

Pre-Increment/Decrement

  • Obfuscated ID: 23
  • Transformed ID: 24
  • Obfuscated Answer: 1 4
  • Transformed Answer: 5 3
void main() { 
   int V1 = 2;
   int V2 = --V1 + 3;
   printf("%d %d\n", V1, V2);
}
void main() { 
   int V1 = 6, V2;
   V2 = 9 - V1;
   --V1;
   printf("%d %d\n", V1, V2);
}

Constant Variables

  • Obfuscated ID: 25
  • Transformed ID: 26
  • Obfuscated Answer: 5
  • Transformed Answer: 5
void main() {
   int V1 = 3;
   int V2 = V1 + 2;
   printf("%d\n", V2);
}
void main() {
   int V1 =  2 + 3;
   printf("%d\n", V1);
}

Constant Variables

  • Obfuscated ID: 27
  • Transformed ID: 28
  • Obfuscated Answer: 4
  • Transformed Answer: 6
void main() {
   int V1 = 2;
   int V2 = 2 * V1;
   printf("%d\n", V2);
}
void main() {
   int V1 = 3 * 2;
   printf("%d\n", V1);
}

Constant Variables

  • Obfuscated ID: 29
  • Transformed ID: 30
  • Obfuscated Answer: 5
  • Transformed Answer: 9
void main() {
   int V1 = 2;
   printf("%f\n", 2.5 * V1);
}
void main() {
   printf("%f\n", 2 * 4.5);
}

Indentation no Braces

  • Obfuscated ID: 31
  • Transformed ID: 32
  • Obfuscated Answer: 7
  • Transformed Answer: 9
  • Errata
void main() {
   int V1 = 2;
   int V2 = 0;
   int V3 = 3;

   if (V1)
      if (V2)
         V3 = V3 + 2;
   else
      V3 = V3 + 4;

   printf("%d\n", V3);
}
void main() {
   int V1 = 2;
   int V2 = 0;
   int V3 = 5;

   if (V1)
      if (V2)
         V3 = V3 + 2;
      else
         V3 = V3 + 4;

   printf("%d\n", V3);
}

Indentation no Braces

  • Obfuscated ID: 33
  • Transformed ID: 34
  • Obfuscated Answer: 6
  • Transformed Answer: 6
  • Errata
void main() {
   int V1 = 5, V2 = 5;
   while (V2 > 0)
      V2--;
      V1++;
   printf("%d\n",V1);
}

void main() {
   int V1 = 5, V2 = 5;
   while (V2 > 0)
      V2--;
   V1++;
   printf("%d\n",V1);
}

Indentation no Braces

  • Obfuscated ID: 35
  • Transformed ID: 36
  • Obfuscated Answer: 2 2
  • Transformed Answer: 5 5
  • Errata
void main() {
   int V1 = 1, V2 = 2;
   if (V1 > V2)
   V2 = 1;
   V1 = 2;
   printf("%d %d\n",V1, V2);
}
void main() {
   int V1 = 5, V2 = 2;
   if (V1 < V2)
      V1 = 2;
   V2 = 5;
   printf("%d %d\n",V1, V2);
}

Macro Operator Precedence

  • Obfuscated ID: 37
  • Transformed ID: 38
  • Obfuscated Answer: 62
  • Transformed Answer: 126
  • Errata
#define M1 64 - 1

void main(){
   int V1;
   V1 = M1 * 2;
   printf("%d\n", V1);
}
void main(){
   int V1;
   V1 = 128 - 1 * 2;
   printf("%d\n", V1);
}

Macro Operator Precedence

  • Obfuscated ID: 39
  • Transformed ID: 40
  • Obfuscated Answer: 11
  • Transformed Answer: 9
  • Errata
#define M1(V1, V2) V1 * V2

void main(){
   int V3 = M1(1 + 2, 3 + 4);
   printf("%d\n", V3);
}

void main(){
   int V1 = 2 + 1 * 4 + 3;
   printf("%d\n", V1);
}

Macro Operator Precedence

  • Obfuscated ID: 41
  • Transformed ID: 42
  • Obfuscated Answer: 21
  • Transformed Answer: 21
  • Errata
#define M1(V1, V2) (V1) * (V2)

void main(){
   int V3 = M1(1 + 2, 3 + 4);
   printf("%d\n", V3);
}

void main(){
   int V1 = (2 + 1) * (3 + 4);
   printf("%d\n", V1);
}

Pointer Arithmetic

  • Obfuscated ID: 43
  • Transformed ID: 44
  • Obfuscated Answer: def
  • Transformed Answer: cdef
  • Errata
void main() {
   char *V1 = "abcdef" + 3;
   printf("%s\n", V1);
}
void main() {
   char *V1 = &("abcdef"[2]);
   printf("%s\n", V1);
}

Pointer Arithmetic

  • Obfuscated ID: 45
  • Transformed ID: 46
  • Obfuscated Answer: 2
  • Transformed Answer: 1
  • Errata
void main() {
   int V1[] = {4, 2, 7, 5};
   int *V2 = V1 + 1;
   printf("%d\n", *V2);
}
void main() {
   int V1[] = {3, 1, 4, 6};
   int *V2 = &V1[1];
   printf("%d\n", *V2);
}

Pointer Arithmetic

  • Obfuscated ID: 47
  • Transformed ID: 48
  • Obfuscated Answer: 3
  • Transformed Answer: 4
  • Errata
void main() {
   int V1[] = {4, 7, 2, 3};
   int *V2 = V1 + 1;
   V2 = V2 + 2;
   printf("%d\n", *V2);
}
void main() {
   int V1[] = {3, 2, 9, 4};
   int *V2 = &V1[1];
   V2 = &V2[2];
   printf("%d\n", *V2);
}

Conditional Operator

  • Obfuscated ID: 49
  • Transformed ID: 50
  • Obfuscated Answer: 1
  • Transformed Answer: 1
void main() {
   int V1 = 4;

   int V2 = V1 == 3 ? 2 : 1;

   printf("%d\n", V2);
}
void main() {
   int V1 = 4;
   int V2 = 3;
   int V3;
  
   if (V1 == 3) {
      V3 = 2;
   } else {
      V3 = 1;
   }

   printf("%d\n", V3);
}

Conditional Operator

  • Obfuscated ID: 51
  • Transformed ID: 52
  • Obfuscated Answer: 2
  • Transformed Answer: 2
  • Errata
void main() {
   int V1 = 2;
   int V2 = 3;
   int V3 = 1;

   int V4 = (V1 == 2 ? (V3 == 2 ? 1 : 2) : (V2 == 2 ? 3 : 4));

   printf("%d\n", V4);
}
void main() {
   int V1 = 2;
   int V2 = 3;
   int V3 = 1;

   int V4;
   if (V1 == 2) {
      if (V3 == 2) {
         V4 = 1;
      } else {
         V4 = 2;
      }
   } else {
      if (V2 == 2) {
         V4 = 3;
      } else {
         V4 = 4;
      }
   }

   printf("%d\n", V4);
}

Conditional Operator

  • Obfuscated ID: 53
  • Transformed ID: 54
  • Obfuscated Answer: 1
  • Transformed Answer: 1
void main() {
   int V1 = 2;
   int V2 = 3;
   int V3 = 1;

   int V4 = V1 == 3 ? V2 : V3;

   printf("%d\n", V4);
}
void main() {
   int V1 = 2;
   int V2 = 3;
   int V3 = 1;

   int V4;
   if (V1 == 3){
      V4 = V2;
   }
   else{
      V4 = V3;
   }

   printf("%d\n", V4);
}

Arithmetic as Logic

  • Obfuscated ID: 55
  • Transformed ID: 56
  • Obfuscated Answer: true
  • Transformed Answer: true
  • Errata
void main() {
   int V1 = 8;

   if ((V1 - 3) * (7 - V1) <= 0) {
      printf("true\n");
   } else {
      printf("false\n");
   }
}
void main() {
   int V1 = 8;

   if (3 <= V1 || V1 >= 7) {
      printf("true\n");
   } else {
      printf("false\n");
   }
}

Arithmetic as Logic

  • Obfuscated ID: 57
  • Transformed ID: 58
  • Obfuscated Answer: false
  • Transformed Answer: false
  • Errata
void main() {
   int V1 = 2;

   if ((V1 - 2) * (6 - V1) > 0) {
      printf("true\n");
   } else {
      printf("false\n");
   }
}
void main() {
   int V1 = 2;

   if (V1 < 2 || 6 < V1) {
      printf("true\n");
   } else {
      printf("false\n");
   }
}

Arithmetic as Logic

  • Obfuscated ID: 59
  • Transformed ID: 60
  • Obfuscated Answer: true
  • Transformed Answer: true
void main() {
   int V1 = 5;

   if (V1 + 5 != 0) {
      printf("true\n");
   } else {
      printf("false\n");
   }
}
void main() {
   int V1 = 5;

   if (V1 != -5) {
      printf("true\n");
   } else {
      printf("false\n");
   }
}

Comma Operator

  • Obfuscated ID: 61
  • Transformed ID: 62
  • Obfuscated Answer: 2 1
  • Transformed Answer: 2 1
void main() {
   int V1, V2;

   V1 = (V2 = 1, 2);

   printf("%d %d\n", V1, V2);
}
void main() {
   int V1, V2;

   V1 = 2;
   V2 = 1;

   printf("%d %d\n", V1, V2);
}

Comma Operator

  • Obfuscated ID: 63
  • Transformed ID: 64
  • Obfuscated Answer: 7 7
  • Transformed Answer: 7 7
void main() {
   int V1 = 3;
   int V2 = (V1 *= 2, V1 += 1);

   printf("%d %d\n", V1, V2);
}
void main() {
   int V1 = 3;
  
   V1 *= 2;

   int V2 = (V1 += 1);

   printf("%d %d\n", V1, V2);
}

Comma Operator

  • Obfuscated ID: 65
  • Transformed ID: 66
  • Obfuscated Answer: 8 8
  • Transformed Answer: 8 8
void main() {
   int V1 = 3;
   int V2 = (V1 += 1, V1 *= 2);

   printf("%d %d\n", V1, V2);
}

void main() {
   int V1 = 3;
  
   V1 += 1;

   int V2 = (V1 *= 2);

   printf("%d %d\n", V1, V2);
}

Preprocessor in Statement

  • Obfuscated ID: 67
  • Transformed ID: 68
  • Obfuscated Answer: abcdefabcdef
  • Transformed Answer: abcdefabcdef
void main() {
   char *V1 = "abcdef"
   #define M1
   "abcdef";

   printf("%s\n", V1);
}

void main() {
   char *V1 = "abcdef"
   "abcdef";

   #define M1

   printf("%s\n", V1);
}

Preprocessor in Statement

  • Obfuscated ID: 69
  • Transformed ID: 70
  • Obfuscated Answer: 4 5
  • Transformed Answer: 4 5
void main() {
   int V1;
   V1 = 4;

   int V2 = 1
   #define M1 1
   +
   #define M2 2
   V1;

   printf("%d %d\n", V1, V2);
}
void main() {
   #define M1 1
   #define M2 2

   int V1;
   V1 = 4;

   int V2 = 1 + V1;

   printf("%d %d\n", V1, V2);
}

Preprocessor in Statement

  • Obfuscated ID: 71
  • Transformed ID: 72
  • Obfuscated Answer: 2 1
  • Transformed Answer: 2 1
  • Errata
void main() {
   int V1 = 1, V2 = 2;

   if (V1 < V2) {
      #define M1 1
      #define M2 2
   } else {
      #define M1 2
      #define M2 1
   }

   printf("%d %d\n", M1, M2);
}
void main() {
   int V1 = 1, V2 = 2;
   #define M1 2
   #define M2 1

   printf("%d %d\n", M1, M2);
}

Assignment as Value

  • Obfuscated ID: 73
  • Transformed ID: 74
  • Obfuscated Answer: true
  • Transformed Answer: true
void main() {
   int V1 = 2;

   if (V1 = 1) {
      printf("true\n");
   } else {
      printf("false\n");
   }
}
void main() {
   int V1 = 7;
   V1 = 1;
   if (1) {
      printf("true\n");
   } else {
      printf("false\n");
   }
}

Assignment as Value

  • Obfuscated ID: 75
  • Transformed ID: 76
  • Obfuscated Answer: false
  • Transformed Answer: false
void main() {
   int V1 = 0;

   if (V1 = 0) {
      printf("true\n");
   } else {
      printf("false\n");
   }
}
void main() {
   int V1 = 0;

   V1 = 0;

   if (V1) {
      printf("true\n");
   } else {
      printf("false\n");
   }
}

Assignment as Value

  • Obfuscated ID: 77
  • Transformed ID: 78
  • Obfuscated Answer: 3 9
  • Transformed Answer: 4 7
void main() {
   int V1 = 0;
   int V2 = 9;

   while (!(V1 = 3)) {
      V2--;
      V1++;
   }

   printf("%d %d\n", V1, V2);
}
void main() {
   int V1 = 0;
   int V2 = 7;

   V1 = 4;

   while (!4) {
      V2--;
      V1++;
   }

   printf("%d %d\n", V1, V2);
}

Logic as Control Flow

  • Obfuscated ID: 79
  • Transformed ID: 80
  • Obfuscated Answer: 4 10
  • Transformed Answer: 6 8
void main() {
   int V1 = 1;
   int V2 = 5;

   if (++V1 || ++V2) {
      V1 = V1 * 2;
      V2 = V2 * 2;
   }

   printf("%d %d\n", V1, V2);
}
void main() {
   int V1 = 2;
   int V2 = 4;

   if (++V1) {
        V1 = V1 * 2;
        V2 = V2 * 2;
   } else if (++V2) {
        V1 = V1 * 2;
        V2 = V2 * 2;
   }

   printf("%d %d\n", V1, V2);
}

Logic as Control Flow

  • Obfuscated ID: 81
  • Transformed ID: 82
  • Obfuscated Answer: 1 6
  • Transformed Answer: 2 7
  • Errata
void main() {
   int V1 = 1;
   int V2 = 5;

   V1 == V2 && ++V1 || ++V2;

   printf("%d %d\n", V1, V2);
}
void main() {
   int V1 = 2;
   int V2 = 6;

   if (V1 == V2) {
      ++V1;
   } else {
      ++V2;
   }

   printf("%d %d\n", V1, V2);
}

Logic as Control Flow

  • Obfuscated ID: 83
  • Transformed ID: 84
  • Obfuscated Answer: 5 5 2
  • Transformed Answer: 11 11 10
  • Errata
void main() {
   int V1 = 3;
   int V2 = 5;
   int V3 = 0;

   while (V1 != V2 && ++V1) {
      V3++;
   }

   printf("%d %d %d\n", V1, V2, V3);
}
void main() {
   int V1 = 1;
   int V2 = 11;
   int V3 = 0;

   while (V1 != V2) {
      ++V1;
      if (!V1) break;

      V3++;
   }

   printf("%d %d %d\n", V1, V2, V3);
}

Repurposed Variables

  • Obfuscated ID: 85
  • Transformed ID: 86
  • Obfuscated Answer: 2 0
  • Transformed Answer: 4 0
void main() {
   int V1[5];
   V1[4] = 3;

   while (V1[4]) {
      V1[3 - V1[4]] = V1[4];
      V1[4] = V1[4] - 1;
   }

   printf("%d %d\n", V1[1], V1[4]);
}
void main() {
   int V1[6];
   int V2 = 5;

   while (V2) {
      V1[5 - V2] = V2;
      V2 = V2 - 1;
   }

   printf("%d %d\n", V1[1], V2);
}

Repurposed Variables

  • Obfuscated ID: 87
  • Transformed ID: 88
  • Obfuscated Answer: 4
  • Transformed Answer: 1
void main() {
   int V3 = 0;

   for (int V1 = 0; V1 < 2; V1++) {
      for (int V2 = 0; V1 < 2; V1++) {
        V3 = 4 * V1 + V2;
      }
   }

   printf("%d\n", V3);
}
void main() {
   int V3 = 0;

   for (int V1 = 0; V1 < 2; V1++) {
      for (int V2 = 0; V2 < 2; V2++) {
         V3 = 4 * V1 + V2;
         V1 = V2;
      }
   }

   printf("%d\n", V3);
}

Repurposed Variables

  • Obfuscated ID: 89
  • Transformed ID: 90
  • Obfuscated Answer: 2
  • Transformed Answer: 4
void main() {
   int V1;
   for (int V2 = 0; V2 < 2; V2++) {
      V1 = (V2 < 1);
      if (V1) {
         V1 = V2 + 5;
      } else {
         V1 = V1 + 2;
      }
   }
   printf("%d\n", V1);
}
void main() {
   int V1;
   for (int V2 = 0; V2 < 2; V2++) {
      int V3 = (V2 < 1);
      if (V3) {
         V1 = V2 + 4;
      } else {
         V1 = V3 + 4;
      }
   }
   printf("%d\n", V1);
}

Reversed Subscripts

  • Obfuscated ID: 91
  • Transformed ID: 92
  • Obfuscated Answer: e
  • Transformed Answer: b
void main() {
   char V1 = 2["qwert"];

   printf("%c\n", V1);
}
void main() {
   char V1 = "zxcvb"[4];

   printf("%c\n", V1);
}

Reversed Subscripts

  • Obfuscated ID: 93
  • Transformed ID: 94
  • Obfuscated Answer: v
  • Transformed Answer: d
void main() {
   char V1 = 3;
   char V2 = V1["zxcvb"];

   printf("%c\n", V2);
}
void main() {
   char V1 = 2;
   char V2 = "asdfg"[V1];

   printf("%c\n", V2);
}

Reversed Subscripts

  • Obfuscated ID: 95
  • Transformed ID: 96
  • Obfuscated Answer: s
  • Transformed Answer: e
void main() {
   char V1 = 4;
   char* V2 = "qazwsx";
   char V3 = V1[V2];

   printf("%c\n", V3);
}
void main() {
   char V1 = 4;
   char* V2 = "abcdef";
   char V3 = V2[V1];

   printf("%c\n", V3);
}

Dead, Unreachable, Repeated

  • Obfuscated ID: 97
  • Transformed ID: 98
  • Obfuscated Answer: 2
  • Transformed Answer: 2
void main() {
   int V1 = 1;

   V1 = 3;
   V1 = 2;

   printf("%d\n", V1);
}
void main() {
  int V1 = 1;

  V1 = 2;

  printf("%d\n", V1);
}

Dead, Unreachable, Repeated

  • Obfuscated ID: 99
  • Transformed ID: 100
  • Obfuscated Answer: 1
  • Transformed Answer: 1
void main() {
   int V1 = 1;

   if (0) {
      V1 = 3;
   }

   printf("%d\n", V1);
}
void main() {
   int V1 = 1;

   printf("%d\n", V1);
}

Dead, Unreachable, Repeated

  • Obfuscated ID: 101
  • Transformed ID: 102
  • Obfuscated Answer: 0
  • Transformed Answer: 0
void main() {
   int V1 = 0;

   V1 = V1;

   printf("%d\n", V1);
}
void main() {
   int V1 = 0;

   printf("%d\n", V1);
}

Change of Literal Encoding

  • Obfuscated ID: 103
  • Transformed ID: 104
  • Obfuscated Answer: h
  • Transformed Answer: g
void main() {
   char V1 = 104;
   printf("%c\n", V1);
}
void main() {
   char V1 = 'g';

   printf("%c\n", V1);
}

Change of Literal Encoding

  • Obfuscated ID: 105
  • Transformed ID: 106
  • Obfuscated Answer: 11
  • Transformed Answer: 23
  • Errata
void main() {
   int V1 = 013;

   printf("%d\n", V1);
}
void main() {
   char V1 = 23;
 
   printf("%d\n", V1);
}

Change of Literal Encoding

  • Obfuscated ID: 107
  • Transformed ID: 108
  • Obfuscated Answer: 0
  • Transformed Answer: 0
  • Errata
void main() {
   int V1 = 208 & 13;

   printf("%d\n", V1);
}
void main() {
   char V1 = 0xD0 & 0x0D;

   printf("%d\n", V1);
}

Omitted Curly Braces

  • Obfuscated ID: 109
  • Transformed ID: 110
  • Obfuscated Answer: 3
  • Transformed Answer: 3
void main() {
   int V1 = 2;

   if (0) V1++; V1++;

   printf("%d\n", V1);
}
void main() {
   int V1 = 2;

   if (0) { V1++; } V1++;

   printf("%d\n", V1);
}

Omitted Curly Braces

  • Obfuscated ID: 111
  • Transformed ID: 112
  • Obfuscated Answer: 5 3
  • Transformed Answer: 8 3
void main() {
   int V1 = 4;

   int V2 = 0;
   while (V2 < 3) V2++; V1++;

   printf("%d %d\n", V1, V2);
}
void main() {
   int V1 = 7;

   int V2 = 1;
   while (V2 < 3) { V2++; } V1++;
 
   printf("%d %d\n", V1, V2);
}

Omitted Curly Braces

  • Obfuscated ID: 113
  • Transformed ID: 114
  • Obfuscated Answer: 7
  • Transformed Answer: 8
void main() {
   int V1 = 3;

   for (int V2 = 0; V2 < 3; V2++) V1++; V1++;

   printf("%d\n", V1);
}
void main() {
   int V1 = 4;

   for (int V2 = 0; V2 < 3; V2++) { V1++; } V1++;

   printf("%d\n", V1);
}

Type Conversion

  • Obfuscated ID: 115
  • Transformed ID: 116
  • Obfuscated Answer: 1
  • Transformed Answer: 2
void main() {
   float V1 = 1.99;

   int V2 = V1;
 
   printf("%d\n", V2);
}
#include <math.h>
void main() {
   float V1 = 2.87;

   int V2 = trunc(V1);

   printf("%d\n", V2);
}

Type Conversion

  • Obfuscated ID: 117
  • Transformed ID: 118
  • Obfuscated Answer: 4
  • Transformed Answer: 4
void main() {
   int V1 = -1;

   unsigned int V2 = V1;

   int V3;
   if (V2 > 0) {
      V3 = 4;
   } else {
      V3 = 5;
   }

   printf("%d\n", V3);
}
#include  <limits.h>
void main() {
   int V1 = -1;

   unsigned int V2;
   if (V1 >= 0) {
      V2 = V1;
   } else {
      V2 = UINT_MAX + (V1 + 1);
   }

   int V3;
   if (V2 >= 0) {
      V3 = 4;
   } else {
      V3 = 5;
   }  

   printf("%d\n", V3);
}

Type Conversion

  • Obfuscated ID: 119
  • Transformed ID: 120
  • Obfuscated Answer: 5
  • Transformed Answer: 32
  • Errata
void main() {
   int V1 = 261;

   char V2 = V1;

   printf("%d\n", V2);
}
void main() {
   int V1 = 288;

   char V2 = V1 % 256;

   printf("%d\n", V2);
}

Indentation with Braces

  • Obfuscated ID: 121
  • Transformed ID: 122
  • Obfuscated Answer: 4
  • Transformed Answer: 4
  • Errata
void main() {
   int V1 = 0;
   int V2 = 2;

   if (V1) {}
      V2 = 4;

   printf("%d\n", V2);
}
void main() {
   int V1 = 0;
   int V2 = 2;

   if (V1) {}
   V2 = 4;

   printf("%d\n", V2);
}

Indentation with Braces

  • Obfuscated ID: 123
  • Transformed ID: 124
  • Obfuscated Answer: 3
  • Transformed Answer: 10
  • Errata
void main() {
   int V1 = 0;
   int V2 = 1;

   if (V1) {
      V2 = 2;
   }
      V2 = V2 * 3;

   printf("%d\n", V2);
}
void main() {
   int V1 = 0;
   int V2 = 5;

   if (V1) {
      V2 = 2;
   }
   V2 = V2 * 2;

   printf("%d\n", V2);
}

Indentation with Braces

  • Obfuscated ID: 125
  • Transformed ID: 126
  • Obfuscated Answer: 7
  • Transformed Answer: 9
  • Errata
void main() {
   int V1 = 2;
   int V2 = 0;
   int V3 = 3;

   if (V1) {
      if (V2) {
         V3 = V3 +2;
   } else {
      V3 = V3 + 4;
   }
   }

   printf("%d\n", V3);
}
void main() {
  int V1 = 2;
  int V2 = 0;
  int V3 = 5;

  if (V1) {
     if (V2) {
        V3 = V3 + 2;
     } else {
        V3 = V3 + 4;
     }
  }

  printf("%d\n", V3);
}