#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 /*<<< orphan*/ scanf(char *, int volatile *);
int main() {
  volatile int i = 0;
  while (i == 0) {
    printf("In cycle\n");
    i++;
  }
  i = 0;
  while (i++ < 10) {
    printf("%d ", i);
  }
  printf("\n");
  while (i) {
    printf("%d ", i);
    i--;
  }
  printf("\n");
  do {
    scanf("%d ", &i);
  } while (i);
  while (1) {
    scanf("%d", &i);
    if (i == 0)
      continue;
    else {
      printf("i is not 0 and is %d", i);
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    115e <main+0x3e>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0xa,%eax
jge    118f <main+0x6f>
mov    -0x8(%rbp),%esi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1165 <main+0x45>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     11c8 <main+0xa8>
mov    -0x8(%rbp),%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    119d <main+0x7d>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe2d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    11d6 <main+0xb6>
jmp    11f7 <main+0xd7>
lea    0xe22(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    1218 <main+0xf8>
jmp    11f7 <main+0xd7>
mov    -0x8(%rbp),%esi
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
cmpl   $0x0,0x4(%rsp)
jne    1174 <main+0x34>
lea    0xebf(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <puts@plt>
addl   $0x1,0x4(%rsp)
cmpl   $0x0,0x4(%rsp)
je     1160 <main+0x20>
movl   $0x0,0x4(%rsp)
mov    0x4(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
cmp    $0x9,%eax
jg     11be <main+0x7e>
lea    0xe6d(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
cmp    $0xa,%eax
jl     11a0 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
je     11fa <main+0xba>
lea    0xe2a(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
addl   $0xffffffff,0x4(%rsp)
cmpl   $0x0,0x4(%rsp)
jne    11e0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdf5(%rip),%r14
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jne    1210 <main+0xd0>
lea    0xded(%rip),%r14
lea    0x4(%rsp),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
je     1230 <main+0xf0>
mov    0x4(%rsp),%esi
lea    0xdb7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"In cycle\0A\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [21 x i8] c"i is not 0 and is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store volatile i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load volatile i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = load volatile i32, i32* %2
%9 = add nsw i32 %8, 1
store volatile i32 %9, i32* %2
br label %3
10: ; preds = %3
store volatile i32 0, i32* %2
br label %11
11: ; preds = %15, %10
%12 = load volatile i32, i32* %2
%13 = add nsw i32 %12, 1
store volatile i32 %13, i32* %2
%14 = icmp slt i32 %12, 10
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load volatile i32, i32* %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %11
18: ; preds = %11
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %23, %18
%21 = load volatile i32, i32* %2
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load volatile i32, i32* %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = load volatile i32, i32* %2
%27 = add nsw i32 %26, -1
store volatile i32 %27, i32* %2
br label %20
28: ; preds = %20
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %32, %28
%31 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %32
32: ; preds = %30
%33 = load volatile i32, i32* %2
%34 = icmp ne i32 %33, 0
br i1 %34, label %30, label %35
35: ; preds = %32
br label %36
36: ; preds = %35, %40
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%38 = load volatile i32, i32* %2
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %36
br label %36
41: ; preds = %36
%42 = load volatile i32, i32* %2
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %41
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [21 x i8] c"i is not 0 and is %d\00"
@str = [9 x i8] c"In cycle\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%7 = load volatile i32, i32* %1
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %1
%9 = load volatile i32, i32* %1
%10 = icmp eq i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
store volatile i32 0, i32* %1
%12 = load volatile i32, i32* %1
%13 = add nsw i32 %12, 1
store volatile i32 %13, i32* %1
%14 = icmp slt i32 %12, 10
br i1 %14, label %15, label %21
15: ; preds = %11, %15
%16 = load volatile i32, i32* %1
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load volatile i32, i32* %1
%19 = add nsw i32 %18, 1
store volatile i32 %19, i32* %1
%20 = icmp slt i32 %18, 10
br i1 %20, label %15, label %21
21: ; preds = %15, %11
%22 = tail call i32 @putchar(i32 10)
%23 = load volatile i32, i32* %1
%24 = icmp eq i32 %23, 0
br i1 %24, label %32, label %25
25: ; preds = %21, %25
%26 = load volatile i32, i32* %1
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = load volatile i32, i32* %1
%29 = add nsw i32 %28, -1
store volatile i32 %29, i32* %1
%30 = load volatile i32, i32* %1
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %25
32: ; preds = %25, %21
%33 = tail call i32 @putchar(i32 10)
br label %34
34: ; preds = %34, %32
%35 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%36 = load volatile i32, i32* %1
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %34
38: ; preds = %34, %38
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%40 = load volatile i32, i32* %1
%41 = icmp eq i32 %40, 0
br i1 %41, label %38, label %42
42: ; preds = %38
%43 = load volatile i32, i32* %1
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %43)
ret i32 0
}