xunge/DecIR huggingface dataset:
/* Variables and functions */
short read_ZIGBEE_short(int);
int /*<<< orphan*/ write_ZIGBEE_short(int, short);
void set_not_ACK() {
  short int temp = 0;
  temp = read_ZIGBEE_short(0x1B);
  temp = temp & (!0x04);
  write_ZIGBEE_short(0x1B, temp);
}


x86 assembly (clang, -O0):
<set_not_ACK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
mov    $0x1b,%edi
call   1030 <read_ZIGBEE_short@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
and    $0x0,%eax
mov    %ax,-0x2(%rbp)
mov    $0x1b,%edi
movswl -0x2(%rbp),%esi
call   1040 <write_ZIGBEE_short@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_not_ACK>:
push   %rax
mov    $0x1b,%edi
call   1030 <read_ZIGBEE_short@plt>
mov    $0x1b,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <write_ZIGBEE_short@plt>

LLVM IR (-O0):
define void @set_not_ACK() {
%1 = alloca i16
store i16 0, i16* %1
%2 = call signext i16 @read_ZIGBEE_short(i32 27)
store i16 %2, i16* %1
%3 = load i16, i16* %1
%4 = sext i16 %3 to i32
%5 = and i32 %4, 0
%6 = trunc i32 %5 to i16
store i16 %6, i16* %1
%7 = load i16, i16* %1
%8 = call i32 @write_ZIGBEE_short(i32 27, i16 signext %7)
ret void
}

LLVM IR (-O2):
define void @set_not_ACK() {
%1 = tail call signext i16 @read_ZIGBEE_short(i32 27)
%2 = tail call i32 @write_ZIGBEE_short(i32 27, i16 signext 0)
ret void
}
long lrint(double x) {
  long r;
  __asm__("fistpl %0" : "=m"(r) : "t"(x) : "st");
  return r;
}


x86 assembly (clang, -O0):
<lrint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
fistpl -0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrint>:
movsd  %xmm0,-0x10(%rsp)
fldl   -0x10(%rsp)
fistpl -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @lrint(double %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *, char *);
int /*<<< orphan*/ foo1();
int main(int argc, char **argv) {
  foo("192.168.1.1", "255.255.255.0");
  foo("192.168.2.1", "28");
  foo1();
  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)
lea    0xec3(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1030 <foo@plt>
lea    0xeca(%rip),%rdi
lea    0xecf(%rip),%rsi
call   1030 <foo@plt>
mov    $0x0,%al
call   1040 <foo1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedd(%rip),%rsi
call   1030 <foo@plt>
lea    0xedf(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <foo@plt>
xor    %eax,%eax
call   1040 <foo1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"192.168.1.1\00"
@.str.1 = [14 x i8] c"255.255.255.0\00"
@.str.2 = [12 x i8] c"192.168.2.1\00"
@.str.3 = [3 x i8] c"28\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 i32 @foo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @foo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (...) @foo1()
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"192.168.1.1\00"
@.str.1 = [14 x i8] c"255.255.255.0\00"
@.str.2 = [12 x i8] c"192.168.2.1\00"
@.str.3 = [3 x i8] c"28\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @foo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 (...) @foo1()
ret i32 0
}
int test23() {
  int i;
  switch (i) {
  case 0:
    return 0;
  case 2:
    return 2;
  }
}


x86 assembly (clang, -O0):
<test23>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1128 <test23+0x28>
jmp    1117 <test23+0x17>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1134 <test23+0x34>
jmp    113b <test23+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    113b <test23+0x3b>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test23() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 0, label %4
i32 2, label %5
]
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 2, i32* %1
br label %6
6: ; preds = %4, %5, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @test23() {
ret i32 0
}
void RefBNDecimateH1() {}


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

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

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

LLVM IR (-O2):
define void @RefBNDecimateH1() {
ret void
}
void TMR3SetWarpDrive(void) {}


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

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

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

LLVM IR (-O2):
define void @TMR3SetWarpDrive() {
ret void
}
int NumWei(int n) {
  int tmp = 0;
  while (n != 0) {
    tmp += n % 10;
    n /= 10;
  }
  return tmp;
}


