#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 *);
void main() {
  int x;
  printf("Please enter an integer: ");
  scanf("%d", &x);
  if (x > 5) {
    printf("\nThe number you entered is greater than 5.");
    x = 10;
  } else {
    printf("\nThe number you entered in not greater than 5.");
    x = 100;
  }
  printf("\nThe value in the variable x is %d.", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x5,-0x4(%rbp)
jle    116a <main+0x4a>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x4(%rbp)
jmp    117f <main+0x5f>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x6,0xc(%rsp)
lea    0xecd(%rip),%rax
lea    0xef1(%rip),%rdi
cmovge %rax,%rdi
mov    $0xa,%eax
mov    $0x64,%ebx
cmovge %eax,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,0xc(%rsp)
lea    0xefd(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Please enter an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"\0AThe number you entered is greater than 5.\00"
@.str.3 = [47 x i8] c"\0AThe number you entered in not greater than 5.\00"
@.str.4 = [36 x i8] c"\0AThe value in the variable x is %d.\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 5
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
store i32 10, i32* %1
br label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
store i32 100, i32* %1
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Please enter an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"\0AThe number you entered is greater than 5.\00"
@.str.3 = [47 x i8] c"\0AThe number you entered in not greater than 5.\00"
@.str.4 = [36 x i8] c"\0AThe value in the variable x is %d.\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 5
%7 = select i1 %6, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0)
%8 = select i1 %6, i32 10, i32 100
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7)
store i32 %8, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %8)
ret void
}