#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 *);
int main(void) {
  printf(" * First example :\n");
  int my_var;
  while (my_var != 10) {
    printf("Please, give me a 10 : ");
    scanf("%d", &my_var);
  }
  printf("\n");
  printf(" * Second example :\n");
  while (1) {
    printf("Please, give me another 10 : ");
    scanf("%d", &my_var);
    if (my_var == 10) {
      break;
    }
  }
  printf("\n");
  printf(" * Third example :\n");
  int a = 0;
  while (a != 10) {
    a++;
    if (a == 4) {
      continue;
    }
    printf("Value of a : %d\n", a);
  }
  printf("\n");
  printf(" * Last example :\n");
  do {
    printf("Come on! Ge me for the last time a 10 : ");
    scanf("%d", &my_var);
  } while (my_var != 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xa,-0x8(%rbp)
je     116a <main+0x4a>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    113d <main+0x1d>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xa,-0x8(%rbp)
jne    11b3 <main+0x93>
jmp    11b8 <main+0x98>
jmp    1186 <main+0x66>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
je     1213 <main+0xf3>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jne    11fd <main+0xdd>
jmp    11db <main+0xbb>
mov    -0xc(%rbp),%esi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11db <main+0xbb>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xa,-0x8(%rbp)
jne    122f <main+0x10f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xf23(%rip),%rdi
call   1040 <puts@plt>
lea    0xea4(%rip),%r14
lea    0xeb5(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
cmpl   $0xa,0xc(%rsp)
jne    1170 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xee9(%rip),%rdi
call   1040 <puts@plt>
lea    0xe72(%rip),%r14
lea    0xe68(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
cmpl   $0xa,0xc(%rsp)
jne    11c0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xead(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
lea    0xe3b(%rip),%r14
jmp    1203 <main+0xc3>
add    $0x1,%ebx
cmp    $0x4,%ebx
je     1200 <main+0xc0>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xa,%ebx
jne    1200 <main+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe83(%rip),%rdi
call   1040 <puts@plt>
lea    0xe14(%rip),%r14
lea    0xddb(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
cmpl   $0xa,0xc(%rsp)
jne    1250 <main+0x110>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c" * First example :\0A\00"
@.str.1 = [24 x i8] c"Please, give me a 10 : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [21 x i8] c" * Second example :\0A\00"
@.str.5 = [30 x i8] c"Please, give me another 10 : \00"
@.str.6 = [20 x i8] c" * Third example :\0A\00"
@.str.7 = [17 x i8] c"Value of a : %d\0A\00"
@.str.8 = [19 x i8] c" * Last example :\0A\00"
@.str.9 = [41 x i8] c"Come on! Ge me for the last time a 10 : \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
br label %5
11: ; preds = %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %14
14: ; preds = %11, %20
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 10
br i1 %18, label %19, label %20
19: ; preds = %14
br label %21
20: ; preds = %14
br label %14
21: ; preds = %19
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %3
br label %24
24: ; preds = %33, %32, %21
%25 = load i32, i32* %3
%26 = icmp ne i32 %25, 10
br i1 %26, label %27, label %36
27: ; preds = %24
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
%30 = load i32, i32* %3
%31 = icmp eq i32 %30, 4
br i1 %31, label %32, label %33
32: ; preds = %27
br label %24
33: ; preds = %27
%34 = load i32, i32* %3
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %34)
br label %24
36: ; preds = %24
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %39
39: ; preds = %42, %36
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
br label %42
42: ; preds = %39
%43 = load i32, i32* %2
%44 = icmp ne i32 %43, 10
br i1 %44, label %39, label %45
45: ; preds = %42
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"Please, give me a 10 : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.5 = [30 x i8] c"Please, give me another 10 : \00"
@.str.7 = [17 x i8] c"Value of a : %d\0A\00"
@.str.9 = [41 x i8] c"Come on! Ge me for the last time a 10 : \00"
@str = [19 x i8] c" * First example :\00"
@str.10 = [20 x i8] c" * Second example :\00"
@str.11 = [19 x i8] c" * Third example :\00"
@str.12 = [18 x i8] c" * Last example :\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
br label %4
4: ; preds = %0, %4
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %4
9: ; preds = %4
%10 = call i32 @putchar(i32 10)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.10, i64 0, i64 0))
br label %12
12: ; preds = %12, %9
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%15 = load i32, i32* %1
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %12
17: ; preds = %12
%18 = call i32 @putchar(i32 10)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.11, i64 0, i64 0))
br label %20
20: ; preds = %27, %17
%21 = phi i32 [ 0, %17 ], [ %22, %27 ]
%22 = add nuw nsw i32 %21, 1
%23 = icmp eq i32 %22, 4
br i1 %23, label %27, label %24
24: ; preds = %20
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %22)
%26 = icmp eq i32 %22, 10
br i1 %26, label %28, label %27
27: ; preds = %24, %20
br label %20
28: ; preds = %24
%29 = call i32 @putchar(i32 10)
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.12, i64 0, i64 0))
br label %31
31: ; preds = %31, %28
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%34 = load i32, i32* %1
%35 = icmp eq i32 %34, 10
br i1 %35, label %36, label %31
36: ; preds = %31
ret i32 0
}