xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
void dir_close(DIR **dir) {
  if (*dir)
    (void)closedir(*dir);
}


x86 assembly (clang, -O0):
<dir_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <dir_close+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <closedir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_close>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <dir_close+0xd>
jmp    1030 <closedir@plt>
ret

LLVM IR (-O0):
define void @dir_close(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = call i32 @closedir(i32* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @dir_close(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ event_start_loop_select(int);
void event_start_loop(int serverfd) { event_start_loop_select(serverfd); }


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

x86 assembly (clang, -O2):
<event_start_loop>:
jmp    1030 <event_start_loop_select@plt>

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

LLVM IR (-O2):
define void @event_start_loop(i32 %0) {
%2 = tail call i32 @event_start_loop_select(i32 %0)
ret void
}
signed long signedlong_id(signed long x) { return x; }


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

x86 assembly (clang, -O2):
<signedlong_id>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @signedlong_id(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ SavePrefs();
void xIdeOff(void) { SavePrefs(); }


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

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

LLVM IR (-O0):
define void @xIdeOff() {
%1 = call i32 (...) @SavePrefs()
ret void
}

LLVM IR (-O2):
define void @xIdeOff() {
%1 = tail call i32 (...) @SavePrefs()
ret void
}
int test_imm_11uint32_reg(unsigned int val) {
  return ((val) & (0x11 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_11uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x11,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_11uint32_reg>:
test   $0x11,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_11uint32_reg(i32 %0) {
%2 = and i32 %0, 17
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DymosimMessage(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, double, double);
double VariableChanged(char *var, double val, double t) {
  char buf[1000];
  sprintf(buf, "  Variable %.400s = %g at time %g", var, val, t);
  DymosimMessage(buf);
  0;
  return 1.0;
}


x86 assembly (clang, -O0):
<VariableChanged>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rdx
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeb3(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1030 <DymosimMessage@plt>
movsd  0xe92(%rip),%xmm0
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VariableChanged>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rdi,%rdx
lea    0xed6(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <DymosimMessage@plt>
movsd  0xeb3(%rip),%xmm0
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c" Variable %.400s = %g at time %g\00"
define double @VariableChanged(i8* %0, double %1, double %2) {
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
%7 = alloca [1000 x i8]
store i8* %0, i8** %4
store double %1, double* %5
store double %2, double* %6
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %9, double %10, double %11)
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%14 = call i32 @DymosimMessage(i8* %13)
ret double 1.000000e+00
}

LLVM IR (-O2):
@.str = [34 x i8] c" Variable %.400s = %g at time %g\00"
define double @VariableChanged(i8* %0, double %1, double %2) {
%4 = alloca [1000 x i8]
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, double %1, double %2)
%7 = call i32 @DymosimMessage(i8* %5)
ret double 1.000000e+00
}
int **g() { return 0; }


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

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

LLVM IR (-O0):
define i32** @g() {
ret i32** null
}

LLVM IR (-O2):
define noalias i32** @g() {
ret i32** null
}
int sar_permconv_u2s(int unx) {
  int sar = unx & ~0x1ff, i;
  for (i = 0; i < 9; i++)
    sar |= (unx >> (8 - i) & 1) << i;
  return sar;
}


x86 assembly (clang, -O0):
<sar_permconv_u2s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffe00,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    114c <sar_permconv_u2s+0x4c>
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
sub    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <sar_permconv_u2s+0x19>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sar_permconv_u2s>:
mov    %edi,%eax
and    $0xfffffe00,%eax
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0x1,%ecx
or     %eax,%ecx
mov    %edi,%eax
shr    $0x6,%eax
and    $0x2,%eax
or     %ecx,%eax
mov    %edi,%ecx
shr    $0x4,%ecx
and    $0x4,%ecx
or     %eax,%ecx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x8,%eax
or     %ecx,%eax
mov    %edi,%ecx
and    $0x10,%ecx
or     %eax,%ecx
mov    %edi,%eax
and    $0x8,%eax
lea    (%rcx,%rax,4),%ecx
mov    %edi,%edx
shl    $0x4,%edx
and    $0x40,%edx
mov    %edi,%eax
and    $0x2,%eax
shl    $0x6,%eax
or     %edx,%eax
and    $0x1,%edi
shl    $0x8,%edi
or     %edi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sar_permconv_u2s(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, -512
store i32 %6, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %20, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 9
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = sub nsw i32 8, %12
%14 = ashr i32 %11, %13
%15 = and i32 %14, 1
%16 = load i32, i32* %4
%17 = shl i32 %15, %16
%18 = load i32, i32* %3
%19 = or i32 %18, %17
store i32 %19, i32* %3
br label %20
20: ; preds = %10
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %7
23: ; preds = %7
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @sar_permconv_u2s(i32 %0) {
%2 = and i32 %0, -512
%3 = lshr i32 %0, 8
%4 = and i32 %3, 1
%5 = or i32 %4, %2
%6 = lshr i32 %0, 6
%7 = and i32 %6, 2
%8 = or i32 %7, %5
%9 = lshr i32 %0, 4
%10 = and i32 %9, 4
%11 = or i32 %10, %8
%12 = lshr i32 %0, 2
%13 = and i32 %12, 8
%14 = or i32 %13, %11
%15 = and i32 %0, 16
%16 = or i32 %15, %14
%17 = shl i32 %0, 2
%18 = and i32 %17, 32
%19 = or i32 %18, %16
%20 = shl i32 %0, 4
%21 = and i32 %20, 64
%22 = or i32 %21, %19
%23 = shl i32 %0, 6
%24 = and i32 %23, 128
%25 = or i32 %24, %22
%26 = shl i32 %0, 8
%27 = and i32 %26, 256
%28 = or i32 %27, %25
ret i32 %28
}
/* Variables and functions */
int /*<<< orphan*/ gui_ksys_debug_out(char);
void gui_debug_out_str(char *s) {
  while (*s) {
    if (*s == '\n')
      gui_ksys_debug_out(13);
    gui_ksys_debug_out(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<gui_debug_out_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <gui_debug_out_str+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1143 <gui_debug_out_str+0x33>
mov    $0xd,%edi
call   1030 <gui_ksys_debug_out@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <gui_ksys_debug_out@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <gui_debug_out_str+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_debug_out_str>:
push   %rbx
mov    %rdi,%rbx
jmp    1139 <gui_debug_out_str+0x29>
cs nopw 0x0(%rax,%rax,1)
mov    $0xd,%edi
call   1030 <gui_ksys_debug_out@plt>
movzbl (%rbx),%eax
movsbl %al,%edi
call   1030 <gui_ksys_debug_out@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1120 <gui_debug_out_str+0x10>
test   %al,%al
jne    112d <gui_debug_out_str+0x1d>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @gui_debug_out_str(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %11, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %12
i8 10, label %5
]
5: ; preds = %2
%6 = tail call i32 @gui_ksys_debug_out(i8 signext 13)
%7 = load i8, i8* %3
br label %8
8: ; preds = %2, %5
%9 = phi i8 [ %4, %2 ], [ %7, %5 ]
%10 = tail call i32 @gui_ksys_debug_out(i8 signext %9)
%11 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
12: ; preds = %2
ret void
}
double pathconN_nm4_twice(double x) { return x + x; }


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

x86 assembly (clang, -O2):
<pathconN_nm4_twice>:
addsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @pathconN_nm4_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
void test7_T_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test7_T_targetInit__I() {
ret void
}
/* Variables and functions */
int SYS_getpid;
long getpid();
int /*<<< orphan*/ printf(char *, long);
long syscall(int);
int main() {
  long ID1, ID2;
  printf("SYS_getpid: %d\n", SYS_getpid);
  ID1 = syscall(SYS_getpid);
  printf("syscall(SYS_getpid): %ld \n", ID1);
  ID2 = getpid();
  printf("getpid(): %ld \n", ID2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
movslq (%rax),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1050 <syscall@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb8(%rip),%rbx
movslq (%rbx),%rsi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1050 <syscall@plt>
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"SYS_getpid: %d\0A\00"
@SYS_getpid = global i32 0
@.str.1 = [27 x i8] c"syscall(SYS_getpid): %ld \0A\00"
@.str.2 = [16 x i8] c"getpid(): %ld \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = load i32, i32* @SYS_getpid
%5 = sext i32 %4 to i64
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = load i32, i32* @SYS_getpid
%8 = call i64 @syscall(i32 %7)
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i64 %9)
%11 = call i64 (...) @getpid()
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i64 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"SYS_getpid: %d\0A\00"
@SYS_getpid = global i32 0
@.str.1 = [27 x i8] c"syscall(SYS_getpid): %ld \0A\00"
@.str.2 = [16 x i8] c"getpid(): %ld \0A\00"
define i32 @main() {
%1 = load i32, i32* @SYS_getpid
%2 = sext i32 %1 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = load i32, i32* @SYS_getpid
%5 = tail call i64 @syscall(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i64 %5)
%7 = tail call i64 (...) @getpid()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i64 %7)
ret i32 0
}
/* Type definitions */
struct NecroTimer {
  int dummy;
};

/* Variables and functions */
double necro_timer_stop(struct NecroTimer *);
int /*<<< orphan*/ printf(char *, char const *, double);
void necro_timer_stop_and_report(struct NecroTimer *timer,
                                 const char *print_header) {
  double total_time_ms = necro_timer_stop(timer);
  printf("%s: %fms\n", print_header, total_time_ms);
}


x86 assembly (clang, -O0):
<necro_timer_stop_and_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <necro_timer_stop@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<necro_timer_stop_and_report>:
push   %rbx
mov    %rsi,%rbx
call   1040 <necro_timer_stop@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.NecroTimer = type { i32 }
@.str = [10 x i8] c"%s: %fms\0A\00"
define void @necro_timer_stop_and_report(%struct.NecroTimer* %0, i8* %1) {
%3 = alloca %struct.NecroTimer*
%4 = alloca i8*
%5 = alloca double
store %struct.NecroTimer* %0, %struct.NecroTimer** %3
store i8* %1, i8** %4
%6 = load %struct.NecroTimer*, %struct.NecroTimer** %3
%7 = call double @necro_timer_stop(%struct.NecroTimer* %6)
store double %7, double* %5
%8 = load i8*, i8** %4
%9 = load double, double* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8, double %9)
ret void
}

LLVM IR (-O2):
%struct.NecroTimer = type { i32 }
@.str = [10 x i8] c"%s: %fms\0A\00"
define void @necro_timer_stop_and_report(%struct.NecroTimer* %0, i8* %1) {
%3 = tail call double @necro_timer_stop(%struct.NecroTimer* %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, double %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void foo(int n) {
  int i;
#pragma omp for schedule(guided) ordered
  for (i = 0; i < n; ++i)
    bar(i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1144 <foo+0x34>
mov    -0x8(%rbp),%edi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <foo+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112e <foo+0x1e>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <bar@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <foo+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @bar(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *tmp = (char *)malloc(strlen(s) + 1);
  strcpy(tmp, s);
  return tmp;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ bufdelete(char *, char *);
int /*<<< orphan*/ refresh_bounds();
void delete (char *start, char *end) {
  bufdelete(start, end);
  refresh_bounds();
}


x86 assembly (clang, -O0):
<delete>:
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   1040 <bufdelete@plt>
mov    $0x0,%al
call   1030 <refresh_bounds@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delete(i8* %0, i8* %1) {
%3 = tail call i32 @bufdelete(i8* %0, i8* %1)
%4 = tail call i32 (...) @refresh_bounds()
ret void
}
/* Variables and functions */
char *filesize_str(int /*<<< orphan*/);
int /*<<< orphan*/ get_log_sizes();
char *get_str_filesize(void) { return filesize_str(get_log_sizes()); }


x86 assembly (clang, -O0):
<get_str_filesize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_log_sizes@plt>
mov    %eax,%edi
call   1040 <filesize_str@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_str_filesize>:
push   %rax
xor    %eax,%eax
call   1030 <get_log_sizes@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <filesize_str@plt>

LLVM IR (-O0):
define i8* @get_str_filesize() {
%1 = call i32 (...) @get_log_sizes()
%2 = call i8* @filesize_str(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
define i8* @get_str_filesize() {
%1 = tail call i32 (...) @get_log_sizes()
%2 = tail call i8* @filesize_str(i32 %1)
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ height;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
int get_Screen_height(void *_p) { return (int)((Screen *)_p)->height; }


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

x86 assembly (clang, -O2):
<get_Screen_height>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_Screen_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_Screen_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ __builtin_lrintl(long double);
int /*<<< orphan*/ link_failure_builtin_lrintl();
void test_builtin_lrintl(long double ld) {
  if (__builtin_lrintl(ld) != __builtin_lrintl(ld))
    link_failure_builtin_lrintl();
}


x86 assembly (clang, -O0):
<test_builtin_lrintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <lrintl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <lrintl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_builtin_lrintl+0x43>
mov    $0x0,%al
call   1040 <link_failure_builtin_lrintl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_lrintl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <lrintl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <lrintl@plt>
cmp    %rax,%rbx
jne    1151 <test_builtin_lrintl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_lrintl@plt>

LLVM IR (-O0):
define void @test_builtin_lrintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @lrintl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @lrintl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_lrintl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_lrintl(x86_fp80 %0) {
%2 = tail call i64 @lrintl(x86_fp80 %0)
%3 = tail call i64 @lrintl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_lrintl()
br label %7
7: ; preds = %5, %1
ret void
}
int putf8_seqlen(char *s) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @putf8_seqlen(i8* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ int8_t;

/* Variables and functions */
uint8_t TimedTask_canRun(uint8_t runTime, uint8_t now) {
  return (int8_t)(now - runTime) >= 0;
}


x86 assembly (clang, -O0):
<TimedTask_canRun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cltq
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimedTask_canRun>:
xor    %eax,%eax
cmp    %edi,%esi
setge  %al
ret

LLVM IR (-O0):
define i32 @TimedTask_canRun(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = sext i32 %7 to i64
%9 = icmp sge i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @TimedTask_canRun(i32 %0, i32 %1) {
%3 = icmp sge i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
double ut2ts();
time_t ut2tsu() { return ((time_t)(ut2ts() - 631152000.0)); }


x86 assembly (clang, -O0):
<ut2tsu>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ut2ts@plt>
movsd  0xedd(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut2tsu>:
push   %rax
xor    %eax,%eax
call   1030 <ut2ts@plt>
addsd  0xee0(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ut2tsu() {
%1 = call double (...) @ut2ts()
%2 = fsub double %1, 6.311520e+08
%3 = fptosi double %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @ut2tsu() {
%1 = tail call double (...) @ut2ts()
%2 = fadd double %1, -6.311520e+08
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
bool nrf53_errata_3(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_3() {
ret i32 0
}
int str_size(char *string) {
  int i = 0;
  while (string[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<str_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <str_size+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_size+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_size>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <str_size+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_size(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x86() {
  Assert_real((isxdigit(134) == 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_isxdigit.c",
              675, ("isxdigit should be 0 for 0x86"));
}


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

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

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x86\00"
define void @t_isxdigit_0x86() {
%1 = call i64 @isxdigit(i32 134)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 675, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x86\00"
define void @t_isxdigit_0x86() {
%1 = tail call i64 @isxdigit(i32 134)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 675, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned simd(int dw) { return dw == 16 ? 2 : 1; }


x86 assembly (clang, -O0):
<simd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x10,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simd>:
xor    %eax,%eax
cmp    $0x10,%edi
sete   %al
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @simd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 16
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 2, i32 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @simd(i32 %0) {
%2 = icmp eq i32 %0, 16
%3 = select i1 %2, i32 2, i32 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ test1();
int main(int argc, char **argv) {
  if (!test1())
    abort();
  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    $0x0,%al
call   1040 <test1@plt>
cmp    $0x0,%eax
jne    114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test1@plt>
test   %eax,%eax
je     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
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 = call i32 (...) @test1()
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test1()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 0
}
int return_test() { return 2014; }


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

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

LLVM IR (-O0):
define i32 @return_test() {
ret i32 2014
}

LLVM IR (-O2):
define i32 @return_test() {
ret i32 2014
}
/* Variables and functions */
int /*<<< orphan*/ cgsynth(char *);
void cgsynxor(void) { cgsynth("xorl"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"xorl\00"
define void @cgsynxor() {
%1 = tail call i32 @cgsynth(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void clear_restore_sigmask(void) {}


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

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

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

LLVM IR (-O2):
define void @clear_restore_sigmask() {
ret void
}
void gdk_screen_get_height_mm() {}


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

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

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

LLVM IR (-O2):
define void @gdk_screen_get_height_mm() {
ret void
}
void watchdog_device_reset() {}


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

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

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

LLVM IR (-O2):
define void @watchdog_device_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
void MakeFullPath(const char *root, const char *filename, char *pathname) {
  strcpy(pathname, root);
  strcat(pathname, "/");
  strcat(pathname, filename);
}


x86 assembly (clang, -O0):
<MakeFullPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MakeFullPath>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    %rdx,%rdi
call   1030 <strcpy@plt>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define void @MakeFullPath(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %6
%13 = load i8*, i8** %5
%14 = call i32 @strcat(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @MakeFullPath(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %2, i8* %0)
%5 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %2, i8* %1)
ret void
}
void c_pomp_critical_exit_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_critical_exit_(%struct.ompregdescr* nocapture %0) {
ret void
}
/* Variables and functions */
int p_count_file_lines(char **buf) {
  if (buf == NULL)
    return -1;
  int i = 0;
  while (*(buf + i) != NULL)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<p_count_file_lines>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <p_count_file_lines+0x1f>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <p_count_file_lines+0x4d>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1147 <p_count_file_lines+0x47>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <p_count_file_lines+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_count_file_lines>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111d <p_count_file_lines+0x1d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <p_count_file_lines+0x10>
ret

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

LLVM IR (-O2):
define i32 @p_count_file_lines(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ -1, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ f(char *);
void h(char c[]) { f(c); }


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

x86 assembly (clang, -O2):
<h>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @h(i8* %0) {
%2 = tail call i32 @f(i8* %0)
ret void
}
/* Variables and functions */
int SubEvt_hdrSize();
void *SubEvt_data(const void *my) {
  return (void *)((char *)my + SubEvt_hdrSize());
}


x86 assembly (clang, -O0):
<SubEvt_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <SubEvt_hdrSize@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SubEvt_data>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <SubEvt_hdrSize@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @SubEvt_data(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @SubEvt_hdrSize()
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 %5
ret i8* %6
}

LLVM IR (-O2):
define i8* @SubEvt_data(i8* readnone %0) {
%2 = tail call i32 (...) @SubEvt_hdrSize()
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
/* Variables and functions */
int wkd_get_packet(int, unsigned char **, int *);
int wkd_wait(int fd, int wanted_type) {
  unsigned char *out;
  int len, type = -1;
  do
    type = wkd_get_packet(fd, &out, &len);
  while (type == wanted_type);
}


x86 assembly (clang, -O0):
<wkd_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x20(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <wkd_get_packet@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1125 <wkd_wait+0x15>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wkd_wait>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <wkd_get_packet@plt>
cmp    %ebx,%eax
je     1130 <wkd_wait+0x20>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @wkd_wait(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = bitcast i8** %3 to i8*
%6 = bitcast i32* %4 to i8*
br label %7
7: ; preds = %7, %2
%8 = call i32 @wkd_get_packet(i32 %0, i8** %3, i32* %4)
%9 = icmp eq i32 %8, %1
br i1 %9, label %7, label %10
10: ; preds = %7
ret i32 undef
}
char *foo(void) {}


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

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

LLVM IR (-O0):
define i8* @foo() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @foo() {
ret i8* undef
}
void SWAP(int *x, int *y) {
  const int v = *x;
  *x = *y;
  *y = v;
}


x86 assembly (clang, -O0):
<SWAP>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWAP>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @SWAP(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
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @SWAP(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xe5() {
  Assert_real((isspace(229) == 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_isspace.c",
              1150, ("isspace should be 0 for 0xe5"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xe5>:
push   %rax
mov    $0xe5,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x47e,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xe5\00"
define void @t_isspace_0xe5() {
%1 = call i64 @isspace(i32 229)
%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 1150, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xe5\00"
define void @t_isspace_0xe5() {
%1 = tail call i64 @isspace(i32 229)
%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 1150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ bit_gravity;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
int get_XSetWindowAttributes_bit_gravity(void *_p) {
  return (int)((XSetWindowAttributes *)_p)->bit_gravity;
}


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

x86 assembly (clang, -O2):
<get_XSetWindowAttributes_bit_gravity>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XSetWindowAttributes_bit_gravity(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XSetWindowAttributes_bit_gravity(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ GLshort;

/* Variables and functions */
int /*<<< orphan*/ glRasterPos4sv(int /*<<< orphan*/ *);
void RasterPos4sv(GLshort v[4]) { glRasterPos4sv(v); }


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

x86 assembly (clang, -O2):
<RasterPos4sv>:
jmp    1030 <glRasterPos4sv@plt>

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

LLVM IR (-O2):
define void @RasterPos4sv(i32* %0) {
%2 = tail call i32 @glRasterPos4sv(i32* %0)
ret void
}