#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i;
  int aa, bb;
  for (i = 0; i < 1024; i++) {
    if (i % 2 == 0) {
      aa = 3;
      bb = 4;
    } else {
      aa = 2;
      bb = 2;
    }
    if (aa == 2)
      aa = 0;
    if (bb == 2)
      bb = 0;
    if (aa == bb)
      printf("Pippo");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
jge    11b5 <main+0xa5>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115a <main+0x4a>
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
jmp    1168 <main+0x58>
movl   $0x2,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1179 <main+0x69>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0x10(%rbp)
jne    118a <main+0x7a>
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11a2 <main+0x92>
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
jmp    11a7 <main+0x97>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
lea    0xee4(%rip),%rbx
jmp    112b <main+0x1b>
xchg   %ax,%ax
add    $0x1,%ebp
cmp    $0x400,%ebp
je     114c <main+0x3c>
xor    %eax,%eax
mov    %ebp,%ecx
and    $0x1,%ecx
sete   %al
shl    $0x2,%ecx
xor    $0x4,%ecx
lea    (%rax,%rax,2),%eax
cmp    %ecx,%eax
jne    1120 <main+0x10>
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Pippo\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %29, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1024
br i1 %7, label %8, label %32
8: ; preds = %5
%9 = load i32, i32* %2
%10 = srem i32 %9, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 3, i32* %3
store i32 4, i32* %4
br label %14
13: ; preds = %8
store i32 2, i32* %3
store i32 2, i32* %4
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 0, i32* %3
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 2
br i1 %20, label %21, label %22
21: ; preds = %18
store i32 0, i32* %4
br label %22
22: ; preds = %21, %18
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
br label %29
29: ; preds = %28
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %5
32: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Pippo\00"
define i32 @main() {
br label %1
1: ; preds = %0, %11
%2 = phi i32 [ 0, %0 ], [ %12, %11 ]
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
%5 = shl nuw nsw i32 %3, 2
%6 = xor i32 %5, 4
%7 = select i1 %4, i32 3, i32 0
%8 = icmp eq i32 %7, %6
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %1, %9
%12 = add nuw nsw i32 %2, 1
%13 = icmp eq i32 %12, 1024
br i1 %13, label %14, label %1
14: ; preds = %11
ret i32 0
}