#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 = 10;
  if (my_var == 10) {
    printf("True statement !\n");
  }
  printf("\n");
  printf(" * Second example :\n");
  int another_var = 10;
  int other_var = 3;
  if ((another_var > other_var) || (other_var == 4)) {
    printf("true statement !\n");
  }
  printf("\n");
  printf(" * Third example :\n");
  int your_age;
  printf("How old are you ? ");
  scanf("%d", &your_age);
  if (your_age >= 18) {
    printf("Welcome in my bar!\n");
  } else if ((your_age < 18) && (your_age >= 16)) {
    printf("It's okay, you could stay!\n");
  } else {
    printf("Get out!\n");
  }
  printf("\n");
  printf(" * Fourth example :\n");
  printf("How old are you ? ");
  scanf("%d", &your_age);
  if (your_age >= 18)
    printf("Welcome in my bar!\n");
  else if ((your_age < 18) && (your_age >= 16))
    printf("It's okay, you could stay!\n");
  else
    printf("Get out!i\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movl   $0xa,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1158 <main+0x38>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
movl   $0xa,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1194 <main+0x74>
cmpl   $0x4,-0x10(%rbp)
jne    11a0 <main+0x80>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x12,-0x14(%rbp)
jl     11ef <main+0xcf>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    1225 <main+0x105>
cmpl   $0x12,-0x14(%rbp)
jge    1214 <main+0xf4>
cmpl   $0x10,-0x14(%rbp)
jl     1214 <main+0xf4>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
jmp    1220 <main+0x100>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
jmp    1225 <main+0x105>
lea    0xdf9(%rip),%rdi
call   1030 <printf@plt>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe1e(%rip),%rdi
call   1030 <printf@plt>
lea    0xe25(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x12,-0x14(%rbp)
jl     1274 <main+0x154>
lea    0xe0e(%rip),%rdi
call   1030 <printf@plt>
jmp    12aa <main+0x18a>
cmpl   $0x12,-0x14(%rbp)
jge    1299 <main+0x179>
cmpl   $0x10,-0x14(%rbp)
jl     1299 <main+0x179>
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
jmp    12a5 <main+0x185>
lea    0xe27(%rip),%rdi
call   1030 <printf@plt>
jmp    12aa <main+0x18a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec5(%rip),%rdi
call   1040 <puts@plt>
lea    0xecd(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
lea    0xe5c(%rip),%r14
mov    %r14,%rdi
call   1050 <printf@plt>
lea    0xe60(%rip),%r13
lea    0xc(%rsp),%r15
mov    %r13,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x10,%eax
lea    0xec9(%rip),%r12
lea    0xe9b(%rip),%rdi
cmovge %r12,%rdi
cmp    $0x12,%eax
lea    0xecf(%rip),%rbx
cmovge %rbx,%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe7c(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x10,%eax
lea    0xe6a(%rip),%rdi
cmovge %r12,%rdi
cmp    $0x12,%eax
cmovge %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c" * First example :\0A\00"
@.str.1 = [18 x i8] c"True statement !\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [21 x i8] c" * Second example :\0A\00"
@.str.4 = [18 x i8] c"true statement !\0A\00"
@.str.5 = [20 x i8] c" * Third example :\0A\00"
@.str.6 = [19 x i8] c"How old are you ? \00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [20 x i8] c"Welcome in my bar!\0A\00"
@.str.9 = [28 x i8] c"It's okay, you could stay!\0A\00"
@.str.10 = [10 x i8] c"Get out!\0A\00"
@.str.11 = [21 x i8] c" * Fourth example :\0A\00"
@.str.12 = [11 x i8] c"Get out!i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 10, i32* %2
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
store i32 10, i32* %3
store i32 3, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = icmp sgt i32 %14, %15
br i1 %16, label %20, label %17
17: ; preds = %11
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 4
br i1 %19, label %20, label %22
20: ; preds = %17, %11
%21 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
%23 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%25 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %5)
%27 = load i32, i32* %5
%28 = icmp sge i32 %27, 18
br i1 %28, label %29, label %31
29: ; preds = %22
%30 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
br label %42
31: ; preds = %22
%32 = load i32, i32* %5
%33 = icmp slt i32 %32, 18
br i1 %33, label %34, label %39
34: ; preds = %31
%35 = load i32, i32* %5
%36 = icmp sge i32 %35, 16
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
br label %41
39: ; preds = %34, %31
%40 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
br label %41
41: ; preds = %39, %37
br label %42
42: ; preds = %41, %29
%43 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
%45 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %5)
%47 = load i32, i32* %5
%48 = icmp sge i32 %47, 18
br i1 %48, label %49, label %51
49: ; preds = %42
%50 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
br label %62
51: ; preds = %42
%52 = load i32, i32* %5
%53 = icmp slt i32 %52, 18
br i1 %53, label %54, label %59
54: ; preds = %51
%55 = load i32, i32* %5
%56 = icmp sge i32 %55, 16
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
br label %61
59: ; preds = %54, %51
%60 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
br label %61
61: ; preds = %59, %57
br label %62
62: ; preds = %61, %49
ret i32 0
}

LLVM IR (-O2):
@.str.6 = [19 x i8] c"How old are you ? \00"
@.str.7 = [3 x i8] c"%d\00"
@str = [20 x i8] c" * First example :\00"
@str.13 = [17 x i8] c"True statement !\00"
@str.14 = [20 x i8] c" * Second example :\00"
@str.15 = [17 x i8] c"true statement !\00"
@str.16 = [19 x i8] c" * Third example :\00"
@str.17 = [9 x i8] c"Get out!\00"
@str.18 = [20 x i8] c" * Fourth example :\00"
@str.19 = [10 x i8] c"Get out!i\00"
@str.22 = [27 x i8] c"It's okay, you could stay!\00"
@str.23 = [19 x i8] c"Welcome in my bar!\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.13, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.14, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.15, i64 0, i64 0))
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.16, i64 0, i64 0))
%9 = bitcast i32* %1 to i8*
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = icmp sgt i32 %12, 17
%14 = icmp sgt i32 %12, 15
%15 = select i1 %14, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @str.22, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.17, i64 0, i64 0)
%16 = select i1 %13, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.23, i64 0, i64 0), i8* %15
%17 = call i32 @puts(i8* dereferenceable(1) %16)
%18 = call i32 @putchar(i32 10)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.18, i64 0, i64 0))
%20 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %1)
%22 = load i32, i32* %1
%23 = icmp sgt i32 %22, 17
%24 = icmp sgt i32 %22, 15
%25 = select i1 %24, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @str.22, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.19, i64 0, i64 0)
%26 = select i1 %23, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.23, i64 0, i64 0), i8* %25
%27 = call i32 @puts(i8* dereferenceable(1) %26)
ret i32 0
}