#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 = 123, j = 5;
  while (1) {
    if (i != 0 && j < 10 && i != j) {
      printf("1\n");
    }
    printf("2\n");
    i++;
    if (i == 0)
      printf("3\n");
    j++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1159 <main+0x49>
cmpl   $0xa,-0xc(%rbp)
jge    1159 <main+0x49>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1159 <main+0x49>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1184 <main+0x74>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x5,%ebp
lea    0xee2(%rip),%r14
lea    0xed9(%rip),%rbx
jmp    113b <main+0x2b>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x1,%ebp
cmp    $0x9,%ebp
ja     1130 <main+0x20>
mov    %r14,%rdi
call   1030 <puts@plt>
jmp    1130 <main+0x20>

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

LLVM IR (-O2):
@str = [2 x i8] c"2\00"
@str.3 = [2 x i8] c"1\00"
define i32 @main() {
br label %1
1: ; preds = %6, %0
%2 = phi i32 [ 5, %0 ], [ %8, %6 ]
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%8 = add nuw nsw i32 %2, 1
br label %1
}