xunge/DecIR huggingface dataset:
update_nice(str) char *str;
{
  if (atoi(str) < 1) {
    report_error("mpsh-nice should be an integer greater than 0", str, 0, 0);
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<update_nice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <atoi@plt>
cmp    $0x1,%eax
jge    1162 <update_nice+0x42>
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <report_error@plt>
movl   $0x0,-0x4(%rbp)
jmp    1169 <update_nice+0x49>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_nice>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jle    1138 <update_nice+0x18>
pop    %rbx
ret
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <report_error@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"mpsh-nice should be an integer greater than 0\00"
define i32 @update_nice(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %4)
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 (i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @report_error to i32 (i8*, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %8, i32 0, i32 0)
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [46 x i8] c"mpsh-nice should be an integer greater than 0\00"
define i32 @update_nice(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @report_error to i32 (i8*, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0, i32 0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x83() {
  Assert_real((ispunct(131) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              660, ("ispunct should be 0 for 0x83"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x83>:
push   %rbp
mov    %rsp,%rbp
mov    $0x83,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x294,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x83>:
push   %rax
mov    $0x83,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x294,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x83\00"
define void @t_ispunct_0x83() {
%1 = call i64 @ispunct(i32 131)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 660, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x83\00"
define void @t_ispunct_0x83() {
%1 = tail call i64 @ispunct(i32 131)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 660, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double get_om2(const double *x) { return 0.0; }


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

x86 assembly (clang, -O2):
<get_om2>:
xorps  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @get_om2(double* nocapture readnone %0) {
ret double 0.000000e+00
}
void troca_err(int x, int y) {
  int tmp;
  tmp = x;
  x = y;
  y = tmp;
}


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

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

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

LLVM IR (-O2):
define void @troca_err(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int BOB_MCBOB();
int main(void) { return BOB_MCBOB(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <BOB_MCBOB@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <BOB_MCBOB@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @BOB_MCBOB()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @BOB_MCBOB()
ret i32 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t select_uint32_t() { return 0 | (2 << 1); }


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

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

LLVM IR (-O0):
define i32 @select_uint32_t() {
ret i32 4
}

LLVM IR (-O2):
define i32 @select_uint32_t() {
ret i32 4
}
int putchar(int value) {
  while (((*(volatile unsigned int *)(0x20000020)) & 0x02) == 0)
    ;
  *(volatile unsigned int *)(0x20000000) = (value);
  return 0;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x20000020,%eax
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    111f <putchar+0x1f>
jmp    1107 <putchar+0x7>
mov    -0x4(%rbp),%ecx
mov    $0x20000000,%eax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
testl  $0x2,0x20000020
je     1100 <putchar>
mov    %edi,0x20000000
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i32, i32* inttoptr (i64 536870944 to i32*)
%5 = and i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i32, i32* %2
store volatile i32 %9, i32* inttoptr (i64 536870912 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 536870944 to i32*)
%4 = and i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i32 %0, i32* inttoptr (i64 536870912 to i32*)
ret i32 0
}
int mp_min0(int a, int b) {
  if (a <= b)
    return (a);
  else
    return (b);
}


x86 assembly (clang, -O0):
<mp_min0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <mp_min0+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <mp_min0+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_min0>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @mp_min0(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @mp_min0(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int main(void) {
  int array[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int sum = 0;
  int i = 0;
  while (i < 10) {
    sum = sum + array[i];
    ++i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xed6(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0xa,-0x38(%rbp)
jge    1168 <main+0x58>
mov    -0x34(%rbp),%eax
movslq -0x38(%rbp),%rcx
add    -0x30(%rbp,%rcx,4),%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1142 <main+0x32>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.array = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %2 to i8*
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = add nsw i32 %10, %14
store i32 %15, i32* %3
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %6
18: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
float s_get_float_1();
float get_float_1(void) { return s_get_float_1(); }


x86 assembly (clang, -O0):
<get_float_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <s_get_float_1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_float_1>:
xor    %eax,%eax
jmp    1030 <s_get_float_1@plt>

LLVM IR (-O0):
define float @get_float_1() {
%1 = call float (...) @s_get_float_1()
ret float %1
}

LLVM IR (-O2):
define float @get_float_1() {
%1 = tail call float (...) @s_get_float_1()
ret float %1
}
long smileMath_roundToNextPowOf2(long x) {
  unsigned long int flng = (unsigned long int)x;
  unsigned long int fmask = 0x8000;
  while ((fmask & flng) == 0) {
    fmask = fmask >> 1;
  }
  if (fmask > 1) {
    if ((fmask >> 1) & flng) {
      flng = fmask << 1;
    } else {
      flng = fmask;
    }
  } else {
    flng = 2;
  }
  return (long)flng;
}


x86 assembly (clang, -O0):
<smileMath_roundToNextPowOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x8000,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
jne    113b <smileMath_roundToNextPowOf2+0x3b>
mov    -0x18(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <smileMath_roundToNextPowOf2+0x18>
cmpq   $0x1,-0x18(%rbp)
jbe    117a <smileMath_roundToNextPowOf2+0x7a>
mov    -0x18(%rbp),%rax
shr    $0x1,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     116d <smileMath_roundToNextPowOf2+0x6d>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1175 <smileMath_roundToNextPowOf2+0x75>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1182 <smileMath_roundToNextPowOf2+0x82>
movq   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smileMath_roundToNextPowOf2>:
mov    $0x8000,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
shr    %rcx
test   %rdi,%rax
je     1110 <smileMath_roundToNextPowOf2+0x10>
test   %rdi,%rcx
setne  %cl
mov    %rax,%rdx
shl    %cl,%rdx
cmp    $0x2,%rax
mov    $0x2,%eax
cmovae %rdx,%rax
ret

LLVM IR (-O0):
define i64 @smileMath_roundToNextPowOf2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
store i64 %5, i64* %3
store i64 32768, i64* %4
br label %6
6: ; preds = %11, %1
%7 = load i64, i64* %4
%8 = load i64, i64* %3
%9 = and i64 %7, %8
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i64, i64* %4
%13 = lshr i64 %12, 1
store i64 %13, i64* %4
br label %6
14: ; preds = %6
%15 = load i64, i64* %4
%16 = icmp ugt i64 %15, 1
br i1 %16, label %17, label %29
17: ; preds = %14
%18 = load i64, i64* %4
%19 = lshr i64 %18, 1
%20 = load i64, i64* %3
%21 = and i64 %19, %20
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = load i64, i64* %4
%25 = shl i64 %24, 1
store i64 %25, i64* %3
br label %28
26: ; preds = %17
%27 = load i64, i64* %4
store i64 %27, i64* %3
br label %28
28: ; preds = %26, %23
br label %30
29: ; preds = %14
store i64 2, i64* %3
br label %30
30: ; preds = %29, %28
%31 = load i64, i64* %3
ret i64 %31
}

LLVM IR (-O2):
define i64 @smileMath_roundToNextPowOf2(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 32768, %1 ], [ %6, %2 ]
%4 = and i64 %3, %0
%5 = icmp eq i64 %4, 0
%6 = lshr i64 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = and i64 %6, %0
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i64
%11 = shl nuw nsw i64 %3, %10
%12 = icmp ult i64 %3, 2
%13 = select i1 %12, i64 2, i64 %11
ret i64 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int _default_storage_dump_fragment(unsigned long int from, unsigned long int to,
                                   unsigned long int skip_lines,
                                   unsigned long int max_lines, FILE *out) {
  return 0;
}


x86 assembly (clang, -O0):
<_default_storage_dump_fragment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_default_storage_dump_fragment(i64 %0, i64 %1, i64 %2, i64 %3, i32* %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32*
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i32* %4, i32** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @_default_storage_dump_fragment(i64 %0, i64 %1, i64 %2, i64 %3, i32* nocapture readnone %4) {
ret i32 0
}
int assign() {
  int a = 3;
  int b = 4;
  a = b;
  return 0;
}


x86 assembly (clang, -O0):
<assign>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @assign() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int ssse3() {
  printf("SSSE3 is not supported.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"SSSE3 is not supported.\00"
define i32 @ssse3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"SSSE3 is not supported.\00"
define i32 @ssse3() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void bail_out() { exit(1); }


x86 assembly (clang, -O0):
<bail_out>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<bail_out>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @bail_out() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @bail_out() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LCD_WriteCommand(int);
void LCD_Cursor(unsigned char column) {
  if (column < 17) {
    LCD_WriteCommand(0x80 + column - 1);
  } else {
    LCD_WriteCommand(0xB8 + column - 9);
  }
}


x86 assembly (clang, -O0):
<LCD_Cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x11,%eax
jge    1142 <LCD_Cursor+0x32>
movzbl -0x1(%rbp),%edi
add    $0x80,%edi
sub    $0x1,%edi
call   1030 <LCD_WriteCommand@plt>
jmp    1154 <LCD_Cursor+0x44>
movzbl -0x1(%rbp),%edi
add    $0xb8,%edi
sub    $0x9,%edi
call   1030 <LCD_WriteCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_Cursor>:
lea    0xaf(%rdi),%ecx
mov    %edi,%eax
add    $0x7f,%eax
cmp    $0x11,%dil
cmovae %ecx,%eax
mov    %eax,%edi
jmp    1030 <LCD_WriteCommand@plt>

LLVM IR (-O0):
define void @LCD_Cursor(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp slt i32 %4, 17
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = add nsw i32 128, %8
%10 = sub nsw i32 %9, 1
%11 = call i32 @LCD_WriteCommand(i32 %10)
br label %18
12: ; preds = %1
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = add nsw i32 184, %14
%16 = sub nsw i32 %15, 9
%17 = call i32 @LCD_WriteCommand(i32 %16)
br label %18
18: ; preds = %12, %6
ret void
}

LLVM IR (-O2):
define void @LCD_Cursor(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = icmp ult i8 %0, 17
%4 = select i1 %3, i32 127, i32 175
%5 = add nuw nsw i32 %4, %2
%6 = tail call i32 @LCD_WriteCommand(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("test_socket [ -l ] | [ -s <server_ip]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"test_socket [ -l ] | [ -s <server_ip]\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [38 x i8] c"test_socket [ -l ] | [ -s <server_ip]\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
double foo(double a, double b, double c) { return a + b + c; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fadd double %7, %8
%10 = load double, double* %6
%11 = fadd double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @foo(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fadd double %4, %2
ret double %5
}
void ptn3460_destroy(struct drm_bridge *bridge) {}


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

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

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

LLVM IR (-O2):
%struct.drm_bridge = type opaque
define void @ptn3460_destroy(%struct.drm_bridge* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  argv[0] = "";
  printf("%d\n", argc - 1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture writeonly %1) {
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = add nsw i32 %0, -1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t getIncrement() {
  static uint64_t i = 0;
  i = (i + 1) & ~(1 << 12);
  return i;
}


x86 assembly (clang, -O0):
<getIncrement>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
and    $0xffffefff,%eax
mov    %eax,0x2f0c(%rip)
mov    0x2f06(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIncrement>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
and    $0xffffefff,%eax
mov    %eax,0x2f10(%rip)
ret

LLVM IR (-O0):
@getIncrement.i = internal global i32 0
define i32 @getIncrement() {
%1 = load i32, i32* @getIncrement.i
%2 = add nsw i32 %1, 1
%3 = and i32 %2, -4097
store i32 %3, i32* @getIncrement.i
%4 = load i32, i32* @getIncrement.i
ret i32 %4
}

LLVM IR (-O2):
@getIncrement.i = internal unnamed_addr global i32 0
define i32 @getIncrement() {
%1 = load i32, i32* @getIncrement.i
%2 = add nsw i32 %1, 1
%3 = and i32 %2, -4097
store i32 %3, i32* @getIncrement.i
ret i32 %3
}
void *pmvp(const void *mtx, const void *vec, unsigned int m, unsigned int n,
           unsigned int t) {}


x86 assembly (clang, -O0):
<pmvp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @pmvp(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%12 = load i8*, i8** %6
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @pmvp(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i32 %4) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void ipod_print_error(char *msg) { perror(msg); }


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

x86 assembly (clang, -O2):
<ipod_print_error>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @ipod_print_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
unsigned xrop3_170_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  return D;
}


x86 assembly (clang, -O0):
<xrop3_170_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_170_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @xrop3_170_0_0(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
/* Variables and functions */
int wrdchg(int /*<<< orphan*/);
wordlwr(void) { return (wrdchg(0)); }


x86 assembly (clang, -O0):
<wordlwr>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <wrdchg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordlwr>:
xor    %edi,%edi
jmp    1030 <wrdchg@plt>

LLVM IR (-O0):
define i32 @wordlwr() {
%1 = call i32 @wrdchg(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @wordlwr() {
%1 = tail call i32 @wrdchg(i32 0)
ret i32 %1
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void AESIVSet(uint32_t ui32Base, uint32_t *pui32IVdata) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000040))) = pui32IVdata[0];
  (*((volatile unsigned long *)(ui32Base + 0x00000044))) = pui32IVdata[1];
  (*((volatile unsigned long *)(ui32Base + 0x00000048))) = pui32IVdata[2];
  (*((volatile unsigned long *)(ui32Base + 0x0000004C))) = pui32IVdata[3];
}


x86 assembly (clang, -O0):
<AESIVSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x40(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x44(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x48(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x4c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESIVSet>:
mov    (%rsi),%rax
mov    %rax,0x40(%rdi)
mov    0x8(%rsi),%rax
mov    %rax,0x44(%rdi)
mov    0x10(%rsi),%rax
mov    %rax,0x48(%rdi)
mov    0x18(%rsi),%rax
mov    %rax,0x4c(%rdi)
ret

LLVM IR (-O0):
define void @AESIVSet(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 0
%7 = load i64, i64* %6
%8 = load i64, i64* %3
%9 = add i64 %8, 64
%10 = inttoptr i64 %9 to i64*
store volatile i64 %7, i64* %10
%11 = load i64*, i64** %4
%12 = getelementptr inbounds i64, i64* %11, i64 1
%13 = load i64, i64* %12
%14 = load i64, i64* %3
%15 = add i64 %14, 68
%16 = inttoptr i64 %15 to i64*
store volatile i64 %13, i64* %16
%17 = load i64*, i64** %4
%18 = getelementptr inbounds i64, i64* %17, i64 2
%19 = load i64, i64* %18
%20 = load i64, i64* %3
%21 = add i64 %20, 72
%22 = inttoptr i64 %21 to i64*
store volatile i64 %19, i64* %22
%23 = load i64*, i64** %4
%24 = getelementptr inbounds i64, i64* %23, i64 3
%25 = load i64, i64* %24
%26 = load i64, i64* %3
%27 = add i64 %26, 76
%28 = inttoptr i64 %27 to i64*
store volatile i64 %25, i64* %28
ret void
}

LLVM IR (-O2):
define void @AESIVSet(i64 %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = add i64 %0, 64
%5 = inttoptr i64 %4 to i64*
store volatile i64 %3, i64* %5
%6 = getelementptr inbounds i64, i64* %1, i64 1
%7 = load i64, i64* %6
%8 = add i64 %0, 68
%9 = inttoptr i64 %8 to i64*
store volatile i64 %7, i64* %9
%10 = getelementptr inbounds i64, i64* %1, i64 2
%11 = load i64, i64* %10
%12 = add i64 %0, 72
%13 = inttoptr i64 %12 to i64*
store volatile i64 %11, i64* %13
%14 = getelementptr inbounds i64, i64* %1, i64 3
%15 = load i64, i64* %14
%16 = add i64 %0, 76
%17 = inttoptr i64 %16 to i64*
store volatile i64 %15, i64* %17
ret void
}
/* Variables and functions */
int core7_swap(char *, int);
int U_EMRSETBRUSHORGEX_swap(char *record, int torev) {
  return (core7_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSETBRUSHORGEX_swap>:
jmp    1030 <core7_swap@plt>

LLVM IR (-O0):
define i32 @U_EMRSETBRUSHORGEX_swap(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 = load i32, i32* %4
%7 = call i32 @core7_swap(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @U_EMRSETBRUSHORGEX_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core7_swap(i8* %0, i32 %1)
ret i32 %3
}
int ez_ascii_hash(char *_key, int _tsize) {
  int sum = 0;
  while (_key)
    sum += *_key++;
  return sum % _tsize;
}


x86 assembly (clang, -O0):
<ez_ascii_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <ez_ascii_hash+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <ez_ascii_hash+0x12>
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ez_ascii_hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %9, %2
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = load i32, i32* %5
%15 = add nsw i32 %14, %13
store i32 %15, i32* %5
br label %6
16: ; preds = %6
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = srem i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @ez_ascii_hash(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ undefined_function();
void __attribute__((annotate("realtime"))) foo(int x) {
  (void)x;
  bar();
  undefined_function();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    $0x0,%al
call   1040 <undefined_function@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <undefined_function@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"realtime\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmp28y7shet/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (void (i32)* @foo to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 18, i8* null }], section "llvm.metadata"
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @bar()
%5 = call i32 (...) @undefined_function()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"realtime\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmp28y7shet/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (void (i32)* @foo to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 18, i8* null }], section "llvm.metadata"
define void @foo(i32 %0) {
%2 = tail call i32 (...) @bar()
%3 = tail call i32 (...) @undefined_function()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int open(char *, int, int /*<<< orphan*/);
int creat(char *path, mode_t mode) {
  extern int creat_bits;
  return open(path, creat_bits, mode);
}


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@creat_bits = external global i32
define i32 @creat(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 = load i32, i32* @creat_bits
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@creat_bits = external global i32
define i32 @creat(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @creat_bits
%4 = tail call i32 @open(i8* %0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xc0() {
  Assert_real((islower(192) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              965, ("islower should be 0 for 0xc0"));
}


x86 assembly (clang, -O0):
<t_islower_0xc0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc0,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3c5,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xc0>:
push   %rax
mov    $0xc0,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3c5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc0\00"
define void @t_islower_0xc0() {
%1 = call i64 @islower(i32 192)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 965, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc0\00"
define void @t_islower_0xc0() {
%1 = tail call i64 @islower(i32 192)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 965, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
scalar_t__ nondet();
void main() {
  int *x;
  x = 0;
  if (nondet()) {
    x = (int *)malloc(sizeof(*x));
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <nondet@plt>
cmp    $0x0,%rax
je     114f <main+0x2f>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <nondet@plt>
test   %rax,%rax
je     1138 <main+0x18>
mov    $0x4,%edi
pop    %rax
jmp    1040 <malloc@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = call i64 (...) @nondet()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i64 @malloc(i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %1
br label %7
7: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 (...) @nondet()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 @malloc(i32 4)
br label %5
5: ; preds = %3, %0
ret void
}
void fc1a(x) volatile int x;
{}


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

x86 assembly (clang, -O2):
<fc1a>:
mov    %edi,-0x4(%rsp)
ret

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

LLVM IR (-O2):
define void @fc1a(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
ret void
}
void netSetmode(int mode, char *ssid, int chn) {}


x86 assembly (clang, -O0):
<netSetmode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @netSetmode(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @netSetmode(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Type definitions */
struct argparse_option {
  int dummy;
};
struct argparse {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ argparse_usage(struct argparse *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int argparse_help_cb(struct argparse *this,
                     const struct argparse_option *option) {
  (void)option;
  argparse_usage(this);
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<argparse_help_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <argparse_usage@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
%struct.argparse = type { i32 }
%struct.argparse_option = type { i32 }
define i32 @argparse_help_cb(%struct.argparse* %0, %struct.argparse_option* %1) {
%3 = alloca %struct.argparse*
%4 = alloca %struct.argparse_option*
store %struct.argparse* %0, %struct.argparse** %3
store %struct.argparse_option* %1, %struct.argparse_option** %4
%5 = load %struct.argparse_option*, %struct.argparse_option** %4
%6 = load %struct.argparse*, %struct.argparse** %3
%7 = call i32 @argparse_usage(%struct.argparse* %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.argparse = type { i32 }
%struct.argparse_option = type { i32 }
define i32 @argparse_help_cb(%struct.argparse* %0, %struct.argparse_option* nocapture readnone %1) {
%3 = tail call i32 @argparse_usage(%struct.argparse* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
double Sleef_acosh_u10(double x) { return __builtin_acosh(x); }


x86 assembly (clang, -O0):
<Sleef_acosh_u10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <acosh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_acosh_u10>:
jmp    1030 <acosh@plt>

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

LLVM IR (-O2):
define double @Sleef_acosh_u10(double %0) {
%2 = tail call double @acosh(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int _unlink(char *name) {
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<_unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unlink>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOENT
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOENT
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("\n"
         "Usage: fstest [options]\n"
         "\n"
         " -n num_children       set number of child processes\n"
         " -f num_files          set number of files\n"
         " -s file_size          set file sizes\n"
         " -b block_size         set block (IO) size\n"
         " -p path               set base path\n"
         " -l loops              set loop count\n"
         " -m                    use mmap\n"
         " -S                    use synchronous IO\n"
         " -h                    show this help message\n");
}


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

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

LLVM IR (-O0):
@.str = [399 x i8] c"\0AUsage: fstest [options]\0A\0A -n num_children set number of child processes\0A -f num_files set number of files\0A -s file_size set file sizes\0A -b block_size set block (IO) size\0A -p path set base path\0A -l loops set loop count\0A -m use mmap\0A -S use synchronous IO\0A -h show this help message\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([399 x i8], [399 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [398 x i8] c"\0AUsage: fstest [options]\0A\0A -n num_children set number of child processes\0A -f num_files set number of files\0A -s file_size set file sizes\0A -b block_size set block (IO) size\0A -p path set base path\0A -l loops set loop count\0A -m use mmap\0A -S use synchronous IO\0A -h show this help message\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([398 x i8], [398 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int stat(char const *, struct stat *);
int /*<<< orphan*/ stderr;
time_t stat_mtime(const char *filename) {
  struct stat buf;
  int err = stat(filename, &buf);
  if (err) {
    fprintf(stderr, "stat() failed: %s\n", filename);
    exit(1);
  }
  return buf.st_mtime;
}


x86 assembly (clang, -O0):
<stat_mtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1179 <stat_mtime+0x49>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat_mtime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %eax,%eax
jne    1150 <stat_mtime+0x20>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [19 x i8] c"stat() failed: %s\0A\00"
define i32 @stat_mtime(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%16 = load i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [19 x i8] c"stat() failed: %s\0A\00"
define i32 @stat_mtime(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%12 = load i32, i32* %11
ret i32 %12
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int wsys_filename_8dot3(char *dst, char *src, int maxlen) {
  strncpy(dst, src, maxlen - 1);
  dst[maxlen - 1] = '\0';
  return (strlen(dst));
}


x86 assembly (clang, -O0):
<wsys_filename_8dot3>:
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),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsys_filename_8dot3>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movslq %edx,%r14
lea    -0x1(%r14),%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strlen@plt>

LLVM IR (-O0):
define i32 @wsys_filename_8dot3(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sub nsw i32 %9, 1
%11 = call i32 @strncpy(i8* %7, i8* %8, i32 %10)
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %4
%18 = call i32 @strlen(i8* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @wsys_filename_8dot3(i8* %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %4)
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
%8 = tail call i32 @strlen(i8* %0)
ret i32 %8
}
int c068(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @c068() {
ret i32 0
}

LLVM IR (-O2):
define i32 @c068() {
ret i32 0
}