xunge/DecIR huggingface dataset:
int GreaterOdd(int i) { return ((i)&1) ? i + 2 : i + 1; }


x86 assembly (clang, -O0):
<GreaterOdd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1124 <GreaterOdd+0x24>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <GreaterOdd+0x2d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GreaterOdd>:
mov    %edi,%eax
and    $0x1,%eax
cmp    $0x1,%eax
sbb    $0x0,%edi
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @GreaterOdd(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 1, i32 2
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ height;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int trap(int *, int);
int main(void) {
  int height[9] = {9, 2, 1, 1, 6, 4, 0, 4, 4};
  int area = trap(height, sizeof(height) / sizeof(height[0]));
  printf("%d\n", area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x9,%esi
call   1050 <trap@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <trap@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.height = [9 x i32] [i32 9, i32 2, i32 1, i32 1, i32 6, i32 4, i32 0, i32 4, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @trap(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
XDisableAccessControl() {}


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

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

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

LLVM IR (-O2):
define i32 @XDisableAccessControl() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int a;
  double b;
  printf("Podaj wartosc "
         "a"
         ": ");
  scanf("%"
        "i",
        &a);
  ;
  printf("Podaj wartosc "
         "b"
         ": ");
  scanf("%"
        "lf",
        &b);
  ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Podaj wartosc a: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [18 x i8] c"Podaj wartosc b: \00"
@.str.3 = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Podaj wartosc a: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [18 x i8] c"Podaj wartosc b: \00"
@.str.3 = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %2)
ret i32 0
}
int base64_bufsize(int binsize) {
  int datasize = binsize * 4 / 3 + 4;
  int newlines = ((datasize + 72 - 1) / 72);
  return datasize + newlines;
}


x86 assembly (clang, -O0):
<base64_bufsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x48,%eax
sub    $0x1,%eax
mov    $0x48,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_bufsize>:
shl    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
lea    (%rax,%rcx,1),%edx
add    %ecx,%eax
add    $0x4b,%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
add    %edx,%eax
add    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @base64_bufsize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 4
%7 = sdiv i32 %6, 3
%8 = add nsw i32 %7, 4
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 72
%11 = sub nsw i32 %10, 1
%12 = sdiv i32 %11, 72
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @base64_bufsize(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = add nsw i32 %3, 4
%5 = add nsw i32 %3, 75
%6 = sdiv i32 %5, 72
%7 = add nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int filesym(int /*<<< orphan*/);
int main(void) { return filesym(0); }


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

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

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

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

/* Variables and functions */
void set_type(uint32_t addr[8], uint32_t type) { addr[3] = type; }


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

x86 assembly (clang, -O2):
<set_type>:
mov    %esi,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @set_type(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %1, i32* %3
ret void
}
void unpack_one(long nfrequency, unsigned long packed, long digitized[]) {
  long i;
  for (i = 0; i < 8; i++)
    digitized[i] = 0;
  for (i = 5; i >= 2; i--) {
    digitized[i] = packed & 0xFF;
    packed /= 256;
  }
}


x86 assembly (clang, -O0):
<unpack_one>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x8,-0x20(%rbp)
jge    1144 <unpack_one+0x44>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <unpack_one+0x18>
movq   $0x5,-0x20(%rbp)
cmpq   $0x2,-0x20(%rbp)
jl     118b <unpack_one+0x8b>
mov    -0x10(%rbp),%rdx
and    $0xff,%rdx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    114c <unpack_one+0x4c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_one>:
mov    %rsi,%rax
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rdx)
movups %xmm0,0x10(%rdx)
movups %xmm0,0x30(%rdx)
movups %xmm0,(%rdx)
movzbl %al,%ecx
mov    %rcx,0x28(%rdx)
movzbl %ah,%ecx
mov    %rcx,0x20(%rdx)
mov    %eax,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %rcx,0x18(%rdx)
shr    $0x18,%eax
mov    %rax,0x10(%rdx)
ret

LLVM IR (-O0):
define void @unpack_one(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
store i64 0, i64* %7
br label %8
8: ; preds = %15, %3
%9 = load i64, i64* %7
%10 = icmp slt i64 %9, 8
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i64*, i64** %6
%13 = load i64, i64* %7
%14 = getelementptr inbounds i64, i64* %12, i64 %13
store i64 0, i64* %14
br label %15
15: ; preds = %11
%16 = load i64, i64* %7
%17 = add nsw i64 %16, 1
store i64 %17, i64* %7
br label %8
18: ; preds = %8
store i64 5, i64* %7
br label %19
19: ; preds = %30, %18
%20 = load i64, i64* %7
%21 = icmp sge i64 %20, 2
br i1 %21, label %22, label %33
22: ; preds = %19
%23 = load i64, i64* %5
%24 = and i64 %23, 255
%25 = load i64*, i64** %6
%26 = load i64, i64* %7
%27 = getelementptr inbounds i64, i64* %25, i64 %26
store i64 %24, i64* %27
%28 = load i64, i64* %5
%29 = udiv i64 %28, 256
store i64 %29, i64* %5
br label %30
30: ; preds = %22
%31 = load i64, i64* %7
%32 = add nsw i64 %31, -1
store i64 %32, i64* %7
br label %19
33: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @unpack_one(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = bitcast i64* %2 to i8*
%5 = and i64 %1, 255
%6 = getelementptr inbounds i64, i64* %2, i64 5
store i64 %5, i64* %6
%7 = lshr i64 %1, 8
%8 = and i64 %7, 255
%9 = getelementptr inbounds i64, i64* %2, i64 4
store i64 %8, i64* %9
%10 = lshr i64 %1, 16
%11 = and i64 %10, 255
%12 = getelementptr inbounds i64, i64* %2, i64 3
store i64 %11, i64* %12
%13 = lshr i64 %1, 24
%14 = and i64 %13, 255
%15 = getelementptr inbounds i64, i64* %2, i64 2
store i64 %14, i64* %15
ret void
}
int test_imm_1Eint32_reg(int val) { return ((val) & (0x1E << 0)) ? -20 : -40; }


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Eint32_reg(i32 %0) {
%2 = and i32 %0, 30
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef size_t uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ cpuid(size_t, int *);
bool has_feature(uint32_t level, uint32_t reg, int32_t bit) {
  int32_t cpu_info[4] = {0};
  cpuid(level, cpu_info);
  return (cpu_info[reg] & bit) != 0;
}


x86 assembly (clang, -O0):
<has_feature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <cpuid@plt>
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
and    -0x14(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_feature>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
call   1030 <cpuid@plt>
xor    %eax,%eax
and    (%rsp,%r14,4),%ebx
setne  %al
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @has_feature(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca [4 x i32]
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = bitcast [4 x i32]* %7 to i8*
%9 = load i64, i64* %4
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%11 = call i32 @cpuid(i64 %9, i32* %10)
%12 = load i64, i64* %5
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %6
%16 = and i32 %14, %15
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @has_feature(i64 %0, i64 %1, i32 %2) {
%4 = alloca [4 x i32]
%5 = bitcast [4 x i32]* %4 to i8*
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%7 = call i32 @cpuid(i64 %0, i32* %6)
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 %1
%9 = load i32, i32* %8
%10 = and i32 %9, %2
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
int *get_square_ref(int *number) {
  int *square_ptr, square;
  square = *number * *number;
  square_ptr = &square;
  return square_ptr;
}


x86 assembly (clang, -O0):
<get_square_ref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
imul   (%rcx),%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_square_ref>:
lea    -0x4(%rsp),%rax
ret

LLVM IR (-O0):
define i32* @get_square_ref(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = mul nsw i32 %6, %8
store i32 %9, i32* %4
store i32* %4, i32** %3
%10 = load i32*, i32** %3
ret i32* %10
}

LLVM IR (-O2):
define noalias i32* @get_square_ref(i32* nocapture %0) {
%2 = alloca i32
ret i32* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
int get_XMotionEvent_y(void *_p) { return (int)((XMotionEvent *)_p)->y; }


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

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

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

LLVM IR (-O2):
define i32 @get_XMotionEvent_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ set_ram_command(int);
void sdram_set_command_none(void) { set_ram_command(0x0); }


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

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

LLVM IR (-O0):
define void @sdram_set_command_none() {
%1 = call i32 @set_ram_command(i32 0)
ret void
}

LLVM IR (-O2):
define void @sdram_set_command_none() {
%1 = tail call i32 @set_ram_command(i32 0)
ret void
}
/* Type definitions */
struct ev_loop {
  int dummy;
};

/* Variables and functions */
struct ev_loop const *ev_default_loop_uc_();
int ev_is_default_loop(const struct ev_loop *loop) {
  return loop == ev_default_loop_uc_();
}


x86 assembly (clang, -O0):
<ev_is_default_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <ev_default_loop_uc_@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ev_is_default_loop>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <ev_default_loop_uc_@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ev_loop = type { i32 }
define i32 @ev_is_default_loop(%struct.ev_loop* %0) {
%2 = alloca %struct.ev_loop*
store %struct.ev_loop* %0, %struct.ev_loop** %2
%3 = load %struct.ev_loop*, %struct.ev_loop** %2
%4 = call %struct.ev_loop* (...) @ev_default_loop_uc_()
%5 = icmp eq %struct.ev_loop* %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.ev_loop = type { i32 }
define i32 @ev_is_default_loop(%struct.ev_loop* readnone %0) {
%2 = tail call %struct.ev_loop* (...) @ev_default_loop_uc_()
%3 = icmp eq %struct.ev_loop* %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
char ident(char x) { return x; }


x86 assembly (clang, -O0):
<ident>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @ident(i8 returned signext %0) {
ret i8 %0
}
void memcpy_to_eeprom_with_checksum(unsigned int destination, char *source,
                                    unsigned int size) {}


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

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

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

LLVM IR (-O2):
define void @memcpy_to_eeprom_with_checksum(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void del_elem(void *elem, size_t size) {
  (void)size;
  free(elem);
  elem = NULL;
}


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

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

LLVM IR (-O0):
define void @del_elem(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 = load i8*, i8** %3
%7 = call i32 @free(i8* %6)
store i8* null, i8** %3
ret void
}

LLVM IR (-O2):
define void @del_elem(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_return(int);
void zrtrue(void) { do_return(1); }


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

x86 assembly (clang, -O2):
<zrtrue>:
mov    $0x1,%edi
jmp    1030 <do_return@plt>

LLVM IR (-O0):
define void @zrtrue() {
%1 = call i32 @do_return(i32 1)
ret void
}

LLVM IR (-O2):
define void @zrtrue() {
%1 = tail call i32 @do_return(i32 1)
ret void
}
void g_slist_reverse() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_reverse() {
ret void
}
void f1(int *pppppp) { (*pppppp) = (*pppppp) * 2; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
shll   (%rdi)
ret

LLVM IR (-O0):
define void @f1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 2
%6 = load i32*, i32** %2
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @f1(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int getdate(int, int);
int /*<<< orphan*/ setmonth(int, int);
int date(int year, int month, int week, int wday) {
  setmonth(year, month);
  return (getdate(week, wday));
}


x86 assembly (clang, -O0):
<date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <setmonth@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <getdate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
call   1030 <setmonth@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <getdate@plt>

LLVM IR (-O0):
define i32 @date(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @setmonth(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @getdate(i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @date(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @setmonth(i32 %0, i32 %1)
%6 = tail call i32 @getdate(i32 %2, i32 %3)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_init(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void foo(void) {
  pthread_mutex_t mx;
  pthread_mutex_init(&mx, NULL);
  pthread_mutex_lock(&mx);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_mutex_init@plt>
lea    -0x4(%rbp),%rdi
call   1040 <pthread_mutex_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <pthread_mutex_init@plt>
mov    %rbx,%rdi
call   1040 <pthread_mutex_lock@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = call i32 @pthread_mutex_init(i32* %1, i32* null)
%3 = call i32 @pthread_mutex_lock(i32* %1)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pthread_mutex_init(i32* %1, i32* null)
%4 = call i32 @pthread_mutex_lock(i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_sub_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_sub_pi16(__m64 a, __m64 b) { return _mm_sub_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_sub_pi16>:
jmp    1030 <_mm_sub_pi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_sub_pi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sub_pi16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_char(void *d) { free(d); }


x86 assembly (clang, -O0):
<free_char>:
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):
<free_char>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_char(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 @free_char(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int ioctl(int, int, int);
int usbdev_ioctl_me_o(int fd, int test_num) {
  int cmd = 0;
  cmd = 1;
  return ioctl(fd, cmd, test_num);
}


x86 assembly (clang, -O0):
<usbdev_ioctl_me_o>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usbdev_ioctl_me_o>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <ioctl@plt>

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

LLVM IR (-O2):
define i32 @usbdev_ioctl_me_o(i32 %0, i32 %1) {
%3 = tail call i32 @ioctl(i32 %0, i32 1, i32 %1)
ret i32 %3
}
int foo(void) {}


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
void PCRandomize() {}


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

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

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

LLVM IR (-O2):
define void @PCRandomize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ inc(char *);
char *malloc(int);
void double_bad() {
  char *p = malloc(1);
  inc(p);
  inc(p);
  free(p);
  *p = 2;
}


x86 assembly (clang, -O0):
<double_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <inc@plt>
mov    -0x8(%rbp),%rdi
call   1050 <inc@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movb   $0x2,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_bad>:
push   %rbx
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <inc@plt>
mov    %rbx,%rdi
call   1050 <inc@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
movb   $0x2,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @double_bad() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @inc(i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @inc(i8* %5)
%7 = load i8*, i8** %1
%8 = call i32 @free(i8* %7)
%9 = load i8*, i8** %1
store i8 2, i8* %9
ret void
}

LLVM IR (-O2):
define void @double_bad() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%2 = tail call i32 @inc(i8* %1)
%3 = tail call i32 @inc(i8* %1)
%4 = tail call i32 @free(i8* %1)
store i8 2, i8* %1
ret void
}
int change_bit(int n, int v, int p) {
  if ((n >> p & 1) != v)
    n ^= 1 << p;
  return n;
}


x86 assembly (clang, -O0):
<change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    -0x8(%rbp),%eax
je     1131 <change_bit+0x31>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_bit>:
mov    %edx,%ecx
mov    %edi,%edx
shr    %cl,%edx
and    $0x1,%edx
mov    $0x1,%r8d
shl    %cl,%r8d
xor    %eax,%eax
cmp    %esi,%edx
cmovne %r8d,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @change_bit(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 = load i32, i32* %6
%9 = ashr i32 %7, %8
%10 = and i32 %9, 1
%11 = load i32, i32* %5
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i32, i32* %6
%15 = shl i32 1, %14
%16 = load i32, i32* %4
%17 = xor i32 %16, %15
store i32 %17, i32* %4
br label %18
18: ; preds = %13, %3
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @change_bit(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %0, %2
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, %1
%7 = shl nuw i32 1, %2
%8 = select i1 %6, i32 0, i32 %7
%9 = xor i32 %8, %0
ret i32 %9
}
double env_csv_execute(const struct XCSF *xcsf, const int action) {
  (void)xcsf;
  (void)action;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
define double @env_csv_execute(%struct.XCSF* %0, i32 %1) {
%3 = alloca %struct.XCSF*
%4 = alloca i32
store %struct.XCSF* %0, %struct.XCSF** %3
store i32 %1, i32* %4
%5 = load %struct.XCSF*, %struct.XCSF** %3
%6 = load i32, i32* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
%struct.XCSF = type opaque
define double @env_csv_execute(%struct.XCSF* nocapture readnone %0, i32 %1) {
ret double 0.000000e+00
}
void *kvm_getprocs(void *kd, int op, int arg, int *cnt) {
  if (cnt)
    *cnt = 0;
  return (0);
}


x86 assembly (clang, -O0):
<kvm_getprocs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1127 <kvm_getprocs+0x27>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvm_getprocs>:
test   %rcx,%rcx
je     110b <kvm_getprocs+0xb>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @kvm_getprocs(i8* nocapture readnone %0, i32 %1, i32 %2, i32* writeonly %3) {
%5 = icmp eq i32* %3, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 0, i32* %3
br label %7
7: ; preds = %6, %4
ret i8* null
}
/* Variables and functions */
double pow(double, double);
double qp2qscale(double qp) { return 0.85 * pow(2.0, (qp - 12.0) / 6.0); }


x86 assembly (clang, -O0):
<qp2qscale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xeee(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qp2qscale>:
push   %rax
addsd  0xee7(%rip),%xmm0
divsd  0xee7(%rip),%xmm0
call   1030 <exp2@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @qp2qscale(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.200000e+01
%5 = fdiv double %4, 6.000000e+00
%6 = call double @pow(double 2.000000e+00, double %5)
%7 = fmul double 8.500000e-01, %6
ret double %7
}

LLVM IR (-O2):
define double @qp2qscale(double %0) {
%2 = fadd double %0, -1.200000e+01
%3 = fdiv double %2, 6.000000e+00
%4 = tail call double @exp2(double %3)
%5 = fmul double %4, 8.500000e-01
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int reboot(int type) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<reboot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reboot>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @reboot(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
void *smalloc(size_t n) {
  void *p;
  p = malloc(n);
  assert(p != NULL);
  return (p);
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @smalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @smalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_get_binary_name_malloc() {
  printf("NOT IMPLEMENTED:"
         "pa_get_binary_name_malloc"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_get_binary_name_malloc\0A\00"
define i32 @pa_get_binary_name_malloc() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_get_binary_name_malloc\00"
define i32 @pa_get_binary_name_malloc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ r_cons_printf(char *, char const *, char const *);
int typelist(void *p, const char *k, const char *v) {
  r_cons_printf("tk %s = %s \n", k, v);
  return 1;
}


x86 assembly (clang, -O0):
<typelist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xecd(%rip),%rdi
call   1030 <r_cons_printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<typelist>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <r_cons_printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"tk %s = %s \0A\00"
define i32 @typelist(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = call i32 @r_cons_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"tk %s = %s \0A\00"
define i32 @typelist(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = tail call i32 @r_cons_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i32 1
}
/* Type definitions */
struct timeval {
  float tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
float tv2s(struct timeval tv) {
  return (float)tv.tv_usec / 1000000 + tv.tv_sec;
}


x86 assembly (clang, -O0):
<tv2s>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x10(%rbp)
mov    %rdi,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xee5(%rip),%xmm1
divss  %xmm1,%xmm0
addss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tv2s>:
cvtsi2ss %rdi,%xmm1
divss  0xef3(%rip),%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { float, i64 }
define float @tv2s(float %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to { float, i64 }*
%5 = getelementptr inbounds { float, i64 }, { float, i64 }* %4, i32 0, i32 0
store float %0, float* %5
%6 = getelementptr inbounds { float, i64 }, { float, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to float
%10 = fdiv float %9, 1.000000e+06
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%12 = load float, float* %11
%13 = fadd float %10, %12
ret float %13
}

LLVM IR (-O2):
define float @tv2s(float %0, i64 %1) {
%3 = sitofp i64 %1 to float
%4 = fdiv float %3, 1.000000e+06
%5 = fadd float %4, %0
ret float %5
}
/* Variables and functions */
int binary_search(int *, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n;
  if (n <= 0)
    return 1;
  int a[n];
  int x;
  int result = binary_search(a, n, x);
  printf("result = %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1145 <main+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1193 <main+0x73>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1040 <binary_search@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
double Av2Position(const double Av, const double dens, const double Z) {
  return Av / (5.34e-22 * Z * dens);
}


x86 assembly (clang, -O0):
<Av2Position>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Av2Position>:
mulsd  0xef8(%rip),%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @Av2Position(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = fmul double 5.340000e-22, %8
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = fdiv double %7, %11
ret double %12
}

LLVM IR (-O2):
define double @Av2Position(double %0, double %1, double %2) {
%4 = fmul double %2, 5.340000e-22
%5 = fmul double %4, %1
%6 = fdiv double %0, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ isinf(double);
scalar_t__ isnan(double);
void fpcheck_c_(double *a, int *flag) { *flag = isnan(*a) && !isinf(*a); }


x86 assembly (clang, -O0):
<fpcheck_c_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1167 <fpcheck_c_+0x47>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <isinf@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpcheck_c_>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
call   1030 <isnan@plt>
test   %rax,%rax
je     114a <fpcheck_c_+0x2a>
movsd  (%rbx),%xmm0
call   1040 <isinf@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
jmp    114c <fpcheck_c_+0x2c>
xor    %ecx,%ecx
mov    %ecx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @fpcheck_c_(double* %0, i32* %1) {
%3 = alloca double*
%4 = alloca i32*
store double* %0, double** %3
store i32* %1, i32** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = call i64 @isnan(double %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load double*, double** %3
%11 = load double, double* %10
%12 = call i32 @isinf(double %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %9, %2
%16 = phi i1 [ false, %2 ], [ %14, %9 ]
%17 = zext i1 %16 to i32
%18 = load i32*, i32** %4
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @fpcheck_c_(double* nocapture %0, i32* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = tail call i64 @isnan(double %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = load double, double* %0
%8 = tail call i32 @isinf(double %7)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ 0, %2 ], [ %10, %6 ]
store i32 %12, i32* %1
ret void
}
int itoa_recursion(char string[], int element, int number) {
  if (number / 10)
    element = itoa_recursion(string, element, number / 10);
  string[element] = number % 10 + '0';
  return element + 1;
}


x86 assembly (clang, -O0):
<itoa_recursion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     1152 <itoa_recursion+0x42>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <itoa_recursion@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa_recursion>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x9(%rdx),%eax
movslq %edx,%rbx
cmp    $0x13,%eax
jb     1140 <itoa_recursion+0x30>
imul   $0x66666667,%rbx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x22,%rdx
add    %eax,%edx
mov    %r14,%rdi
call   1030 <itoa_recursion@plt>
mov    %eax,%esi
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
add    $0x30,%bl
movslq %esi,%rax
mov    %bl,(%r14,%rax,1)
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @itoa_recursion(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = add i32 %2, 9
%5 = icmp ult i32 %4, 19
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = sdiv i32 %2, 10
%8 = tail call i32 @itoa_recursion(i8* %0, i32 %1, i32 %7)
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ %8, %6 ], [ %1, %3 ]
%11 = srem i32 %2, 10
%12 = trunc i32 %11 to i8
%13 = add nsw i8 %12, 48
%14 = sext i32 %10 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 %13, i8* %15
%16 = add nsw i32 %10, 1
ret i32 %16
}
int listen_init(struct listen *f) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.listen = type opaque
define i32 @listen_init(%struct.listen* nocapture readnone %0) {
ret i32 1
}
void INT_Excep_MTU9_TGID9(void) {}


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

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

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

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