x86 assembly (clang, -O0):
<NumWei>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <NumWei+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <NumWei+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumWei>:
xor    %eax,%eax
test   %edi,%edi
je     113b <NumWei+0x3b>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <NumWei+0x10>
ret

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

LLVM IR (-O2):
define i32 @NumWei(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = add nsw i32 %4, %6
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
char *fixup_url(char *url, char *tmp, int len) { return url; }


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

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

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

LLVM IR (-O2):
define i8* @fixup_url(i8* readnone returned %0, i8* nocapture readnone %1, i32 %2) {
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void writel(uint32_t value, void *ptr) {
  uint32_t *data = ptr;
  *data = value;
}


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writel>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @writel(i32 %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i32*
store i32 %0, i32* %3
ret void
}
int compare_ints(void *key_a, void *key_b) {
  int *int_a = (int *)key_a;
  int *int_b = (int *)key_b;
  return *int_a - *int_b;
}


x86 assembly (clang, -O0):
<compare_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compare_ints(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_ints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glutSolidSphere(double, int, int);
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glutSolidSphere(1.0, 25, 25);
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
movsd  0xead(%rip),%xmm0
mov    $0x19,%esi
mov    %esi,%edi
call   1050 <glutSolidSphere@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
movsd  0xeb0(%rip),%xmm0
mov    $0x19,%edi
mov    $0x19,%esi
call   1050 <glutSolidSphere@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 @glutSolidSphere(double 1.000000e+00, i32 25, i32 25)
%6 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 @glutSolidSphere(double 1.000000e+00, i32 25, i32 25)
%6 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xab() {
  Assert_real((islower(171) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              860, ("islower should be 0 for 0xab"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xab\00"
define void @t_islower_0xab() {
%1 = call i64 @islower(i32 171)
%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 860, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xab\00"
define void @t_islower_0xab() {
%1 = tail call i64 @islower(i32 171)
%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 860, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void _Jv_UnwrapJNIweakReference() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_UnwrapJNIweakReference() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_buffer_path_simplify();
int main() {
  test_buffer_path_simplify();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_buffer_path_simplify@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_buffer_path_simplify()
ret i32 0
}
int x0_process_syn(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x0_process_syn(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *strdup(char const *);
char *unescape_check_result_output(const char *rawbuf) {
  return strdup(rawbuf);
}


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

x86 assembly (clang, -O2):
<unescape_check_result_output>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @unescape_check_result_output(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
void i2d_OCSP_REVOKEDINFO(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_OCSP_REVOKEDINFO() {
ret void
}
void timer_init(double *v) { *v = 0; }


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

x86 assembly (clang, -O2):
<timer_init>:
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @timer_init(double* nocapture writeonly %0) {
store double 0.000000e+00, double* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
float float_from_i32(int /*<<< orphan*/);
int /*<<< orphan*/ i32_from_p24(int /*<<< orphan*/ const *);
float float_from_p24(const uint8_t *packed24) {
  return float_from_i32(i32_from_p24(packed24));
}


x86 assembly (clang, -O0):
<float_from_p24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <i32_from_p24@plt>
mov    %eax,%edi
call   1030 <float_from_i32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_from_p24>:
push   %rax
call   1040 <i32_from_p24@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <float_from_i32@plt>

LLVM IR (-O0):
define float @float_from_p24(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @i32_from_p24(i32* %3)
%5 = call float @float_from_i32(i32 %4)
ret float %5
}

LLVM IR (-O2):
define float @float_from_p24(i32* %0) {
%2 = tail call i32 @i32_from_p24(i32* %0)
%3 = tail call float @float_from_i32(i32 %2)
ret float %3
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ msg_exit(char *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *xstrndup(const char *s, size_t n) {
  char *cpy = malloc(n + 1);
  if (!cpy)
    msg_exit("out of memory");
  strncpy(cpy, s, n);
  cpy[n] = '\0';
  return cpy;
}


x86 assembly (clang, -O0):
<xstrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <xstrndup+0x38>
lea    0xe9d(%rip),%rdi
call   1040 <msg_exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1158 <xstrndup+0x28>
lea    0xead(%rip),%rdi
call   1040 <msg_exit@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @xstrndup(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 i64, i64* %4
%7 = add i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @msg_exit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = load i64, i64* %4
%17 = call i32 @strncpy(i8* %14, i8* %15, i64 %16)
%18 = load i8*, i8** %5
%19 = load i64, i64* %4
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 0, i8* %20
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @msg_exit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @strncpy(i8* %4, i8* %0, i64 %1)
%10 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %10
ret i8* %4
}
char *mystrcpy(char *dest, char *src) {
  char *p = src;
  char *q = dest;
  while (*p != '\0') {
    *q = *p;
    p++;
    q++;
  }
  *q = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<mystrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <mystrcpy+0x55>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <mystrcpy+0x1c>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <mystrcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <mystrcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @mystrcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t make_size_8(int x) { return (uint64_t)x; }


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

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

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

LLVM IR (-O2):
define i32 @make_size_8(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int, size_t);
void array_memset_stride(unsigned char *base, int nelems, size_t width,
                         size_t stride, int value) {
  while (nelems--) {
    memset(base, value, width);
    base += stride;
  }
}


x86 assembly (clang, -O0):
<array_memset_stride>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1160 <array_memset_stride+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112b <array_memset_stride+0x1b>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_memset_stride>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
je     1146 <array_memset_stride+0x36>
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%r12
mov    %esi,%ebx
mov    %rdi,%rbp
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %r12,%rdx
call   1030 <memset@plt>
add    %r15,%rbp
add    $0xffffffff,%ebx
jne    1130 <array_memset_stride+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @array_memset_stride(i8* %0, i32 %1, i64 %2, i64 %3, i32 %4) {
%6 = icmp eq i32 %1, 0
br i1 %6, label %14, label %7
7: ; preds = %5, %7
%8 = phi i8* [ %12, %7 ], [ %0, %5 ]
%9 = phi i32 [ %10, %7 ], [ %1, %5 ]
%10 = add nsw i32 %9, -1
%11 = tail call i32 @memset(i8* %8, i32 %4, i64 %2)
%12 = getelementptr inbounds i8, i8* %8, i64 %3
%13 = icmp eq i32 %10, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ system(char *);
void titre(const char *s) {
  system("clear");
  printf("\033[%sm", "34");
  printf("\t\t\t%s\n\n", s);
  printf("\033[%sm", "0");
}


x86 assembly (clang, -O0):
<titre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <system@plt>
lea    0xec7(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
lea    0xeae(%rip),%rsi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<titre>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
call   1030 <system@plt>
lea    0xecc(%rip),%r14
lea    0xecb(%rip),%rsi
mov    %r14,%rdi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xeb8(%rip),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [6 x i8] c"\1B[%sm\00"
@.str.2 = [3 x i8] c"34\00"
@.str.3 = [8 x i8] c"\09\09\09%s\0A\0A\00"
@.str.4 = [2 x i8] c"0\00"
define void @titre(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [6 x i8] c"\1B[%sm\00"
@.str.2 = [3 x i8] c"34\00"
@.str.3 = [8 x i8] c"\09\09\09%s\0A\0A\00"
@.str.4 = [2 x i8] c"0\00"
define void @titre(i8* %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}
void swap(int *left, int *right) {
  if (left != right) {
    *left ^= *right;
    *right ^= *left;
    *left ^= *right;
  }
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1144 <swap+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
cmp    %rsi,%rdi
je     1111 <swap+0x11>
mov    (%rdi),%eax
xor    (%rsi),%eax
mov    %eax,(%rdi)
xor    (%rsi),%eax
mov    %eax,(%rsi)
xor    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @swap(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 = icmp ne i32* %5, %6
br i1 %7, label %8, label %24
8: ; preds = %2
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = xor i32 %12, %10
store i32 %13, i32* %11
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = xor i32 %17, %15
store i32 %18, i32* %16
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = load i32*, i32** %3
%22 = load i32, i32* %21
%23 = xor i32 %22, %20
store i32 %23, i32* %21
br label %24
24: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @swap(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = load i32, i32* %0
%7 = xor i32 %6, %5
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = xor i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %0
%11 = xor i32 %10, %9
store i32 %11, i32* %0
br label %12
12: ; preds = %4, %2
ret void
}
long long int dist(long long int n) {
  long long int sol;
  if (n < 0) {
    return 0;
  } else
    sol = (((n + 3) * (n + 2) * (n + 1)) / 6);
  return sol;
}


x86 assembly (clang, -O0):
<dist>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1120 <dist+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1156 <dist+0x56>
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    -0x10(%rbp),%rcx
add    $0x2,%rcx
imul   %rcx,%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
mov    $0x6,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
test   %rdi,%rdi
js     1134 <dist+0x34>
lea    0x3(%rdi),%rax
lea    0x2(%rdi),%rcx
imul   %rcx,%rax
add    $0x1,%rdi
imul   %rax,%rdi
movabs $0x2aaaaaaaaaaaaaab,%rcx
aa aa 2a
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
add    %rdx,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @dist(i64 %0) {
%2 = icmp slt i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = add nuw nsw i64 %0, 3
%5 = add nuw nsw i64 %0, 2
%6 = mul nsw i64 %4, %5
%7 = add nuw nsw i64 %0, 1
%8 = mul nsw i64 %6, %7
%9 = sdiv i64 %8, 6
br label %10
10: ; preds = %1, %3
%11 = phi i64 [ %9, %3 ], [ 0, %1 ]
ret i64 %11
}
int msm_dts_eagle_init_pre(struct audio_client *ac) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.audio_client = type opaque
define i32 @msm_dts_eagle_init_pre(%struct.audio_client* nocapture readnone %0) {
ret i32 0
}
int ones_count(unsigned long value) {
  int count = 0;
  do {
    if (value & 1)
      count++;
    value >>= 1;
  } while (value != 0);
  return count;
}


x86 assembly (clang, -O0):
<ones_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     112a <ones_count+0x2a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    110f <ones_count+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ones_count>:
xor    %eax,%eax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <ones_count+0x10>
ret

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

LLVM IR (-O2):
define i32 @ones_count(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %8, %2 ]
%4 = phi i32 [ 0, %1 ], [ %7, %2 ]
%5 = trunc i64 %3 to i32
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %6, %4
%8 = lshr i64 %3, 1
%9 = icmp ult i64 %3, 2
br i1 %9, label %10, label %2
10: ; preds = %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ event_loopbreak();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ suspend_block(int);
void callback(int fd, short ev, void *data) {
  printf("Ping - got the event\n");
  suspend_block(-1);
  event_loopbreak();
}


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <suspend_block@plt>
mov    $0x0,%al
call   1050 <event_loopbreak@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <suspend_block@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <event_loopbreak@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Ping - got the event\0A\00"
define void @callback(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @suspend_block(i32 -1)
%9 = call i32 (...) @event_loopbreak()
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Ping - got the event\00"
define void @callback(i32 %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @suspend_block(i32 -1)
%6 = tail call i32 (...) @event_loopbreak()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void rm_all_inp(void) { system("rm -f in_*"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"rm -f in_*\00"
define void @rm_all_inp() {
%1 = call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"rm -f in_*\00"
define void @rm_all_inp() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
void set_power_led(int state) {}


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

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

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

LLVM IR (-O2):
define void @set_power_led(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<xfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @xfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
f() {
  extern int a;
  a -= 1;
  puts("a");
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    0x2ed1(%rip),%rax
addl   $0xffffffff,(%rax)
lea    0xedf(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@a = external global i32
@.str = [2 x i8] c"a\00"
define i32 @f() {
%1 = load i32, i32* @a
%2 = add nsw i32 %1, -1
store i32 %2, i32* @a
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
signed long zabs(signed long argx) {
  if (argx < 0) {
    return argx;
  } else {
    return -argx;
  }
}


x86 assembly (clang, -O0):
<zabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1120 <zabs+0x20>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112a <zabs+0x2a>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @zabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 false)
%3 = sub i64 0, %2
ret i64 %3
}
float test_expf(float x) { return __builtin_expf(x); }


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

x86 assembly (clang, -O2):
<test_expf>:
jmp    1030 <expf@plt>

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

LLVM IR (-O2):
define float @test_expf(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t ntohll(const uint64_t input) {
  uint64_t rval;
  uint8_t *data = (uint8_t *)&rval;
  data[0] = input >> 56;
  data[1] = input >> 48;
  data[2] = input >> 40;
  data[3] = input >> 32;
  data[4] = input >> 24;
  data[5] = input >> 16;
  data[6] = input >> 8;
  data[7] = input >> 0;
  return rval;
}


x86 assembly (clang, -O0):
<ntohll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x30,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%eax
mov    $0x28,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ntohll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
store i32* %3, i32** %4
%5 = load i32, i32* %2
%6 = ashr i32 %5, 56
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %2
%10 = ashr i32 %9, 48
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
%13 = load i32, i32* %2
%14 = ashr i32 %13, 40
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %14, i32* %16
%17 = load i32, i32* %2
%18 = ashr i32 %17, 32
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 3
store i32 %18, i32* %20
%21 = load i32, i32* %2
%22 = ashr i32 %21, 24
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i64 4
store i32 %22, i32* %24
%25 = load i32, i32* %2
%26 = ashr i32 %25, 16
%27 = load i32*, i32** %4
%28 = getelementptr inbounds i32, i32* %27, i64 5
store i32 %26, i32* %28
%29 = load i32, i32* %2
%30 = ashr i32 %29, 8
%31 = load i32*, i32** %4
%32 = getelementptr inbounds i32, i32* %31, i64 6
store i32 %30, i32* %32
%33 = load i32, i32* %2
%34 = ashr i32 %33, 0
%35 = load i32*, i32** %4
%36 = getelementptr inbounds i32, i32* %35, i64 7
store i32 %34, i32* %36
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @ntohll(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, unsigned short);
void vga_set_cursor(unsigned short row, unsigned short column) {
  unsigned short position = (row * 80) + column;
  outb(0x3D4, 0x0F);
  outb(0x3D5, position & 0xFF);
  outb(0x3D4, 0x0E);
  outb(0x3D5, (position >> 8) & 0x0F);
}


x86 assembly (clang, -O0):
<vga_set_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
imul   $0x50,%eax,%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x6(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzwl -0x6(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzwl %ax,%esi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzwl -0x6(%rbp),%eax
sar    $0x8,%eax
and    $0xf,%eax
mov    $0x3d5,%edi
movzwl %ax,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_set_cursor>:
push   %rbx
mov    %esi,%ebx
lea    (%rdi,%rdi,4),%eax
shl    $0x4,%eax
add    %eax,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
shr    $0x8,%ebx
and    $0xf,%ebx
mov    $0x3d5,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @vga_set_cursor(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = mul nsw i32 %7, 80
%9 = load i16, i16* %4
%10 = zext i16 %9 to i32
%11 = add nsw i32 %8, %10
%12 = trunc i32 %11 to i16
store i16 %12, i16* %5
%13 = call i32 @outb(i32 980, i16 zeroext 15)
%14 = load i16, i16* %5
%15 = zext i16 %14 to i32
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i16
%18 = call i32 @outb(i32 981, i16 zeroext %17)
%19 = call i32 @outb(i32 980, i16 zeroext 14)
%20 = load i16, i16* %5
%21 = zext i16 %20 to i32
%22 = ashr i32 %21, 8
%23 = and i32 %22, 15
%24 = trunc i32 %23 to i16
%25 = call i32 @outb(i32 981, i16 zeroext %24)
ret void
}

LLVM IR (-O2):
define void @vga_set_cursor(i16 zeroext %0, i16 zeroext %1) {
%3 = mul i16 %0, 80
%4 = add i16 %3, %1
%5 = tail call i32 @outb(i32 980, i16 zeroext 15)
%6 = and i16 %4, 255
%7 = tail call i32 @outb(i32 981, i16 zeroext %6)
%8 = tail call i32 @outb(i32 980, i16 zeroext 14)
%9 = lshr i16 %4, 8
%10 = and i16 %9, 15
%11 = tail call i32 @outb(i32 981, i16 zeroext %10)
ret void
}