xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ get_p(char);
int f(char p1, char p2) {
  if (p1 == '^') {
    return get_p(p1) >= get_p(p2);
  } else {
    return get_p(p1) > get_p(p2);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5e,%eax
jne    1161 <f+0x51>
movsbl -0x5(%rbp),%edi
call   1030 <get_p@plt>
mov    %rax,-0x10(%rbp)
movsbl -0x6(%rbp),%edi
call   1030 <get_p@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    118c <f+0x7c>
movsbl -0x5(%rbp),%edi
call   1030 <get_p@plt>
mov    %rax,-0x18(%rbp)
movsbl -0x6(%rbp),%edi
call   1030 <get_p@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
cmp    $0x5e,%dil
jne    1139 <f+0x29>
mov    $0x5e,%edi
call   1030 <get_p@plt>
mov    %rax,%r14
movsbl %bl,%edi
call   1030 <get_p@plt>
cmp    %rax,%r14
setge  %al
jmp    1153 <f+0x43>
movsbl %dil,%edi
call   1030 <get_p@plt>
mov    %rax,%r14
movsbl %bl,%edi
call   1030 <get_p@plt>
cmp    %rax,%r14
setg   %al
movzbl %al,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @f(i8 signext %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 94
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = load i8, i8* %4
%11 = call i64 @get_p(i8 signext %10)
%12 = load i8, i8* %5
%13 = call i64 @get_p(i8 signext %12)
%14 = icmp sge i64 %11, %13
%15 = zext i1 %14 to i32
store i32 %15, i32* %3
br label %23
16: ; preds = %2
%17 = load i8, i8* %4
%18 = call i64 @get_p(i8 signext %17)
%19 = load i8, i8* %5
%20 = call i64 @get_p(i8 signext %19)
%21 = icmp sgt i64 %18, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %16, %9
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @f(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 94
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i64 @get_p(i8 signext 94)
%6 = tail call i64 @get_p(i8 signext %1)
%7 = icmp sge i64 %5, %6
br label %12
8: ; preds = %2
%9 = tail call i64 @get_p(i8 signext %0)
%10 = tail call i64 @get_p(i8 signext %1)
%11 = icmp sgt i64 %9, %10
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ %7, %4 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_ins_nwstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_ins_nwstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_ins_nwstr+0x2a>
jmp    1170 <cmd_ins_nwstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_ins_nwstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_ins_nwstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_ins_nwstr(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_ins_nwstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int close(int);
int smp_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<smp_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @smp_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
int mainB() {
  while (1) {
    sleep(5);
    system("./Homecontrol.a");
  }
}


x86 assembly (clang, -O0):
<mainB>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <mainB+0x9>
mov    $0x5,%edi
call   1040 <sleep@plt>
lea    0xec6(%rip),%rdi
call   1030 <system@plt>
jmp    1129 <mainB+0x9>

x86 assembly (clang, -O2):
<mainB>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
jmp    1130 <mainB+0x10>

LLVM IR (-O0):
@.str = [16 x i8] c"./Homecontrol.a\00"
define i32 @mainB() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @sleep(i32 5)
%3 = call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %1
}

LLVM IR (-O2):
@.str = [16 x i8] c"./Homecontrol.a\00"
define i32 @mainB() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 5)
%3 = tail call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %1
}
const char *bool_str(int bool_val) {
  if (bool_val)
    return "true";
  return "false";
}


x86 assembly (clang, -O0):
<bool_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <bool_str+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <bool_str+0x2c>
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool_str>:
test   %edi,%edi
lea    0xefc(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @bool_str(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_reset_personality() {
  printf("NOT IMPLEMENTED:"
         "pa_reset_personality"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"NOT IMPLEMENTED:pa_reset_personality\0A\00"
define i32 @pa_reset_personality() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_reset_personality\00"
define i32 @pa_reset_personality() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void somethingInFile2() { printf("Doing something in file2...\n"); }


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

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

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

LLVM IR (-O2):
@str = [28 x i8] c"Doing something in file2...\00"
define void @somethingInFile2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
void flushstdout(int sig) {}


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

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

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

LLVM IR (-O2):
define void @flushstdout(i32 %0) {
ret void
}
int test_imm_6Fuint16_mem(unsigned short *val) {
  return ((*val) & (-0x6F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Fuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff91,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Fuint16_mem>:
movzwl (%rdi),%eax
test   $0xff91,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Fuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -111
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_6Fuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -111
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void function3(int a) {
  printf("You entered %d so function3 was called.\n\n", a);
}


x86 assembly (clang, -O0):
<function3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function3>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"You entered %d so function3 was called.\0A\0A\00"
define void @function3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"You entered %d so function3 was called.\0A\0A\00"
define void @function3(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(unsigned int);
void ft_putnbr_x(unsigned int n) {
  if (n > 15)
    ft_putnbr_x(n / 16);
  if ((n % 16) + 48 > '9')
    ft_putchar((n % 16) + 87);
  else
    ft_putchar((n % 16) + 48);
}


x86 assembly (clang, -O0):
<ft_putnbr_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xf,-0x4(%rbp)
jbe    1140 <ft_putnbr_x+0x20>
mov    -0x4(%rbp),%edi
shr    $0x4,%edi
call   1040 <ft_putnbr_x@plt>
mov    -0x4(%rbp),%eax
and    $0xf,%eax
add    $0x30,%eax
cmp    $0x39,%eax
jbe    1165 <ft_putnbr_x+0x45>
mov    -0x4(%rbp),%edi
and    $0xf,%edi
add    $0x57,%edi
call   1030 <ft_putchar@plt>
jmp    1173 <ft_putnbr_x+0x53>
mov    -0x4(%rbp),%edi
and    $0xf,%edi
add    $0x30,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_x>:
push   %rbx
mov    %edi,%ebx
cmp    $0x10,%edi
jb     1132 <ft_putnbr_x+0x12>
mov    %ebx,%edi
shr    $0x4,%edi
call   1040 <ft_putnbr_x@plt>
and    $0xf,%ebx
lea    0x30(%rbx),%eax
add    $0x57,%ebx
cmp    $0x3a,%eax
cmovb  %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_putnbr_x(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 15
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = udiv i32 %6, 16
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = urem i32 %9, 16
%11 = add i32 %10, 48
%12 = icmp ugt i32 %11, 57
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i32, i32* %2
%15 = urem i32 %14, 16
%16 = add i32 %15, 87
%17 = call i32 @ft_putchar(i32 %16)
br label %23
18: ; preds = %8
%19 = load i32, i32* %2
%20 = urem i32 %19, 16
%21 = add i32 %20, 48
%22 = call i32 @ft_putchar(i32 %21)
br label %23
23: ; preds = %18, %13
ret void
}

LLVM IR (-O2):
define void @ft_putnbr_x(i32 %0) {
%2 = icmp ugt i32 %0, 15
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i32 %0, 4
tail call void @ft_putnbr_x(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = and i32 %0, 15
%7 = or i32 %6, 48
%8 = icmp ugt i32 %7, 57
%9 = add nuw nsw i32 %6, 87
%10 = select i1 %8, i32 %9, i32 %7
%11 = tail call i32 @ft_putchar(i32 %10)
ret void
}
double ap_tick(double *state, double in, double apcoeff) {
  double out = *state;
  in += apcoeff * out;
  out -= apcoeff * in;
  *state = in;
  return out;
}


x86 assembly (clang, -O0):
<ap_tick>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_tick>:
movsd  (%rdi),%xmm2
movapd %xmm1,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm3,%xmm1
subsd  %xmm1,%xmm2
movsd  %xmm3,(%rdi)
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @ap_tick(double* %0, double %1, double %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double* %0, double** %4
store double %1, double* %5
store double %2, double* %6
%8 = load double*, double** %4
%9 = load double, double* %8
store double %9, double* %7
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %5
%13 = call double @llvm.fmuladd.f64(double %10, double %11, double %12)
store double %13, double* %5
%14 = load double, double* %6
%15 = load double, double* %5
%16 = load double, double* %7
%17 = fneg double %14
%18 = call double @llvm.fmuladd.f64(double %17, double %15, double %16)
store double %18, double* %7
%19 = load double, double* %5
%20 = load double*, double** %4
store double %19, double* %20
%21 = load double, double* %7
ret double %21
}

LLVM IR (-O2):
define double @ap_tick(double* nocapture %0, double %1, double %2) {
%4 = load double, double* %0
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double %1)
%6 = fneg double %2
%7 = tail call double @llvm.fmuladd.f64(double %6, double %5, double %4)
store double %5, double* %0
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  struct {
    long status;
  } h;
  h.status = 0;
  if (((h.status & 128) == 1) && ((h.status & 32) == 0))
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x80,%rax
cmp    $0x1,%rax
jne    1164 <main+0x44>
mov    -0x10(%rbp),%rax
and    $0x20,%rax
cmp    $0x0,%rax
jne    1164 <main+0x44>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
%struct.anon = type { i64 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%5 = load i64, i64* %4
%6 = and i64 %5, 128
%7 = icmp eq i64 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %0
%9 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%10 = load i64, i64* %9
%11 = and i64 %10, 32
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %8, %0
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
void X509_NAME_ENTRY_create_by_NID(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_ENTRY_create_by_NID() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() { system("sudo shutdown now"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"sudo shutdown now\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"sudo shutdown now\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ts_get_cc(const uint8_t *p_ts) { return p_ts[3] & 0xf; }


x86 assembly (clang, -O0):
<ts_get_cc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_get_cc>:
mov    0xc(%rdi),%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @ts_get_cc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, 15
ret i32 %6
}

LLVM IR (-O2):
define i32 @ts_get_cc(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = and i32 %3, 15
ret i32 %4
}
void fn_4(double *a, double *b, double *c) {
  int i = 0;
  while (i < 10)
    a[i] = b[i] * c[i];
  i++;
}


x86 assembly (clang, -O0):
<fn_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    114d <fn_4+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1117 <fn_4+0x17>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_4>:
movsd  (%rsi),%xmm0
mulsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
jmp    1100 <fn_4>

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

LLVM IR (-O2):
define void @fn_4(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
br label %4
4: ; preds = %4, %3
%5 = load double, double* %1
%6 = load double, double* %2
%7 = fmul double %5, %6
store double %7, double* %0
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ MoveMousePos252(long, long);
void movemousepos(long x, long y) { MoveMousePos252(x, y); }


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

x86 assembly (clang, -O2):
<movemousepos>:
jmp    1030 <MoveMousePos252@plt>

LLVM IR (-O0):
define void @movemousepos(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @MoveMousePos252(i64 %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @movemousepos(i64 %0, i64 %1) {
%3 = tail call i32 @MoveMousePos252(i64 %0, i64 %1)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
char *kaa_tcp_write_pending_services_allocator_fn(void *context,
                                                  size_t buffer_size) {
  {
    if (!(context) || !(buffer_size))
      return NULL;
  };
  char *buffer = (char *)malloc(buffer_size);
  return buffer;
}


x86 assembly (clang, -O0):
<kaa_tcp_write_pending_services_allocator_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <kaa_tcp_write_pending_services_allocator_fn+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1143 <kaa_tcp_write_pending_services_allocator_fn+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1158 <kaa_tcp_write_pending_services_allocator_fn+0x48>
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kaa_tcp_write_pending_services_allocator_fn>:
xor    %eax,%eax
test   %rdi,%rdi
je     1129 <kaa_tcp_write_pending_services_allocator_fn+0x19>
test   %rsi,%rsi
je     1129 <kaa_tcp_write_pending_services_allocator_fn+0x19>
push   %rax
mov    %rsi,%rdi
call   1030 <malloc@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i8* @kaa_tcp_write_pending_services_allocator_fn(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i64, i64* %5
%11 = icmp ne i64 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %9, %2
store i8* null, i8** %3
br label %18
13: ; preds = %9
%14 = load i64, i64* %5
%15 = call i64 @malloc(i64 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %6
%17 = load i8*, i8** %6
store i8* %17, i8** %3
br label %18
18: ; preds = %13, %12
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @kaa_tcp_write_pending_services_allocator_fn(i8* readnone %0, i64 %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i64 @malloc(i64 %1)
%8 = inttoptr i64 %7 to i8*
br label %9
9: ; preds = %2, %6
%10 = phi i8* [ %8, %6 ], [ null, %2 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ save_events(char *);
int /*<<< orphan*/ save_map(char *);
int /*<<< orphan*/ save_players();
void persistent_save() {
  save_players();
  save_map("map.bin");
  save_events("events.bin");
}


x86 assembly (clang, -O0):
<persistent_save>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <save_players@plt>
lea    0xebe(%rip),%rdi
call   1050 <save_map@plt>
lea    0xeba(%rip),%rdi
call   1040 <save_events@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<persistent_save>:
push   %rax
xor    %eax,%eax
call   1030 <save_players@plt>
lea    0xec1(%rip),%rdi
call   1050 <save_map@plt>
lea    0xebd(%rip),%rdi
pop    %rax
jmp    1040 <save_events@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"map.bin\00"
@.str.1 = [11 x i8] c"events.bin\00"
define void @persistent_save() {
%1 = call i32 (...) @save_players()
%2 = call i32 @save_map(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @save_events(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"map.bin\00"
@.str.1 = [11 x i8] c"events.bin\00"
define void @persistent_save() {
%1 = tail call i32 (...) @save_players()
%2 = tail call i32 @save_map(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @save_events(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ println(char *);
int terminal_id();
int testing(const char *name, int row) {
  printf("Testing %s. ", name);
  printf("A real VT%d will not recognize %s at this point", terminal_id(),
         name);
  println("");
  return row + 1;
}


x86 assembly (clang, -O0):
<testing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <terminal_id@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
call   1040 <println@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testing>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xec0(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <terminal_id@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
call   1040 <println@plt>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Testing %s. \00"
@.str.1 = [48 x i8] c"A real VT%d will not recognize %s at this point\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @testing(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (...) @terminal_id()
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 %7, i8* %8)
%10 = call i32 @println(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
ret i32 %12
}

LLVM IR (-O2):
@.str = [13 x i8] c"Testing %s. \00"
@.str.1 = [48 x i8] c"A real VT%d will not recognize %s at this point\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @testing(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @terminal_id()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 %4, i8* %0)
%6 = tail call i32 @println(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%7 = add nsw i32 %1, 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int answer, result;
  answer = 100;
  result = answer - 10;
  printf("The result is %i.\n", result + 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
add    $0x5,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"The result is %i.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 10
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 5
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"The result is %i.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 95)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t diminuto_absolute_int32_t_f(int32_t value) {
  return (value < 0) ? -value : value;
}


x86 assembly (clang, -O0):
<diminuto_absolute_int32_t_f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <diminuto_absolute_int32_t_f+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <diminuto_absolute_int32_t_f+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @diminuto_absolute_int32_t_f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @diminuto_absolute_int32_t_f(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M26_f(char *s) {
  debug("M26_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M26_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M26_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M26_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M26_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M26_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M26_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
void HandleKey(int keycode, int bDown) {
  if (keycode == 65307)
    exit(0);
  printf("Key: %d -> %d\n", keycode, bDown);
}


x86 assembly (clang, -O0):
<HandleKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xff1b,-0x4(%rbp)
jne    1142 <HandleKey+0x22>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleKey>:
cmp    $0xff1b,%edi
je     1138 <HandleKey+0x18>
mov    %esi,%edx
mov    %edi,%esi
lea    0xecd(%rip),%rdi
jmp    1030 <printf@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Key: %d -> %d\0A\00"
define void @HandleKey(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 65307
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Key: %d -> %d\0A\00"
define void @HandleKey(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 65307
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
void wv_ugstr(s) char *s;
{
  while (*s != '\0')
    wv_ugch(*s++);
}


x86 assembly (clang, -O0):
<wv_ugstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114a <wv_ugstr+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <wv_ugch@plt>
jmp    111c <wv_ugstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wv_ugstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <wv_ugstr+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <wv_ugch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <wv_ugstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @wv_ugstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @wv_ugch to i32 (i32, ...)*)(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *gets(char *);
quest() {
  char *s;
  char answer[100];
  s = answer;
  if (gets(s) != NULL) {
    if (answer[0] == 'y')
      return (1);
    else
      return (2);
  }
  return (3);
}


x86 assembly (clang, -O0):
<quest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <gets@plt>
cmp    $0x0,%rax
je     115b <quest+0x4b>
movsbl -0x80(%rbp),%eax
cmp    $0x79,%eax
jne    114f <quest+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1162 <quest+0x52>
movl   $0x2,-0x4(%rbp)
jmp    1162 <quest+0x52>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quest>:
sub    $0x68,%rsp
mov    %rsp,%rdi
call   1030 <gets@plt>
xor    %ecx,%ecx
cmpb   $0x79,(%rsp)
sete   %cl
mov    $0x2,%edx
sub    %ecx,%edx
test   %rax,%rax
mov    $0x3,%eax
cmovne %edx,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @quest() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @gets(i8* %5)
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %15
8: ; preds = %0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 121
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %1
br label %16
14: ; preds = %8
store i32 2, i32* %1
br label %16
15: ; preds = %0
store i32 3, i32* %1
br label %16
16: ; preds = %15, %14, %13
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @quest() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32* @gets(i8* %2)
%4 = icmp eq i32* %3, null
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 121
%7 = select i1 %6, i32 1, i32 2
%8 = select i1 %4, i32 3, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
unsigned int getle(FILE *f) {
  unsigned int res;
  res = fgetc(f);
  res |= fgetc(f) << 8;
  res |= fgetc(f) << 16;
  res |= fgetc(f) << 24;
  return res;
}


x86 assembly (clang, -O0):
<getle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getle>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <fgetc@plt>
mov    %eax,%r14d
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
or     %r14d,%ebp
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
mov    %r15,%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getle(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = call i32 @fgetc(i32* %6)
%8 = shl i32 %7, 8
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32*, i32** %2
%12 = call i32 @fgetc(i32* %11)
%13 = shl i32 %12, 16
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32*, i32** %2
%17 = call i32 @fgetc(i32* %16)
%18 = shl i32 %17, 24
%19 = load i32, i32* %3
%20 = or i32 %19, %18
store i32 %20, i32* %3
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @getle(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
%6 = tail call i32 @fgetc(i32* %0)
%7 = shl i32 %6, 16
%8 = or i32 %5, %7
%9 = tail call i32 @fgetc(i32* %0)
%10 = shl i32 %9, 24
%11 = or i32 %8, %10
ret i32 %11
}
void Map0_VSync() {}


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

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

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

LLVM IR (-O2):
define void @Map0_VSync() {
ret void
}
void skip_comment(const char **document) {
  while (**document != '\n' && **document != '\0')
    (*document)++;
  if (**document == '\n')
    (*document)++;
}


x86 assembly (clang, -O0):
<skip_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     1133 <skip_comment+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1143 <skip_comment+0x43>
jmp    1156 <skip_comment+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <skip_comment+0x8>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1177 <skip_comment+0x77>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_comment>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
test   %cl,%cl
je     1129 <skip_comment+0x29>
cmp    $0xa,%cl
je     1126 <skip_comment+0x26>
mov    %rax,(%rdi)
jmp    1110 <skip_comment+0x10>
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @skip_comment(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 10, label %8
i8 0, label %10
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %9, i8** %0
br label %10
10: ; preds = %3, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void merge_sort(int *arr, int left, int right) {
  if (left < right) {
    int mid = (left + right) / 2;
    merge_sort(arr, left, mid);
    merge_sort(arr, mid + 1, right);
    merge(arr, left, mid, right);
  }
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <merge_sort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
cmp    %edx,%esi
jge    1172 <merge_sort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <merge_sort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <merge_sort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

LLVM IR (-O0):
define void @merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @merge(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @merge_sort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @merge_sort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int sigismember(int /*<<< orphan*/ *, int);
int main(void) {
  sigset_t set;
  int status;
  status = sigismember(&set, 21);
  return status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x15,%esi
call   1030 <sigismember@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @sigismember(i32* %2, i32 21)
store i32 %4, i32* %3
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigismember(i32* %1, i32 21)
ret i32 %3
}