#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);
int main() {
  int age = 5;
  int majeur = age >= 18 ? 1 : 0;
  printf("%d\n", majeur);
  age = 20;
  majeur = age >= 18 ? 1 : 0;
  printf("%d\n", majeur);
  int entre30et50 = age < 30 ? 0 : age > 50 ? 0 : 1;
  printf("%d\n", entre30et50);
  age = 35;
  entre30et50 = age < 30 ? 0 : age > 50 ? 0 : 1;
  printf("%d\n", entre30et50);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x12,%edx
cmovge %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x14,-0x8(%rbp)
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x12,%edx
cmovge %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1e,-0x8(%rbp)
jge    1185 <main+0x75>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1198 <main+0x88>
mov    -0x8(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x32,%edx
cmovg  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
movl   $0x23,-0x8(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jge    11c8 <main+0xb8>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    11db <main+0xcb>
mov    -0x8(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x32,%edx
cmovg  %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 18
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 20, i32* %2
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 18
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 30
br i1 %18, label %19, label %20
19: ; preds = %0
br label %25
20: ; preds = %0
%21 = load i32, i32* %2
%22 = icmp sgt i32 %21, 50
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 0, i32 1
br label %25
25: ; preds = %20, %19
%26 = phi i32 [ 0, %19 ], [ %24, %20 ]
store i32 %26, i32* %4
%27 = load i32, i32* %4
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
store i32 35, i32* %2
%29 = load i32, i32* %2
%30 = icmp slt i32 %29, 30
br i1 %30, label %31, label %32
31: ; preds = %25
br label %37
32: ; preds = %25
%33 = load i32, i32* %2
%34 = icmp sgt i32 %33, 50
%35 = zext i1 %34 to i64
%36 = select i1 %34, i32 0, i32 1
br label %37
37: ; preds = %32, %31
%38 = phi i32 [ 0, %31 ], [ %36, %32 ]
store i32 %38, i32* %4
%39 = load i32, i32* %4
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}