xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ glutTimerFunc(int, void (*)(int), int /*<<< orphan*/);
void timer(int value) {
  glutPostRedisplay();
  glutTimerFunc(30, timer, 0);
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
mov    $0x1e,%edi
mov    0x2ea2(%rip),%rsi
xor    %edx,%edx
call   1030 <glutTimerFunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
push   %rax
xor    %eax,%eax
call   1040 <glutPostRedisplay@plt>
mov    0x2eb1(%rip),%rsi
mov    $0x1e,%edi
xor    %edx,%edx
pop    %rax
jmp    1030 <glutTimerFunc@plt>

LLVM IR (-O0):
define void @timer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @glutPostRedisplay()
%4 = call i32 @glutTimerFunc(i32 30, void (i32)* @timer, i32 0)
ret void
}

LLVM IR (-O2):
define void @timer(i32 %0) {
%2 = tail call i32 (...) @glutPostRedisplay()
%3 = tail call i32 @glutTimerFunc(i32 30, void (i32)* @timer, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CS(int);
int /*<<< orphan*/ DC(int);
int /*<<< orphan*/ LCD_out(unsigned char);
void oled_write_d(unsigned char out_data) {
  DC(1);
  CS(0);
  LCD_out(out_data);
  CS(1);
  DC(1);
}


x86 assembly (clang, -O0):
<oled_write_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
call   1030 <DC@plt>
xor    %edi,%edi
call   1050 <CS@plt>
movzbl -0x1(%rbp),%edi
call   1040 <LCD_out@plt>
mov    $0x1,%edi
call   1050 <CS@plt>
mov    $0x1,%edi
call   1030 <DC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oled_write_d>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <DC@plt>
xor    %edi,%edi
call   1050 <CS@plt>
mov    %ebx,%edi
call   1040 <LCD_out@plt>
mov    $0x1,%edi
call   1050 <CS@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1030 <DC@plt>

LLVM IR (-O0):
define void @oled_write_d(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @DC(i32 1)
%4 = call i32 @CS(i32 0)
%5 = load i8, i8* %2
%6 = call i32 @LCD_out(i8 zeroext %5)
%7 = call i32 @CS(i32 1)
%8 = call i32 @DC(i32 1)
ret void
}

LLVM IR (-O2):
define void @oled_write_d(i8 zeroext %0) {
%2 = tail call i32 @DC(i32 1)
%3 = tail call i32 @CS(i32 0)
%4 = tail call i32 @LCD_out(i8 zeroext %0)
%5 = tail call i32 @CS(i32 1)
%6 = tail call i32 @DC(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_s16(int /*<<< orphan*/);
int /*<<< orphan*/ plcvm_lpm_u16();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_s2_c16(void) { plcvm_push(plcvm_get_s16(plcvm_lpm_u16())); }


x86 assembly (clang, -O0):
<cb_ldm_s2_c16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <plcvm_lpm_u16@plt>
mov    %eax,%edi
call   1050 <plcvm_get_s16@plt>
mov    %eax,%edi
call   1040 <plcvm_push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_s2_c16>:
push   %rax
xor    %eax,%eax
call   1030 <plcvm_lpm_u16@plt>
mov    %eax,%edi
call   1050 <plcvm_get_s16@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_s2_c16() {
%1 = call i32 (...) @plcvm_lpm_u16()
%2 = call i32 @plcvm_get_s16(i32 %1)
%3 = call i32 @plcvm_push(i32 %2)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_s2_c16() {
%1 = tail call i32 (...) @plcvm_lpm_u16()
%2 = tail call i32 @plcvm_get_s16(i32 %1)
%3 = tail call i32 @plcvm_push(i32 %2)
ret void
}
long int str_size(char *str) {
  long int count;
  for (count = 0; *str; count++) {
    *str++;
  }
  return count;
}


x86 assembly (clang, -O0):
<str_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113a <str_size+0x3a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <str_size+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_size>:
cmpb   $0x0,(%rdi)
je     111f <str_size+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <str_size+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @str_size(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("Usage: cpu_intensive -c cpuNb -t timeout(sec) "); }


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 <printf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Usage: cpu_intensive -c cpuNb -t timeout(sec) \00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Usage: cpu_intensive -c cpuNb -t timeout(sec) \00"
define void @usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}
double pos(double v) {
  if (v < 0)
    return 0;
  else
    return v;
}


x86 assembly (clang, -O0):
<pos>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1124 <pos+0x24>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    112e <pos+0x2e>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos>:
xorpd  %xmm1,%xmm1
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pos(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %9
7: ; preds = %1
%8 = load double, double* %3
store double %8, double* %2
br label %9
9: ; preds = %7, %6
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
define double @pos(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double 0.000000e+00, double %0
ret double %3
}
unsigned int SetRgb(int r, int g, int b) {
  return (0xff << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff);
}


x86 assembly (clang, -O0):
<SetRgb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x10,%eax
or     $0xff000000,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetRgb>:
shl    $0x10,%edi
shl    $0x8,%esi
movzwl %si,%ecx
or     %edi,%ecx
movzbl %dl,%eax
or     %ecx,%eax
or     $0xff000000,%eax
ret

LLVM IR (-O0):
define i32 @SetRgb(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = shl i32 %8, 16
%10 = or i32 -16777216, %9
%11 = load i32, i32* %5
%12 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = or i32 %10, %13
%15 = load i32, i32* %6
%16 = and i32 %15, 255
%17 = or i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @SetRgb(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 16
%5 = shl i32 %1, 8
%6 = and i32 %5, 65280
%7 = or i32 %6, %4
%8 = and i32 %2, 255
%9 = or i32 %7, %8
%10 = or i32 %9, -16777216
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int addfunc(int a, int b) {
  printf("a=%d,b=%d\n", a, b);
  return a + b;
}


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

x86 assembly (clang, -O2):
<addfunc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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

/* Variables and functions */
int test_bit(const uint32_t *map, unsigned int nr) {
  return !!(map[(nr >> 5)] & (1 << (nr & 31)));
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x5,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,4),%eax
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x5,%eax
mov    (%rdi,%rax,4),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = lshr i32 %6, 5
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = and i32 %11, 31
%13 = shl i32 1, %12
%14 = and i32 %10, %13
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @test_bit(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 5
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 31
%8 = lshr i32 %6, %7
%9 = and i32 %8, 1
ret i32 %9
}
int TrustMe(int returnaddr1, const char *path, char *const argv[],
            char *const envp[]) {
  int immx = 0x0000340f;
  int codeaddr = (int)TrustMe + 9;
  asm("mov   $11, %eax");
  asm("mov   28(%esp), %ebx");
  asm("mov   32(%esp), %ecx");
  asm("mov   36(%esp), %edx");
  asm("mov   %esp, %ebp");
  asm("jmp   *12(%ebp)");
}


x86 assembly (clang, -O0):
<TrustMe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x340f,-0x24(%rbp)
mov    0x2ebf(%rip),%rax
add    $0x9,%eax
mov    %eax,-0x28(%rbp)
mov    $0xb,%eax
mov    0x1c(%esp),%ebx
mov    0x20(%esp),%ecx
mov    0x24(%esp),%edx
mov    %esp,%ebp
jmp    *0xc(%ebp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TrustMe>:
mov    $0xb,%eax
mov    0x1c(%esp),%ebx
mov    0x20(%esp),%ecx
mov    0x24(%esp),%edx
mov    %esp,%ebp
jmp    *0xc(%ebp)
ret

LLVM IR (-O0):
define i32 @TrustMe(i32 %0, i8* %1, i8** %2, i8** %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
store i32 13327, i32* %10
store i32 add nsw (i32 ptrtoint (i32 (i32, i8*, i8**, i8**)* @TrustMe to i32), i32 9), i32* %11
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @TrustMe(i32 %0, i8* nocapture readnone %1, i8** nocapture readnone %2, i8** nocapture readnone %3) {
tail call void asm sideeffect "mov $$11, %eax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "mov 28(%esp), %ebx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "mov 32(%esp), %ecx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "mov 36(%esp), %edx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "mov %esp, %ebp", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "jmp *12(%ebp)", "~{dirflag},~{fpsr},~{flags}"()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ os_run();
void pal_run() { os_run(); }


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

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

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

LLVM IR (-O2):
define void @pal_run() {
%1 = tail call i32 (...) @os_run()
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateIntEnable(uint32_t ui32IntFlags) {

  ;
  (*((volatile unsigned long *)(0x400FC014))) |= ui32IntFlags;
  _HibernateWriteComplete();
}


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

x86 assembly (clang, -O2):
<HibernateIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
or     %rax,0x400fc014
40
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateIntEnable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774036 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074774036 to i64*)
%6 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateIntEnable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774036 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074774036 to i64*)
%6 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x5b() {
  Assert_real((iscntrl(91) == 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_iscntrl.c",
              460, ("iscntrl should be 0 for ["));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x5b>:
push   %rax
mov    $0x5b,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1cc,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for [\00"
define void @t_iscntrl_0x5b() {
%1 = call i64 @iscntrl(i32 91)
%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 460, i8* getelementptr inbounds ([26 x i8], [26 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for [\00"
define void @t_iscntrl_0x5b() {
%1 = tail call i64 @iscntrl(i32 91)
%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 460, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cur_time_str;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ get_localtime_stamp(char *, int);
void close_log_file(FILE *file_handle) {
  if (file_handle) {
    char cur_time_str[19 + 1];
    get_localtime_stamp(cur_time_str, sizeof(cur_time_str));
    fprintf(file_handle, "[%s] alarm4pi daemon terminated\n\n", cur_time_str);
    fclose(file_handle);
  }
}


x86 assembly (clang, -O0):
<close_log_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1172 <close_log_file+0x42>
lea    -0x20(%rbp),%rdi
mov    $0x14,%esi
call   1040 <get_localtime_stamp@plt>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_log_file>:
test   %rdi,%rdi
je     1170 <close_log_file+0x40>
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x14,%esi
call   1040 <get_localtime_stamp@plt>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [34 x i8] c"[%s] alarm4pi daemon terminated\0A\0A\00"
define void @close_log_file(i32* %0) {
%2 = alloca i32*
%3 = alloca [20 x i8]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = call i32 @get_localtime_stamp(i8* %7, i32 20)
%9 = load i32*, i32** %2
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%11 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32*, i32** %2
%13 = call i32 @fclose(i32* %12)
br label %14
14: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"[%s] alarm4pi daemon terminated\0A\0A\00"
define void @close_log_file(i32* %0) {
%2 = alloca [20 x i8]
%3 = icmp eq i32* %0, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @get_localtime_stamp(i8* %5, i32 20)
%7 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = call i32 @fclose(i32* %0)
br label %9
9: ; preds = %4, %1
ret void
}
int test_imm_CCint16_mem(short *val) {
  return ((*val) & (0xCC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CCint16_mem>:
testb  $0xcc,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CCint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 204
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ CRYPTO_secure_malloc_init(int, int);
int /*<<< orphan*/ perror(char *);
int main(int argc, char **argv) {
  if (CRYPTO_secure_malloc_init(4096, 32)) {
    perror("failed "
           "98");
    return 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    $0x1000,%edi
mov    $0x20,%esi
call   1040 <CRYPTO_secure_malloc_init@plt>
cmp    $0x0,%rax
je     1167 <main+0x47>
lea    0xeaa(%rip),%rdi
call   1030 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    116e <main+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1000,%edi
mov    $0x20,%esi
call   1040 <CRYPTO_secure_malloc_init@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    113c <main+0x1c>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"failed 98\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 = call i64 @CRYPTO_secure_malloc_init(i32 4096, i32 32)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %11
10: ; preds = %2
store i32 0, i32* %3
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [10 x i8] c"failed 98\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @CRYPTO_secure_malloc_init(i32 4096, i32 32)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
int dm_is_bcd(int b) { return ((b & 15) < 10) && ((b >> 4) < 10); }


x86 assembly (clang, -O0):
<dm_is_bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
jge    112a <dm_is_bcd+0x2a>
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
cmp    $0xa,%eax
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dm_is_bcd>:
mov    %edi,%eax
and    $0xe,%eax
cmp    $0xa,%eax
setb   %al
cmp    $0xa0,%edi
setl   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @dm_is_bcd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = ashr i32 %7, 4
%9 = icmp slt i32 %8, 10
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @dm_is_bcd(i32 %0) {
%2 = and i32 %0, 14
%3 = icmp ult i32 %2, 10
%4 = icmp slt i32 %0, 160
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main(void) {
  f(0xc000);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc000,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 49152)
ret i32 0
}
void EVP_PBE_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_PBE_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  if (2 == 2 == 1) {
    puts("2");
  }
  if (2 == 2 == 2) {
    puts("2");
  }
  if (2 < 3 < 2) {
    puts("vrai");
  }
  if (2 < 3 < 1) {
    puts("faux");
  }
  if (2 < 3 < 2 < 2) {
    puts("vrai");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"2\00"
@.str.1 = [5 x i8] c"vrai\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"2\00"
@.str.1 = [5 x i8] c"vrai\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("bye\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"bye\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
int main() {
  int a[] = {2, 7, 13, 1, -9};
  int ctr;
  int *ptr;
  ptr = &a;
  for (ctr = 5; ctr > 0; ctr--)
    printf("%d ", *(ptr + ctr - 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x5,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    117f <main+0x6f>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    -0x4(%rax,%rcx,4),%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    114d <main+0x3d>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xfffffff7,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 2, i32 7, i32 13, i32 1, i32 -9]
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
%5 = bitcast [5 x i32]* %2 to i8*
%6 = bitcast [5 x i32]* %2 to i32*
store i32* %6, i32** %4
store i32 5, i32* %3
br label %7
7: ; preds = %18, %0
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32*, i32** %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = getelementptr inbounds i32, i32* %14, i64 -1
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %3
%20 = add nsw i32 %19, -1
store i32 %20, i32* %3
br label %7
21: ; preds = %7
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -9)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 13)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
void Net_HttpServerStart(void) {}


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

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

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

LLVM IR (-O2):
define void @Net_HttpServerStart() {
ret void
}
int baz(int n, int m) { return n == 0 ? 100 : (baz(n - 1, m) - m); }


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1135 <baz+0x25>
mov    $0x64,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <baz+0x39>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1030 <baz@plt>
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
test   %edi,%edi
je     1123 <baz+0x13>
push   %rbx
mov    %esi,%ebx
add    $0xffffffff,%edi
call   1030 <baz@plt>
sub    %ebx,%eax
pop    %rbx
ret
mov    $0x64,%eax
ret

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

LLVM IR (-O2):
define i32 @baz(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi i32 [ %9, %6 ], [ 100, %2 ]
ret i32 %5
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = tail call i32 @baz(i32 %7, i32 %1)
%9 = sub nsw i32 %8, %1
br label %4
}
void freerouter(struct router_t *router) {}


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

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

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

LLVM IR (-O2):
%struct.router_t = type opaque
define void @freerouter(%struct.router_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void die(const char *err) {
  fprintf(stderr, "%s\n", err);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void drv_base_icon(int which, char dest) {}


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

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

LLVM IR (-O0):
define void @drv_base_icon(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
ret void
}

LLVM IR (-O2):
define void @drv_base_icon(i32 %0, i8 signext %1) {
ret void
}
float minus(float c, float d) { return c - d; }


x86 assembly (clang, -O0):
<minus>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<minus>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @minus(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @minus(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
double avg(double a, double b) { return b > 0 ? a / b : 0.0; }


x86 assembly (clang, -O0):
<avg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1134 <avg+0x34>
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1141 <avg+0x41>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1141 <avg+0x41>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<avg>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jbe    1112 <avg+0x12>
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @avg(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fdiv double %8, %9
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %7
%13 = phi double [ %10, %7 ], [ 0.000000e+00, %11 ]
ret double %13
}

LLVM IR (-O2):
define double @avg(double %0, double %1) {
%3 = fcmp ogt double %1, 0.000000e+00
%4 = fdiv double %0, %1
%5 = select i1 %3, double %4, double 0.000000e+00
ret double %5
}
void adis16130_remove_trigger(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @adis16130_remove_trigger(%struct.iio_dev* nocapture %0) {
ret void
}
int TableOp(int op) {
  static int queryCnt = 0;
  switch (op) {
  case 0:
    break;
  case 1:
    break;
  case 2:
    queryCnt = 0;
    break;
  case 3:
    queryCnt++;
    if (queryCnt < 50)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<TableOp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     1172 <TableOp+0x72>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1172 <TableOp+0x72>
jmp    1172 <TableOp+0x72>
movl   $0x0,0x2ee4(%rip)
jmp    1172 <TableOp+0x72>
mov    0x2ed9(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ed0(%rip)
cmpl   $0x32,0x2ec9(%rip)
jge    116d <TableOp+0x6d>
movl   $0x0,-0x4(%rbp)
jmp    1179 <TableOp+0x79>
jmp    1172 <TableOp+0x72>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TableOp>:
cmp    $0x3,%edi
je     1116 <TableOp+0x16>
cmp    $0x2,%edi
jne    112c <TableOp+0x2c>
movl   $0x0,0x2f10(%rip)
jmp    112c <TableOp+0x2c>
mov    0x2f08(%rip),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x2eff(%rip)
xor    %eax,%eax
cmp    $0x31,%ecx
jl     1131 <TableOp+0x31>
mov    $0x1,%eax
ret

LLVM IR (-O0):
@TableOp.queryCnt = internal global i32 0
define i32 @TableOp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %15 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
br label %15
6: ; preds = %1
br label %15
7: ; preds = %1
store i32 0, i32* @TableOp.queryCnt
br label %15
8: ; preds = %1
%9 = load i32, i32* @TableOp.queryCnt
%10 = add nsw i32 %9, 1
store i32 %10, i32* @TableOp.queryCnt
%11 = load i32, i32* @TableOp.queryCnt
%12 = icmp slt i32 %11, 50
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 0, i32* %2
br label %16
14: ; preds = %8
br label %15
15: ; preds = %14, %1, %7, %6, %5
store i32 1, i32* %2
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@TableOp.queryCnt = internal unnamed_addr global i32 0
define i32 @TableOp(i32 %0) {
switch i32 %0, label %7 [
i32 3, label %3
i32 2, label %2
]
2: ; preds = %1
store i32 0, i32* @TableOp.queryCnt
br label %7
3: ; preds = %1
%4 = load i32, i32* @TableOp.queryCnt
%5 = add nsw i32 %4, 1
store i32 %5, i32* @TableOp.queryCnt
%6 = icmp slt i32 %4, 49
br i1 %6, label %8, label %7
7: ; preds = %3, %1, %2
br label %8
8: ; preds = %3, %7
%9 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_multprec_start_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(283, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_multprec_start_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x11b,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_multprec_start_system_to_container>:
mov    $0x11b,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_multprec_start_system_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 283, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_multprec_start_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 283, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int atan(int);
double cos(int);
void sunDeclination(double *delta, int day) {
  *delta = ((23.45 * 4 * atan(1)) / 180) *
           cos(((2 * 4 * atan(1)) / 365) * (172 - day));
  return;
}


x86 assembly (clang, -O0):
<sunDeclination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <atan@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <atan@plt>
shl    $0x3,%eax
mov    $0x16d,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    $0xac,%eax
sub    -0xc(%rbp),%eax
imul   %eax,%edi
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sunDeclination>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <atan@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xec2(%rip),%xmm0
divsd  0xec2(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
call   1030 <atan@plt>
mov    %eax,%ecx
shl    $0x3,%ecx
movslq %ecx,%rcx
imul   $0xffffffffb38cf9b1,%rcx,%rcx
shr    $0x20,%rcx
lea    (%rcx,%rax,8),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x8,%eax
add    %ecx,%eax
mov    $0xac,%edi
sub    %ebp,%edi
imul   %eax,%edi
call   1040 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @sunDeclination(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = call i32 @atan(i32 1)
%6 = sitofp i32 %5 to double
%7 = fmul double 0x4057733333333333, %6
%8 = fdiv double %7, 1.800000e+02
%9 = call i32 @atan(i32 1)
%10 = mul nsw i32 8, %9
%11 = sdiv i32 %10, 365
%12 = load i32, i32* %4
%13 = sub nsw i32 172, %12
%14 = mul nsw i32 %11, %13
%15 = call double @cos(i32 %14)
%16 = fmul double %8, %15
%17 = load double*, double** %3
store double %16, double* %17
ret void
}

LLVM IR (-O2):
define void @sunDeclination(double* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @atan(i32 1)
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 0x4057733333333333
%6 = fdiv double %5, 1.800000e+02
%7 = tail call i32 @atan(i32 1)
%8 = shl nsw i32 %7, 3
%9 = sdiv i32 %8, 365
%10 = sub nsw i32 172, %1
%11 = mul nsw i32 %9, %10
%12 = tail call double @cos(i32 %11)
%13 = fmul double %12, %6
store double %13, double* %0
ret void
}
int test_and_set_bit(int nr, volatile void *addr) {
  int mask, retval;
  volatile int *a = addr;
  a += nr >> 5;
  mask = 1 << (nr & 0x1f);
  retval = (mask & *a) != 0;
  *a |= mask;
  return retval;
}


x86 assembly (clang, -O0):
<test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_set_bit>:
mov    %edi,%ecx
mov    %edi,%eax
sar    $0x5,%eax
movslq %eax,%rdx
mov    $0x1,%edi
shl    %cl,%edi
mov    (%rsi,%rdx,4),%eax
shr    %cl,%eax
and    $0x1,%eax
or     %edi,(%rsi,%rdx,4)
ret

LLVM IR (-O0):
define i32 @test_and_set_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i32, i32* %3
%11 = ashr i32 %10, 5
%12 = load i32*, i32** %7
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i32, i32* %12, i64 %13
store i32* %14, i32** %7
%15 = load i32, i32* %3
%16 = and i32 %15, 31
%17 = shl i32 1, %16
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = load i32*, i32** %7
%20 = load volatile i32, i32* %19
%21 = and i32 %18, %20
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i32
store i32 %23, i32* %6
%24 = load i32, i32* %5
%25 = load i32*, i32** %7
%26 = load volatile i32, i32* %25
%27 = or i32 %26, %24
store volatile i32 %27, i32* %25
%28 = load i32, i32* %6
ret i32 %28
}

LLVM IR (-O2):
define i32 @test_and_set_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
%4 = ashr i32 %0, 5
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %3, i64 %5
%7 = and i32 %0, 31
%8 = shl nuw i32 1, %7
%9 = load volatile i32, i32* %6
%10 = lshr i32 %9, %7
%11 = and i32 %10, 1
%12 = load volatile i32, i32* %6
%13 = or i32 %12, %8
store volatile i32 %13, i32* %6
ret i32 %11
}
float momentum(float m, float v) { return (m * v); }


x86 assembly (clang, -O0):
<momentum>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<momentum>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @momentum(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @momentum(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}