xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long CANIntNumberGet(unsigned long, unsigned char);
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void CANIntUnregister(unsigned long ulBase, unsigned char ucIntNumber) {
  unsigned long ulIntNumber;
  ;
  ulIntNumber = CANIntNumberGet(ulBase, ucIntNumber);
  IntUnregister(ulIntNumber);
  IntDisable(ulIntNumber);
}


x86 assembly (clang, -O0):
<CANIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
call   1040 <CANIntNumberGet@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <IntUnregister@plt>
mov    -0x18(%rbp),%rdi
call   1030 <IntDisable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntUnregister>:
push   %rbx
call   1040 <CANIntNumberGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <IntUnregister@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <IntDisable@plt>

LLVM IR (-O0):
define void @CANIntUnregister(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
%5 = alloca i64
store i64 %0, i64* %3
store i8 %1, i8* %4
%6 = load i64, i64* %3
%7 = load i8, i8* %4
%8 = call i64 @CANIntNumberGet(i64 %6, i8 zeroext %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = call i32 @IntUnregister(i64 %9)
%11 = load i64, i64* %5
%12 = call i32 @IntDisable(i64 %11)
ret void
}

LLVM IR (-O2):
define void @CANIntUnregister(i64 %0, i8 zeroext %1) {
%3 = tail call i64 @CANIntNumberGet(i64 %0, i8 zeroext %1)
%4 = tail call i32 @IntUnregister(i64 %3)
%5 = tail call i32 @IntDisable(i64 %3)
ret void
}
void rop3_70_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T & *D;
  stk2 = S | stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_70_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_70_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%eax
and    %dl,%al
mov    %eax,%ecx
or     %sil,%cl
xor    %r8b,%cl
not    %dl
or     %sil,%dl
and    %cl,%dl
not    %sil
and    %al,%sil
or     %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_70_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = and i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = and i32 %31, %33
%35 = load i8, i8* %7
%36 = zext i8 %35 to i32
%37 = load i8, i8* %6
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = or i32 %34, %40
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = xor i32 %45, -1
%47 = and i32 %43, %46
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = and i32 %47, %50
%52 = or i32 %41, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_70_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %6, %4
%8 = xor i8 %2, -1
%9 = or i8 %8, %1
%10 = and i8 %7, %9
%11 = xor i8 %1, -1
%12 = and i8 %5, %11
%13 = or i8 %10, %12
store i8 %13, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test6_Y_set__E();
void test6_Led1_targetInit__I() {
  { test6_Y_set__E(); }
}


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

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

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

LLVM IR (-O2):
define void @test6_Led1_targetInit__I() {
%1 = tail call i32 (...) @test6_Y_set__E()
ret void
}
int intmem_enable(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @intmem_enable() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ quick_sort_helper(int *, int /*<<< orphan*/, int);
void quick_sort(int *arr, int length) { quick_sort_helper(arr, 0, length - 1); }


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

x86 assembly (clang, -O2):
<quick_sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <quick_sort_helper@plt>

LLVM IR (-O0):
define void @quick_sort(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 = sub nsw i32 %6, 1
%8 = call i32 @quick_sort_helper(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @quick_sort_helper(i32* %0, i32 0, i32 %3)
ret void
}
/* Type definitions */
struct robot {
  int dummy;
};

/* Variables and functions */
int damage(struct robot *);
int cmd_damage(struct robot *robot, int *args) { return damage(robot); }


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

x86 assembly (clang, -O2):
<cmd_damage>:
jmp    1030 <damage@plt>

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

LLVM IR (-O2):
%struct.robot = type { i32 }
define i32 @cmd_damage(%struct.robot* %0, i32* nocapture readnone %1) {
%3 = tail call i32 @damage(%struct.robot* %0)
ret i32 %3
}
void gtk_icon_view_get_path_at_pos() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_get_path_at_pos() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uartTx(char *, int);
void lcdClear() { uartTx("\xFE\x01", 2); }


x86 assembly (clang, -O0):
<lcdClear>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
call   1030 <uartTx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcdClear>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <uartTx@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\FE\01\00"
define void @lcdClear() {
%1 = call i32 @uartTx(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\FE\01\00"
define void @lcdClear() {
%1 = tail call i32 @uartTx(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
frmbcd(c) unsigned char c;
{ return (c & 0xF) + ((c >> 4) & 0xF) * 10; }


x86 assembly (clang, -O0):
<frmbcd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl -0x1(%rbp),%ecx
sar    $0x4,%ecx
and    $0xf,%ecx
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<frmbcd>:
mov    %edi,%eax
and    $0xf,%eax
shr    $0x4,%edi
and    $0xf,%edi
lea    (%rdi,%rdi,4),%ecx
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @frmbcd(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = and i32 %5, 15
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 4
%10 = and i32 %9, 15
%11 = mul nsw i32 %10, 10
%12 = add nsw i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @frmbcd(i32 %0) {
%2 = and i32 %0, 15
%3 = lshr i32 %0, 4
%4 = and i32 %3, 15
%5 = mul nuw nsw i32 %4, 10
%6 = add nuw nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
float noise4(float, float, float, float);
float lovrMathNoise4(float x, float y, float z, float w) {
  return noise4(x, y, z, w) * .5f + .5f;
}


x86 assembly (clang, -O0):
<lovrMathNoise4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1030 <noise4@plt>
movss  0xeb3(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lovrMathNoise4>:
push   %rax
call   1030 <noise4@plt>
movss  0xee2(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @lovrMathNoise4(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load float, float* %8
%13 = call float @noise4(float %9, float %10, float %11, float %12)
%14 = call float @llvm.fmuladd.f32(float %13, float 5.000000e-01, float 5.000000e-01)
ret float %14
}

LLVM IR (-O2):
define float @lovrMathNoise4(float %0, float %1, float %2, float %3) {
%5 = tail call float @noise4(float %0, float %1, float %2, float %3)
%6 = tail call float @llvm.fmuladd.f32(float %5, float 5.000000e-01, float 5.000000e-01)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *run_thread(void *a) {
  while (1) {
    sleep(10);
  }
  return 0;
}


x86 assembly (clang, -O0):
<run_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <sleep@plt>
jmp    111c <run_thread+0xc>

x86 assembly (clang, -O2):
<run_thread>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <sleep@plt>
jmp    1120 <run_thread+0x10>

LLVM IR (-O0):
define i8* @run_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 10)
br label %3
}

LLVM IR (-O2):
define noalias i8* @run_thread(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 10)
br label %2
}
int pct(x)
int x;
{ return (ranz(100) < x); }


x86 assembly (clang, -O0):
<pct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x64,%edi
mov    $0x0,%al
call   1030 <ranz@plt>
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pct>:
push   %rbx
mov    %edi,%ebx
mov    $0x64,%edi
xor    %eax,%eax
call   1030 <ranz@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setl   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @ranz to i32 (i32, ...)*)(i32 100)
%4 = load i32, i32* %2
%5 = icmp slt i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @pct(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @ranz to i32 (i32, ...)*)(i32 100)
%3 = icmp slt i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ res_hl(int);
void opcb_96() { res_hl(2); }


x86 assembly (clang, -O0):
<opcb_96>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <res_hl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<opcb_96>:
mov    $0x2,%edi
jmp    1030 <res_hl@plt>

LLVM IR (-O0):
define void @opcb_96() {
%1 = call i32 @res_hl(i32 2)
ret void
}

LLVM IR (-O2):
define void @opcb_96() {
%1 = tail call i32 @res_hl(i32 2)
ret void
}
hvp(pn1, pn2) int pn1, pn2;
{ brc2(pn1, pn2, 'f'); }


x86 assembly (clang, -O0):
<hvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x66,%edx
mov    $0x0,%al
call   1030 <brc2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hvp>:
mov    $0x66,%edx
xor    %eax,%eax
jmp    1030 <brc2@plt>

LLVM IR (-O0):
define i32 @hvp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @brc2 to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 102)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @hvp(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @brc2 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 102)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ gadgetclose();
void __gadgetdestroy(void) { gadgetclose(); }


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

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

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

LLVM IR (-O2):
define void @__gadgetdestroy() {
%1 = tail call i32 (...) @gadgetclose()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ incr(int);
int f(int u) {
  if (u == 0)
    return 1;
  else {
    incr(u);
    return f(u - 1);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <f+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1157 <f+0x37>
mov    -0x8(%rbp),%edi
call   1040 <incr@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
test   %edi,%edi
je     112c <f+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <incr@plt>
add    $0xffffffff,%ebx
jne    1120 <f+0x10>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @incr(i32 %4)
%6 = add nsw i32 %4, -1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 1
}
long double square_root_helper_derivative(double long const x, double long *k) {
  return 2 * x;
}


x86 assembly (clang, -O0):
<square_root_helper_derivative>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
fadd   %st,%st(0)
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_root_helper_derivative>:
fldt   0x8(%rsp)
fadd   %st,%st(0)
ret

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

LLVM IR (-O2):
define x86_fp80 @square_root_helper_derivative(x86_fp80 %0, x86_fp80* nocapture readnone %1) {
%3 = fmul x86_fp80 %0, 0xK40008000000000000000
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
int getnumber(char *s) {
  int i;
  sscanf(s, "%d", &i);
  return (i);
}


x86 assembly (clang, -O0):
<getnumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnumber>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @getnumber(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *);
extern void swedish_ISO_8859_1_close_env(struct SN_env *z) { SN_close_env(z); }


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

x86 assembly (clang, -O2):
<swedish_ISO_8859_1_close_env>:
jmp    1030 <SN_close_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define void @swedish_ISO_8859_1_close_env(%struct.SN_env* %0) {
%2 = alloca %struct.SN_env*
store %struct.SN_env* %0, %struct.SN_env** %2
%3 = load %struct.SN_env*, %struct.SN_env** %2
%4 = call i32 @SN_close_env(%struct.SN_env* %3)
ret void
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @swedish_ISO_8859_1_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0)
ret void
}
/* Type definitions */
typedef int __u_char;

/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/, int);
int cbm_listen(int f, __u_char dev, __u_char secadr) {
  return ioctl(f, _IO(0xcb, 1), (dev << 8) | secadr);
}


x86 assembly (clang, -O0):
<cbm_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xcb,%edi
mov    $0x1,%esi
call   1030 <_IO@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
shl    $0x8,%edx
or     -0xc(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbm_listen>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0xcb,%edi
mov    $0x1,%esi
call   1030 <_IO@plt>
shl    $0x8,%ebp
or     %ebp,%ebx
mov    %r14d,%edi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbm_listen(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 = call i32 @_IO(i32 203, i32 1)
%9 = load i32, i32* %5
%10 = shl i32 %9, 8
%11 = load i32, i32* %6
%12 = or i32 %10, %11
%13 = call i32 @ioctl(i32 %7, i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @cbm_listen(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_IO(i32 203, i32 1)
%5 = shl i32 %1, 8
%6 = or i32 %5, %2
%7 = tail call i32 @ioctl(i32 %0, i32 %4, i32 %6)
ret i32 %7
}
/* Variables and functions */
int rom_present(char *);
int rt1000b_available(void) {
  return (
      rom_present(L"roms/scsi/ncr5380/Rancho_RT1000_RTBios_version_8.10R.bin"));
}


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

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

LLVM IR (-O0):
@.str = [57 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 115, i32 99, i32 115, i32 105, i32 47, i32 110, i32 99, i32 114, i32 53, i32 51, i32 56, i32 48, i32 47, i32 82, i32 97, i32 110, i32 99, i32 104, i32 111, i32 95, i32 82, i32 84, i32 49, i32 48, i32 48, i32 48, i32 95, i32 82, i32 84, i32 66, i32 105, i32 111, i32 115, i32 95, i32 118, i32 101, i32 114, i32 115, i32 105, i32 111, i32 110, i32 95, i32 56, i32 46, i32 49, i32 48, i32 82, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @rt1000b_available() {
%1 = call i32 @rom_present(i8* bitcast ([57 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [57 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 115, i32 99, i32 115, i32 105, i32 47, i32 110, i32 99, i32 114, i32 53, i32 51, i32 56, i32 48, i32 47, i32 82, i32 97, i32 110, i32 99, i32 104, i32 111, i32 95, i32 82, i32 84, i32 49, i32 48, i32 48, i32 48, i32 95, i32 82, i32 84, i32 66, i32 105, i32 111, i32 115, i32 95, i32 118, i32 101, i32 114, i32 115, i32 105, i32 111, i32 110, i32 95, i32 56, i32 46, i32 49, i32 48, i32 82, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @rt1000b_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([57 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
char *strdup(char *);
int sandbox_wakeup_daemon(char **errorbuf) {
  *errorbuf = strdup("Not implemented");
  return -1;
}


x86 assembly (clang, -O0):
<sandbox_wakeup_daemon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sandbox_wakeup_daemon>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,(%rbx)
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Not implemented\00"
define i32 @sandbox_wakeup_daemon(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i8* @strdup(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
store i8* %3, i8** %4
ret i32 -1
}

LLVM IR (-O2):
@.str = [16 x i8] c"Not implemented\00"
define i32 @sandbox_wakeup_daemon(i8** nocapture writeonly %0) {
%2 = tail call dereferenceable_or_null(16) i8* @strdup(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %0
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t const);
void *realloc(void *, size_t const);
int /*<<< orphan*/ stderr;
void *xrealloc(void *ptr, const size_t size) {
  void *result = realloc(ptr, size);
  if (!result) {
    fprintf(stderr, "No more memory available. Trying to allocate %zu bytes.",
            size);
    exit(1);
  }
  return result;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <xrealloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1140 <xrealloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"No more memory available. Trying to allocate %zu bytes.\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i64, i64* %4
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"No more memory available. Trying to allocate %zu bytes.\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i64 %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_AS;
int setrlimit(int /*<<< orphan*/, struct rlimit const *);
int teardown_rlimit(const struct rlimit *old_lim) {
  return setrlimit(RLIMIT_AS, old_lim);
}


x86 assembly (clang, -O0):
<teardown_rlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <setrlimit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<teardown_rlimit>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <setrlimit@plt>

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_AS = global i32 0
define i32 @teardown_rlimit(%struct.rlimit* %0) {
%2 = alloca %struct.rlimit*
store %struct.rlimit* %0, %struct.rlimit** %2
%3 = load i32, i32* @RLIMIT_AS
%4 = load %struct.rlimit*, %struct.rlimit** %2
%5 = call i32 @setrlimit(i32 %3, %struct.rlimit* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_AS = global i32 0
define i32 @teardown_rlimit(%struct.rlimit* %0) {
%2 = load i32, i32* @RLIMIT_AS
%3 = tail call i32 @setrlimit(i32 %2, %struct.rlimit* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ decimal__isDigitChar(char const);
int decimal__isDigitString(const char *str) {
  for (; *str; ++str) {
    if (!decimal__isDigitChar(*str)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<decimal__isDigitString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <decimal__isDigitString+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <decimal__isDigitChar@plt>
cmp    $0x0,%eax
jne    114a <decimal__isDigitString+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1167 <decimal__isDigitString+0x57>
jmp    114f <decimal__isDigitString+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <decimal__isDigitString+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal__isDigitString>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <decimal__isDigitString+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <decimal__isDigitChar@plt>
test   %eax,%eax
je     1149 <decimal__isDigitString+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <decimal__isDigitString+0x20>
jmp    114b <decimal__isDigitString+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @decimal__isDigitString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @decimal__isDigitChar(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
int f(int a) {
  return ((a > 0 ? a : -a) > 0 ? (a > 0 ? a : -a) : -(a > 0 ? a : -a));
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <f+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <f+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
jle    1158 <f+0x58>
cmpl   $0x0,-0x4(%rbp)
jle    1145 <f+0x45>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114d <f+0x4d>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    117f <f+0x7f>
cmpl   $0x0,-0x4(%rbp)
jle    116d <f+0x6d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1175 <f+0x75>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32, i32* %2
br label %21
18: ; preds = %13
%19 = load i32, i32* %2
%20 = sub nsw i32 0, %19
br label %21
21: ; preds = %18, %16
%22 = phi i32 [ %17, %16 ], [ %20, %18 ]
br label %34
23: ; preds = %10
%24 = load i32, i32* %2
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32, i32* %2
br label %31
28: ; preds = %23
%29 = load i32, i32* %2
%30 = sub nsw i32 0, %29
br label %31
31: ; preds = %28, %26
%32 = phi i32 [ %27, %26 ], [ %30, %28 ]
%33 = sub nsw i32 0, %32
br label %34
34: ; preds = %31, %21
%35 = phi i32 [ %22, %21 ], [ %33, %31 ]
ret i32 %35
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ srand(int);
void SetSeed(int seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<SetSeed>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @SetSeed(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
unsigned long http_parser_version(void) {
  return 2 * 0x10000 | 6 * 0x00100 | 1 * 0x00001;
}


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

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

LLVM IR (-O0):
define i64 @http_parser_version() {
ret i64 132609
}

LLVM IR (-O2):
define i64 @http_parser_version() {
ret i64 132609
}
int my_str_isupper(char *str) {
  int i;
  i = 0;
  while (str[i]) {
    if (str[i] < 'A' || str[i] > 'Z')
      return (0);
    ++i;
  }
  return (1);
}


x86 assembly (clang, -O0):
<my_str_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1165 <my_str_isupper+0x65>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
jl     114b <my_str_isupper+0x4b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5a,%eax
jle    1157 <my_str_isupper+0x57>
movl   $0x0,-0x4(%rbp)
jmp    116c <my_str_isupper+0x6c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <my_str_isupper+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_isupper>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <my_str_isupper+0x23>
add    $0x1,%rdi
nop
add    $0xa5,%cl
cmp    $0xe5,%cl
jbe    1124 <my_str_isupper+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <my_str_isupper+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_str_isupper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -91
%12 = icmp ult i8 %11, -26
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
long int toc_maximum(long int x, long int y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<toc_maximum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <toc_maximum+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <toc_maximum+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toc_maximum>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @toc_maximum(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
char const *hyerror_last_error_message();
const char *hysock_error_message() { return hyerror_last_error_message(); }


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

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

LLVM IR (-O0):
define i8* @hysock_error_message() {
%1 = call i8* (...) @hyerror_last_error_message()
ret i8* %1
}

LLVM IR (-O2):
define i8* @hysock_error_message() {
%1 = tail call i8* (...) @hyerror_last_error_message()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ geteuid();
int /*<<< orphan*/ printf(char *);
void rootCheck() {
  if (geteuid() != 0) {
    printf("Must run as root\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<rootCheck>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <geteuid@plt>
cmp    $0x0,%rax
je     115b <rootCheck+0x2b>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rootCheck>:
push   %rax
xor    %eax,%eax
call   1040 <geteuid@plt>
test   %rax,%rax
jne    113f <rootCheck+0xf>
pop    %rax
ret
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Must run as root\0A\00"
define void @rootCheck() {
%1 = call i64 (...) @geteuid()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 -1)
unreachable
6: ; preds = %0
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Must run as root\00"
define void @rootCheck() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
6: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() { puts("Hello world."); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct ruleset {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int parse_file(int /*<<< orphan*/ *, struct ruleset **);
int read_config(struct ruleset **ruleset, const char *conf) {
  FILE *fp = fopen(conf, "r");
  int res = parse_file(fp, ruleset);
  fclose(fp);
  return res;
}


x86 assembly (clang, -O0):
<read_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <parse_file@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_config>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rax
mov    %rdi,%r14
lea    0xebf(%rip),%rsi
mov    %rax,%rdi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <parse_file@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.ruleset = type { i32 }
@.str = [2 x i8] c"r\00"
define i32 @read_config(%struct.ruleset** %0, i8* %1) {
%3 = alloca %struct.ruleset**
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store %struct.ruleset** %0, %struct.ruleset*** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = load %struct.ruleset**, %struct.ruleset*** %3
%11 = call i32 @parse_file(i32* %9, %struct.ruleset** %10)
store i32 %11, i32* %6
%12 = load i32*, i32** %5
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
%struct.ruleset = type { i32 }
@.str = [2 x i8] c"r\00"
define i32 @read_config(%struct.ruleset** %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @parse_file(i32* %3, %struct.ruleset** %0)
%5 = tail call i32 @fclose(i32* %3)
ret i32 %4
}
unsigned char signed_int_to_unsigned_char(signed int src) { return src; }


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

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

LLVM IR (-O0):
define zeroext i8 @signed_int_to_unsigned_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @signed_int_to_unsigned_char(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
int periodic_wake_create_exist() {}


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

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

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

LLVM IR (-O2):
define i32 @periodic_wake_create_exist() {
ret i32 undef
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t __attribute__((no, noclone)) vec_while_int32_t(int32_t *restrict a) {
  for (int i = 0; i < 8; ++i)
    a[i] += 1;
}


x86 assembly (clang, -O0):
<vec_while_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1138 <vec_while_int32_t+0x38>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <vec_while_int32_t+0xf>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_while_int32_t>:
pcmpeqd %xmm0,%xmm0
movdqu (%rdi),%xmm1
movdqu 0x10(%rdi),%xmm2
psubd  %xmm0,%xmm1
movdqu %xmm1,(%rdi)
psubd  %xmm0,%xmm2
movdqu %xmm2,0x10(%rdi)
ret

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

LLVM IR (-O2):
define i32 @vec_while_int32_t(i32* noalias nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = add nsw <4 x i32> %3, <i32 1, i32 1, i32 1, i32 1>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
%8 = load <4 x i32>, <4 x i32>* %7
%9 = add nsw <4 x i32> %8, <i32 1, i32 1, i32 1, i32 1>
%10 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %9, <4 x i32>* %10
ret i32 undef
}
void i2d_ASN1_GENERALIZEDTIME(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_ASN1_GENERALIZEDTIME() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((constructor)) first(void) { printf("test\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"test\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @first, i8* null }]
define void @first() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @first, i8* null }]
@str = [5 x i8] c"test\00"
define void @first() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
int fun885() { return 885; }


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

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

LLVM IR (-O0):
define i32 @fun885() {
ret i32 885
}

LLVM IR (-O2):
define i32 @fun885() {
ret i32 885
}
void RB_Progress(void *pbUserData, unsigned long uPercent) {
  printf("%s: update %ld percent\n", __func__, uPercent);
}


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

x86 assembly (clang, -O2):
<RB_Progress>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rdi
lea    0xef7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"%s: update %ld percent\0A\00"
@__func__.RB_Progress = [12 x i8] c"RB_Progress\00"
define void @RB_Progress(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.RB_Progress, i64 0, i64 0), i64 %5)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s: update %ld percent\0A\00"
@__func__.RB_Progress = [12 x i8] c"RB_Progress\00"
define void @RB_Progress(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.RB_Progress, i64 0, i64 0), i64 %1)
ret void
}