xunge/DecIR huggingface dataset:
int gabort(noval)
int noval;
{
  int c;
  printf("Abort message? ");
  c = getchar();
  if (toupper(c) == 'Y') {
    puts("Yes");
    return (1);
  }
  puts("No");
  return (noval);
}


x86 assembly (clang, -O0):
<gabort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <toupper@plt>
cmp    $0x59,%eax
jne    118e <gabort+0x4e>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a2 <gabort+0x62>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <puts@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gabort>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%edi
call   1030 <toupper@plt>
cmp    $0x59,%eax
lea    0xea5(%rip),%rax
lea    0xea2(%rip),%rdi
cmove  %rax,%rdi
mov    $0x1,%ebp
cmovne %ebx,%ebp
xor    %eax,%eax
call   1040 <puts@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Abort message? \00"
@.str.1 = [4 x i8] c"Yes\00"
@.str.2 = [3 x i8] c"No\00"
define i32 @gabort(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @getchar()
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @toupper(i32 %7)
%9 = icmp eq i32 %8, 89
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %15
12: ; preds = %1
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [16 x i8] c"Abort message? \00"
@.str.1 = [4 x i8] c"Yes\00"
@.str.2 = [3 x i8] c"No\00"
define i32 @gabort(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 @toupper(i32 %3)
%5 = icmp eq i32 %4, 89
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%7 = select i1 %5, i32 1, i32 %0
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %6)
ret i32 %7
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
int random_val(int min, int max) {
  double weight = rand() / (double)RAND_MAX;
  int result = min * (1 - weight) + max * weight;
  return result;
}


x86 assembly (clang, -O0):
<random_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ebc(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm2
subsd  -0x10(%rbp),%xmm2
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_val>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec3(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movsd  0xec3(%rip),%xmm2
subsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
cvttsd2si %xmm1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @random_val(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call double (...) @rand()
%8 = load i64, i64* @RAND_MAX
%9 = sitofp i64 %8 to double
%10 = fdiv double %7, %9
store double %10, double* %5
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = load double, double* %5
%14 = fsub double 1.000000e+00, %13
%15 = load i32, i32* %4
%16 = sitofp i32 %15 to double
%17 = load double, double* %5
%18 = fmul double %16, %17
%19 = call double @llvm.fmuladd.f64(double %12, double %14, double %18)
%20 = fptosi double %19 to i32
store i32 %20, i32* %6
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @random_val(i32 %0, i32 %1) {
%3 = tail call double (...) @rand()
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
%7 = sitofp i32 %0 to double
%8 = fsub double 1.000000e+00, %6
%9 = sitofp i32 %1 to double
%10 = fmul double %6, %9
%11 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %10)
%12 = fptosi double %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ cc_asprintf(char **, char *, char const *);
char *cc_string_alloc_from_str(char const *value) {
  char *string;
  cc_asprintf(&string, "\"%s\"", value);
  return string;
}


x86 assembly (clang, -O0):
<cc_string_alloc_from_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <cc_asprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_string_alloc_from_str>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rsi
mov    %rsp,%rdi
call   1030 <cc_asprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\22%s\22\00"
define i8* @cc_string_alloc_from_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @cc_asprintf(i8** %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"\22%s\22\00"
define i8* @cc_string_alloc_from_str(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @cc_asprintf(i8** %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i8*, i8** %2
ret i8* %5
}
/* Variables and functions */
bool isNum(char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<isNum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isNum+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNum>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isNum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isNum(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned long nibble_sort_word_mkbosmans_insertionsort(unsigned long);
void nibble_sort_bosmans2(unsigned long *buf) {
  for (int i = 0; i < 1024; i++)
    buf[i] = nibble_sort_word_mkbosmans_insertionsort(buf[i]);
}


x86 assembly (clang, -O0):
<nibble_sort_bosmans2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    115e <nibble_sort_bosmans2+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <nibble_sort_word_mkbosmans_insertionsort@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <nibble_sort_bosmans2+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_sort_bosmans2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <nibble_sort_word_mkbosmans_insertionsort@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    1120 <nibble_sort_bosmans2+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @nibble_sort_bosmans2(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1024
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i64*, i64** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i64, i64* %8, i64 %10
%12 = load i64, i64* %11
%13 = call i64 @nibble_sort_word_mkbosmans_insertionsort(i64 %12)
%14 = load i64*, i64** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %14, i64 %16
store i64 %13, i64* %17
br label %18
18: ; preds = %7
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @nibble_sort_bosmans2(i64* nocapture %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %8, %3 ]
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = tail call i64 @nibble_sort_word_mkbosmans_insertionsort(i64 %6)
store i64 %7, i64* %5
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 1024
br i1 %9, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int INLINE_SYSCALL(int /*<<< orphan*/, int, int /*<<< orphan*/, char const *,
                   int /*<<< orphan*/);
int /*<<< orphan*/ unlinkat;
int __unlink(const char *name) {
  return INLINE_SYSCALL(unlinkat, 3, AT_FDCWD, name, 0);
}


x86 assembly (clang, -O0):
<__unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rcx
mov    $0x3,%esi
xor    %r8d,%r8d
call   1030 <INLINE_SYSCALL@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__unlink>:
mov    %rdi,%rcx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%esi
xor    %r8d,%r8d
jmp    1030 <INLINE_SYSCALL@plt>

LLVM IR (-O0):
@unlinkat = global i32 0
@AT_FDCWD = global i32 0
define i32 @__unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @unlinkat
%4 = load i32, i32* @AT_FDCWD
%5 = load i8*, i8** %2
%6 = call i32 @INLINE_SYSCALL(i32 %3, i32 3, i32 %4, i8* %5, i32 0)
ret i32 %6
}

LLVM IR (-O2):
@unlinkat = global i32 0
@AT_FDCWD = global i32 0
define i32 @__unlink(i8* %0) {
%2 = load i32, i32* @unlinkat
%3 = load i32, i32* @AT_FDCWD
%4 = tail call i32 @INLINE_SYSCALL(i32 %2, i32 3, i32 %3, i8* %0, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, float const);
void float32Print(FILE *fp, const float *data, int indent) {
  fprintf(fp, "%g", *data);
}


x86 assembly (clang, -O0):
<float32Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float32Print>:
movss  (%rsi),%xmm0
lea    0xee5(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%g\00"
define void @float32Print(i32* %0, float* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca float*
%6 = alloca i32
store i32* %0, i32** %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load float*, float** %5
%9 = load float, float* %8
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %9)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%g\00"
define void @float32Print(i32* nocapture %0, float* nocapture %1, i32 %2) {
%4 = load float, float* %1
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %4)
ret void
}
/* Variables and functions */
int old_foreach_bridge(int (*)(char const *, void *), void *);
int br_foreach_bridge(int (*iterator)(const char *, void *), void *arg) {
  int ret;
  ret = old_foreach_bridge(iterator, arg);
  return ret;
}


x86 assembly (clang, -O0):
<br_foreach_bridge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <old_foreach_bridge@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<br_foreach_bridge>:
jmp    1030 <old_foreach_bridge@plt>

LLVM IR (-O0):
define i32 @br_foreach_bridge(i32 (i8*, i8*)* %0, i8* %1) {
%3 = alloca i32 (i8*, i8*)*
%4 = alloca i8*
%5 = alloca i32
store i32 (i8*, i8*)* %0, i32 (i8*, i8*)** %3
store i8* %1, i8** %4
%6 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %3
%7 = load i8*, i8** %4
%8 = call i32 @old_foreach_bridge(i32 (i8*, i8*)* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @br_foreach_bridge(i32 (i8*, i8*)* %0, i8* %1) {
%3 = tail call i32 @old_foreach_bridge(i32 (i8*, i8*)* %0, i8* %1)
ret i32 %3
}
int pinctrl_bind_pins(struct device *dev) { return 0; }


x86 assembly (clang, -O0):
<pinctrl_bind_pins>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pinctrl_bind_pins>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.device = type opaque
define i32 @pinctrl_bind_pins(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @pinctrl_bind_pins(%struct.device* nocapture readnone %0) {
ret i32 0
}
const char *get_type_name_gameplay_screen(struct castable *castable) {
  return "gameplay_screen";
}


x86 assembly (clang, -O0):
<get_type_name_gameplay_screen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_type_name_gameplay_screen>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.castable = type opaque
@.str = [16 x i8] c"gameplay_screen\00"
define i8* @get_type_name_gameplay_screen(%struct.castable* %0) {
%2 = alloca %struct.castable*
store %struct.castable* %0, %struct.castable** %2
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.castable = type opaque
@.str = [16 x i8] c"gameplay_screen\00"
define i8* @get_type_name_gameplay_screen(%struct.castable* nocapture readnone %0) {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ *getenv(char *);
int test_quiet(void) {
  if (getenv("TESTS_QUIET") != NULL)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test_quiet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     113a <test_quiet+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <test_quiet+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_quiet>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"TESTS_QUIET\00"
define i32 @test_quiet() {
%1 = alloca i32
%2 = call i32* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [12 x i8] c"TESTS_QUIET\00"
define i32 @test_quiet() {
%1 = tail call i32* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void idt_int5(void) { print("!! BoundCheck "); }


x86 assembly (clang, -O0):
<idt_int5>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<idt_int5>:
lea    0xee9(%rip),%rdi
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"!! BoundCheck \00"
define void @idt_int5() {
%1 = call i32 @print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"!! BoundCheck \00"
define void @idt_int5() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
void callmgr_do_nothing(int sig) {}


x86 assembly (clang, -O0):
<callmgr_do_nothing>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<callmgr_do_nothing>:
ret

LLVM IR (-O0):
define void @callmgr_do_nothing(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @callmgr_do_nothing(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int libfoo2_LTX_hello() {
  printf("** This is foolib 2 **\n");
  return 0xe110;
}


x86 assembly (clang, -O0):
<libfoo2_LTX_hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xe110,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libfoo2_LTX_hello>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xe110,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"** This is foolib 2 **\0A\00"
define i32 @libfoo2_LTX_hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 57616
}

LLVM IR (-O2):
@str = [23 x i8] c"** This is foolib 2 **\00"
define i32 @libfoo2_LTX_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 57616
}
int docs_destroy_func(const struct cmd_info *ci) { return 1; }


x86 assembly (clang, -O0):
<docs_destroy_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<docs_destroy_func>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.cmd_info = type opaque
define i32 @docs_destroy_func(%struct.cmd_info* %0) {
%2 = alloca %struct.cmd_info*
store %struct.cmd_info* %0, %struct.cmd_info** %2
ret i32 1
}

LLVM IR (-O2):
%struct.cmd_info = type opaque
define i32 @docs_destroy_func(%struct.cmd_info* nocapture readnone %0) {
ret i32 1
}
void enable_fiq(int fiq) {}


x86 assembly (clang, -O0):
<enable_fiq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_fiq>:
ret

LLVM IR (-O0):
define void @enable_fiq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @enable_fiq(i32 %0) {
ret void
}
/* Variables and functions */
int parse_action(char *, int);
int parse_action_false(char *s) { return parse_action(s, 2); }


x86 assembly (clang, -O0):
<parse_action_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <parse_action@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_action_false>:
mov    $0x2,%esi
jmp    1030 <parse_action@plt>

LLVM IR (-O0):
define i32 @parse_action_false(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @parse_action(i8* %3, i32 2)
ret i32 %4
}

LLVM IR (-O2):
define i32 @parse_action_false(i8* %0) {
%2 = tail call i32 @parse_action(i8* %0, i32 2)
ret i32 %2
}
int __attribute__((no)) _gen_err(int val) { return val; }


x86 assembly (clang, -O0):
<_gen_err>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gen_err>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @_gen_err(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @_gen_err(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ random_buffer(void *, int);
unsigned int random_u_int() {
  unsigned int i;
  random_buffer((void *)&i, (int)sizeof(unsigned int));
  return i;
}


x86 assembly (clang, -O0):
<random_u_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <random_buffer@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_u_int>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <random_buffer@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_u_int() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @random_buffer(i8* %2, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @random_u_int() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @random_buffer(i8* %2, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int beginning, ending, duration;
  scanf("%d %d", &beginning, &ending);
  duration = ending - beginning;
  if (duration <= 0)
    duration += 24;
  printf("O JOGO DUROU %d HORA(S)\n", duration);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jg     115f <main+0x3f>
mov    -0x10(%rbp),%eax
add    $0x18,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%eax
sub    0x4(%rsp),%eax
lea    0x18(%rax),%esi
test   %eax,%eax
cmovg  %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [25 x i8] c"O JOGO DUROU %d HORA(S)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 24
store i32 %13, i32* %4
br label %14
14: ; preds = %11, %0
%15 = load i32, i32* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [25 x i8] c"O JOGO DUROU %d HORA(S)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = sub nsw i32 %6, %7
%9 = icmp slt i32 %8, 1
%10 = add nsw i32 %8, 24
%11 = select i1 %9, i32 %10, i32 %8
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int countAtoms(FILE *file) {
  char tline[240];
  int count;
  count = 0;
  while (NULL != fgets(tline, 240 - 1, file)) {
    count++;
  }
  fseek(file, 0, SEEK_SET);
  return (count);
}


x86 assembly (clang, -O0):
<countAtoms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x104(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0xef,%esi
call   1030 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1170 <countAtoms+0x50>
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    1139 <countAtoms+0x19>
mov    -0x8(%rbp),%rdi
mov    0x2e65(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x104(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countAtoms>:
push   %r15
push   %r14
push   %rbx
sub    $0xf0,%rsp
mov    %rdi,%r14
mov    $0xffffffff,%ebx
mov    %rsp,%r15
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0xef,%esi
mov    %r14,%rdx
call   1030 <fgets@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1140 <countAtoms+0x20>
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %ebx,%eax
add    $0xf0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @countAtoms(i32* %0) {
%2 = alloca i32*
%3 = alloca [240 x i8]
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %10, %1
%6 = getelementptr inbounds [240 x i8], [240 x i8]* %3, i64 0, i64 0
%7 = load i32*, i32** %2
%8 = call i32* @fgets(i8* %6, i32 239, i32* %7)
%9 = icmp ne i32* null, %8
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %5
13: ; preds = %5
%14 = load i32*, i32** %2
%15 = load i32, i32* @SEEK_SET
%16 = call i32 @fseek(i32* %14, i32 0, i32 %15)
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @countAtoms(i32* nocapture %0) {
%2 = alloca [240 x i8]
%3 = getelementptr inbounds [240 x i8], [240 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %8, %4 ]
%6 = call i32* @fgets(i8* %3, i32 239, i32* %0)
%7 = icmp eq i32* %6, null
%8 = add nuw nsw i32 %5, 1
br i1 %7, label %9, label %4
9: ; preds = %4
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %0, i32 0, i32 %10)
ret i32 %5
}
/* Variables and functions */
size_t cstrnlen(const char *str, size_t maxlen) {
  const char *cp;
  for (cp = str; maxlen != 0 && *cp != '\0'; cp++, maxlen--)
    ;
  return (size_t)(cp - str);
}


x86 assembly (clang, -O0):
<cstrnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
je     1134 <cstrnlen+0x34>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1144 <cstrnlen+0x44>
jmp    1166 <cstrnlen+0x66>
jmp    1149 <cstrnlen+0x49>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <cstrnlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstrnlen>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1122 <cstrnlen+0x22>
lea    (%rdi,%rsi,1),%rcx
mov    %rdi,%rax
nop
cmpb   $0x0,(%rax)
je     1122 <cstrnlen+0x22>
add    $0x1,%rax
add    $0xffffffffffffffff,%rsi
jne    1110 <cstrnlen+0x10>
mov    %rcx,%rax
sub    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @cstrnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %18, %2
%8 = load i64, i64* %4
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %10, %7
%16 = phi i1 [ false, %7 ], [ %14, %10 ]
br i1 %16, label %17, label %23
17: ; preds = %15
br label %18
18: ; preds = %17
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %5
%21 = load i64, i64* %4
%22 = add i64 %21, -1
store i64 %22, i64* %4
br label %7
23: ; preds = %15
%24 = load i8*, i8** %5
%25 = load i8*, i8** %3
%26 = ptrtoint i8* %24 to i64
%27 = ptrtoint i8* %25 to i64
%28 = sub i64 %26, %27
ret i64 %28
}

LLVM IR (-O2):
define i64 @cstrnlen(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr i8, i8* %0, i64 %1
br label %6
6: ; preds = %4, %11
%7 = phi i8* [ %12, %11 ], [ %0, %4 ]
%8 = phi i64 [ %13, %11 ], [ %1, %4 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = add i64 %8, -1
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %11, %2
%16 = phi i8* [ %0, %2 ], [ %5, %11 ], [ %7, %6 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void callback1(void) { printf("callback1 called\n"); }


x86 assembly (clang, -O0):
<callback1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback1>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"callback1 called\0A\00"
define void @callback1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"callback1 called\00"
define void @callback1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glClearColor(float, float, float, float);
void init(void) { glClearColor(0.5f, 0.5f, 0.5f, 0.0f); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
movss  0xee4(%rip),%xmm2
xorps  %xmm3,%xmm3
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <glClearColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
movss  0xee8(%rip),%xmm0
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
jmp    1030 <glClearColor@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 @glClearColor(float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 @glClearColor(float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 0.000000e+00)
ret void
}
/* Variables and functions */
void free_str(void *src) {
  if (src && (*(char **)(src))) {
    (*(char **)(src)) = NULL;
  }
}


x86 assembly (clang, -O0):
<free_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112c <free_str+0x2c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     112c <free_str+0x2c>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_str>:
test   %rdi,%rdi
je     1112 <free_str+0x12>
cmpq   $0x0,(%rdi)
je     1112 <free_str+0x12>
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @free_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i8**
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = bitcast i8* %11 to i8**
store i8* null, i8** %12
br label %13
13: ; preds = %10, %5, %1
ret void
}

LLVM IR (-O2):
define void @free_str(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %3
store i8* null, i8** %4
br label %8
8: ; preds = %7, %3, %1
ret void
}
void XCreatePixmap() {}


x86 assembly (clang, -O0):
<XCreatePixmap>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XCreatePixmap>:
ret

LLVM IR (-O0):
define void @XCreatePixmap() {
ret void
}

LLVM IR (-O2):
define void @XCreatePixmap() {
ret void
}
void closeBox(void *ui_interface) {}


x86 assembly (clang, -O0):
<closeBox>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeBox>:
ret

LLVM IR (-O0):
define void @closeBox(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @closeBox(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void err_check(int err) {
  char err_msg[100];
  sprintf(err_msg, "\nAn error occured, errno = %d:\n", err);
  if (errno != 0) {
    perror(err_msg);
    exit(1);
  }
  return;
}


x86 assembly (clang, -O0):
<err_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
mov    0x2e8b(%rip),%rax
cmpq   $0x0,(%rax)
je     1172 <err_check+0x42>
lea    -0x70(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_check>:
sub    $0x68,%rsp
mov    %edi,%edx
lea    0xec3(%rip),%rsi
mov    %rsp,%rdi
call   1040 <sprintf@plt>
mov    0x2e94(%rip),%rax
cmpq   $0x0,(%rax)
jne    1157 <err_check+0x27>
add    $0x68,%rsp
ret
mov    %rsp,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"\0AAn error occured, errno = %d:\0A\00"
@errno = global i64 0
define void @err_check(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i64, i64* @errno
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = call i32 @perror(i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0AAn error occured, errno = %d:\0A\00"
@errno = global i64 0
define void @err_check(i32 %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i64, i64* @errno
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = call i32 @perror(i8* %3)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ example_get_all_headers();
int /*<<< orphan*/ example_get_next_header();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Example of get_all_headers():\n");
  printf("=============================\n");
  example_get_all_headers();
  printf("\n\nExample of get_next_header():\n");
  printf("=============================\n");
  example_get_next_header();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <example_get_all_headers@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <example_get_next_header@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <example_get_all_headers@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <example_get_next_header@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Example of get_all_headers():\0A\00"
@.str.1 = [31 x i8] c"=============================\0A\00"
@.str.2 = [33 x i8] c"\0A\0AExample of get_next_header():\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @example_get_all_headers()
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @example_get_next_header()
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"Example of get_all_headers():\00"
@str.4 = [32 x i8] c"\0A\0AExample of get_next_header():\00"
@str.5 = [30 x i8] c"=============================\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 (...) @example_get_all_headers()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.5, i64 0, i64 0))
%6 = tail call i32 (...) @example_get_next_header()
ret i32 0
}
void gtk_settings_get_type() {}


x86 assembly (clang, -O0):
<gtk_settings_get_type>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_settings_get_type>:
ret

LLVM IR (-O0):
define void @gtk_settings_get_type() {
ret void
}

LLVM IR (-O2):
define void @gtk_settings_get_type() {
ret void
}
double sin(double x) { return 4; }


x86 assembly (clang, -O0):
<sin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sin(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @sin(double %0) {
ret double 4.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void get_flag() { puts("BOOM"); }


x86 assembly (clang, -O0):
<get_flag>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_flag>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"BOOM\00"
define void @get_flag() {
%1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"BOOM\00"
define void @get_flag() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct Message {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ revive(struct Message *);
void cmd_revive(int pindex __attribute__((unused)), struct Message *msg) {
  revive(msg);
}


x86 assembly (clang, -O0):
<cmd_revive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <revive@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_revive>:
mov    %rsi,%rdi
jmp    1030 <revive@plt>

LLVM IR (-O0):
%struct.Message = type { i32 }
define void @cmd_revive(i32 %0, %struct.Message* %1) {
%3 = alloca i32
%4 = alloca %struct.Message*
store i32 %0, i32* %3
store %struct.Message* %1, %struct.Message** %4
%5 = load %struct.Message*, %struct.Message** %4
%6 = call i32 @revive(%struct.Message* %5)
ret void
}

LLVM IR (-O2):
%struct.Message = type { i32 }
define void @cmd_revive(i32 %0, %struct.Message* %1) {
%3 = tail call i32 @revive(%struct.Message* %1)
ret void
}
adrx0indreg1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((((unsigned short *)10000000)[x0]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movzwl (%rax,%rcx,2),%eax
mov    -0x20(%rbp),%rcx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jg     1147 <adrx0indreg1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <adrx0indreg1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0indreg1>:
movslq %edx,%rax
movzwl 0x989680(%rax,%rax,1),%ecx
xor    %eax,%eax
cmp    (%r9),%cx
setbe  %al
ret

LLVM IR (-O0):
define i32 @adrx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = zext i16 %19 to i32
%21 = load i16*, i16** %13
%22 = load i16, i16* %21
%23 = zext i16 %22 to i32
%24 = icmp sle i32 %20, %23
br i1 %24, label %25, label %26
25: ; preds = %6
store i32 1, i32* %7
br label %27
26: ; preds = %6
store i32 0, i32* %7
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @adrx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = load i16, i16* %5
%11 = icmp ule i16 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ prologue(char *);
void mouse_basedefs(void) { prologue("mouse"); }


x86 assembly (clang, -O0):
<mouse_basedefs>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <prologue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mouse_basedefs>:
lea    0xee9(%rip),%rdi
jmp    1030 <prologue@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"mouse\00"
define void @mouse_basedefs() {
%1 = call i32 @prologue(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"mouse\00"
define void @mouse_basedefs() {
%1 = tail call i32 @prologue(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void ExttMySQLUserAuxTable(void) {}


x86 assembly (clang, -O0):
<ExttMySQLUserAuxTable>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExttMySQLUserAuxTable>:
ret

LLVM IR (-O0):
define void @ExttMySQLUserAuxTable() {
ret void
}

LLVM IR (-O2):
define void @ExttMySQLUserAuxTable() {
ret void
}
int parent(int i) { return (i - 1) >> 1; }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
lea    -0x1(%rdi),%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = ashr i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int /*<<< orphan*/);
void TOSH_MAKE_UART_RXD0_OUTPUT() { set_io_bit(0x72, 0); }


x86 assembly (clang, -O0):
<TOSH_MAKE_UART_RXD0_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x72,%edi
xor    %esi,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_UART_RXD0_OUTPUT>:
mov    $0x72,%edi
xor    %esi,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_UART_RXD0_OUTPUT() {
%1 = call i32 @set_io_bit(i32 114, i32 0)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_UART_RXD0_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 114, i32 0)
ret void
}
int StringComparisonOutputDouble(double first, double second,
                                 int isSmallerOrGreater) {
  if (first == second)
    return 2;
  int output = 0;
  if (isSmallerOrGreater == 0) {
    output = (first < second ? 1 : 0);
  } else
    output = (first > second ? 1 : 0);
  return output;
}


x86 assembly (clang, -O0):
<StringComparisonOutputDouble>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1133 <StringComparisonOutputDouble+0x33>
jp     1133 <StringComparisonOutputDouble+0x33>
movl   $0x2,-0x4(%rbp)
jmp    1185 <StringComparisonOutputDouble+0x85>
movl   $0x0,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1164 <StringComparisonOutputDouble+0x64>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x20(%rbp)
jmp    117f <StringComparisonOutputDouble+0x7f>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringComparisonOutputDouble>:
mov    $0x2,%eax
ucomisd %xmm1,%xmm0
jne    110e <StringComparisonOutputDouble+0xe>
jp     110e <StringComparisonOutputDouble+0xe>
ret
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
test   %edi,%edi
cmove  %eax,%ecx
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @StringComparisonOutputDouble(double %0, double %1, i32 %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double %0, double* %5
store double %1, double* %6
store i32 %2, i32* %7
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fcmp oeq double %9, %10
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 2, i32* %4
br label %30
13: ; preds = %3
store i32 0, i32* %8
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = load double, double* %5
%18 = load double, double* %6
%19 = fcmp olt double %17, %18
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 1, i32 0
store i32 %21, i32* %8
br label %28
22: ; preds = %13
%23 = load double, double* %5
%24 = load double, double* %6
%25 = fcmp ogt double %23, %24
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 1, i32 0
store i32 %27, i32* %8
br label %28
28: ; preds = %22, %16
%29 = load i32, i32* %8
store i32 %29, i32* %4
br label %30
30: ; preds = %28, %12
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
define i32 @StringComparisonOutputDouble(double %0, double %1, i32 %2) {
%4 = fcmp oeq double %0, %1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = icmp eq i32 %2, 0
%7 = fcmp olt double %0, %1
%8 = fcmp ogt double %0, %1
%9 = select i1 %6, i1 %7, i1 %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %3, %5
%12 = phi i32 [ %10, %5 ], [ 2, %3 ]
ret i32 %12
}