xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *);
void fig08_32() {
  char string1[15] = "BBBBBBBBBBBBBB";
  printf("string1 = %s\n", string1);
  printf("string1 after memset = %s\n", (char *)memset(string1, 'b', 7));
}


x86 assembly (clang, -O0):
<fig08_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec1(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xf(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
lea    -0xf(%rbp),%rdi
mov    $0x62,%esi
mov    $0x7,%edx
call   1040 <memset@plt>
mov    %rax,%rsi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig08_32>:
push   %rbx
sub    $0x10,%rsp
movabs $0x42424242424242,%rax
mov    %rax,0x7(%rsp)
movabs $0x4242424242424242,%rax
42 42 42
mov    %rax,(%rsp)
lea    0xec6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x62,%esi
mov    $0x7,%edx
call   1040 <memset@plt>
lea    0xeb0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.fig08_32.string1 = [15 x i8] c"BBBBBBBBBBBBBB\00"
@.str = [14 x i8] c"string1 = %s\0A\00"
@.str.1 = [27 x i8] c"string1 after memset = %s\0A\00"
define void @fig08_32() {
%1 = alloca [15 x i8]
%2 = bitcast [15 x i8]* %1 to i8*
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%6 = call i64 @memset(i8* %5, i8 signext 98, i32 7)
%7 = inttoptr i64 %6 to i8*
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@__const.fig08_32.string1 = [15 x i8] c"BBBBBBBBBBBBBB\00"
@.str = [14 x i8] c"string1 = %s\0A\00"
@.str.1 = [27 x i8] c"string1 after memset = %s\0A\00"
define void @fig08_32() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @memset(i8* %2, i8 signext 98, i32 7)
%5 = inttoptr i64 %4 to i8*
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
int ig_indirect_table_get(unsigned int, int /*<<< orphan*/, unsigned int, int,
                          unsigned int *);
int ig_ctl_filt_table_get(unsigned int dev_id, unsigned int index,
                          unsigned int *pentry) {
  if ((index < 0) || (index > 23)) {
    return -1;
  }
  return ig_indirect_table_get(dev_id, 0, index, 3, pentry);
}


x86 assembly (clang, -O0):
<ig_ctl_filt_table_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jb     1136 <ig_ctl_filt_table_get+0x26>
cmpl   $0x17,-0xc(%rbp)
jbe    1142 <ig_ctl_filt_table_get+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <ig_ctl_filt_table_get+0x4b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
xor    %esi,%esi
mov    $0x3,%ecx
call   1030 <ig_indirect_table_get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ig_ctl_filt_table_get>:
cmp    $0x17,%esi
jbe    111b <ig_ctl_filt_table_get+0xb>
mov    $0xffffffff,%eax
ret
mov    %rdx,%r8
mov    %esi,%edx
xor    %esi,%esi
mov    $0x3,%ecx
jmp    1030 <ig_indirect_table_get@plt>

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

LLVM IR (-O2):
define i32 @ig_ctl_filt_table_get(i32 %0, i32 %1, i32* %2) {
%4 = icmp ugt i32 %1, 23
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @ig_indirect_table_get(i32 %0, i32 0, i32 %1, i32 3, i32* %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
void mask_write(unsigned long add, unsigned long mask, unsigned long val) {
  volatile unsigned long *addr = (volatile unsigned long *)add;
  *addr = (val & mask) | (*addr & ~mask);
}


x86 assembly (clang, -O0):
<mask_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
and    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
and    %rdx,%rax
or     %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_write>:
mov    (%rdi),%rax
xor    %rax,%rdx
and    %rsi,%rdx
xor    %rax,%rdx
mov    %rdx,(%rdi)
ret

LLVM IR (-O0):
define void @mask_write(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
%8 = load i64, i64* %4
%9 = inttoptr i64 %8 to i64*
store i64* %9, i64** %7
%10 = load i64, i64* %6
%11 = load i64, i64* %5
%12 = and i64 %10, %11
%13 = load i64*, i64** %7
%14 = load volatile i64, i64* %13
%15 = load i64, i64* %5
%16 = xor i64 %15, -1
%17 = and i64 %14, %16
%18 = or i64 %12, %17
%19 = load i64*, i64** %7
store volatile i64 %18, i64* %19
ret void
}

LLVM IR (-O2):
define void @mask_write(i64 %0, i64 %1, i64 %2) {
%4 = inttoptr i64 %0 to i64*
%5 = and i64 %2, %1
%6 = load volatile i64, i64* %4
%7 = xor i64 %1, -1
%8 = and i64 %6, %7
%9 = or i64 %8, %5
store volatile i64 %9, i64* %4
ret void
}
/* Variables and functions */
scalar_t__ rnd(int);
unsigned long roll(int number, int sides) {
  unsigned long total = 0;
  while (number--)
    total += rnd(sides) + 1;
  return total;
}


x86 assembly (clang, -O0):
<roll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1153 <roll+0x43>
mov    -0x8(%rbp),%edi
call   1030 <rnd@plt>
add    $0x1,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1126 <roll+0x16>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     1136 <roll+0x26>
mov    %esi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
nop
mov    %r14d,%edi
call   1030 <rnd@plt>
add    %rax,%rbx
add    $0x1,%rbx
add    $0xffffffff,%ebp
jne    1120 <roll+0x10>
jmp    1138 <roll+0x28>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @roll(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %6, -1
%8 = tail call i64 @rnd(i32 %1)
%9 = add i64 %5, 1
%10 = add i64 %9, %8
%11 = icmp eq i32 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i64 [ 0, %2 ], [ %10, %4 ]
ret i64 %13
}
int is_avx_supported(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @is_avx_supported() {
ret i32 1
}

LLVM IR (-O2):
define i32 @is_avx_supported() {
ret i32 1
}
/* Variables and functions */
scalar_t__ init_test();
scalar_t__ measure_clocks();
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (init_test() != 0) {
    printf("init_test");
    return -1;
  }
  if (measure_clocks() != 0) {
    printf("measure_clocks");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <init_test@plt>
cmp    $0x0,%rax
je     1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1198 <main+0x68>
mov    $0x0,%al
call   1050 <measure_clocks@plt>
cmp    $0x0,%rax
je     1191 <main+0x61>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1198 <main+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <init_test@plt>
test   %rax,%rax
je     1148 <main+0x18>
lea    0xeba(%rip),%rdi
jmp    115b <main+0x2b>
xor    %eax,%eax
call   1050 <measure_clocks@plt>
test   %rax,%rax
je     1165 <main+0x35>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"init_test\00"
@.str.1 = [15 x i8] c"measure_clocks\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @init_test()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %12
6: ; preds = %0
%7 = call i64 (...) @measure_clocks()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %12
11: ; preds = %6
store i32 0, i32* %1
br label %12
12: ; preds = %11, %9, %4
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [10 x i8] c"init_test\00"
@.str.1 = [15 x i8] c"measure_clocks\00"
define i32 @main() {
%1 = tail call i64 (...) @init_test()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 (...) @measure_clocks()
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3, %0
%7 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), %3 ]
%8 = tail call i32 @printf(i8* dereferenceable(1) %7)
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ 0, %3 ], [ -1, %6 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ pow(int, int);
int int_pow(int x, int y) {
  int num = (int)pow(x, y);
  return num;
}


x86 assembly (clang, -O0):
<int_pow>:
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 <pow@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_pow>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define i32 @int_pow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i64 @pow(i32 %6, i32 %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @int_pow(i32 %0, i32 %1) {
%3 = tail call i64 @pow(i32 %0, i32 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
int inl(short port) {
  int res;
  __asm__("inl %%dx,%%eax" : "=a"(res) : "d"(port));
  return res;
}


x86 assembly (clang, -O0):
<inl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl>:
mov    %edi,%edx
in     (%dx),%eax
ret

LLVM IR (-O0):
define i32 @inl(i16 signext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 asm "inl %dx,%eax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @inl(i16 signext %0) {
%2 = tail call i32 asm "inl %dx,%eax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i32 %2
}
int f(int n, int c, int s) {
  int a2, a3, a4, x1, x2, x3, x4;
  x1 = c + s;
  x2 = x3 = x4 = c;
  if (n > 64) {
    a2 = 2 * s;
    x2 = c + a2;
    a3 = 3 * s;
    x3 = c + a3;
  } else {
    a4 = 2 * s;
    x4 = c + a4;
  }
  return x1 + x2 + x3 + x4;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    %eax,-0x24(%rbp)
mov    %eax,-0x20(%rbp)
cmpl   $0x40,-0x4(%rbp)
jle    1153 <f+0x53>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
imul   $0x3,-0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1165 <f+0x65>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %r8d,%r8d
cmp    $0x41,%edi
lea    (%rsi,%rdx,2),%edi
lea    (%rdx,%rdx,2),%ecx
mov    %esi,%eax
cmovge %edi,%eax
cmovl  %r8d,%ecx
cmovge %esi,%edi
add    %esi,%ecx
add    %esi,%edx
add    %edx,%eax
add    %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 64
%5 = shl nsw i32 %2, 1
%6 = add nsw i32 %5, %1
%7 = mul nsw i32 %2, 3
%8 = select i1 %4, i32 %6, i32 %1
%9 = select i1 %4, i32 %7, i32 0
%10 = add nsw i32 %9, %1
%11 = select i1 %4, i32 %1, i32 %6
%12 = add nsw i32 %2, %1
%13 = add nsw i32 %12, %8
%14 = add nsw i32 %13, %10
%15 = add nsw i32 %14, %11
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ DAC_ADC_init();
void DACInic(void) { DAC_ADC_init(); }


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

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

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

LLVM IR (-O2):
define void @DACInic() {
%1 = tail call i32 (...) @DAC_ADC_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RateTorqueKFHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void RateTorqueKFRequestUpdate() { UAVObjRequestUpdate(RateTorqueKFHandle()); }


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

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

LLVM IR (-O0):
define void @RateTorqueKFRequestUpdate() {
%1 = call i32 (...) @RateTorqueKFHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @RateTorqueKFRequestUpdate() {
%1 = tail call i32 (...) @RateTorqueKFHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
void setval_410(unsigned *p) { *p = 3531919625U; }


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

x86 assembly (clang, -O2):
<setval_410>:
movl   $0xd284d109,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_410(i32* nocapture writeonly %0) {
store i32 -763047671, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int file_exists(char *path) {
  int fd;
  fd = open(path, O_RDONLY);
  close(fd);
  if (fd < 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
cmpl   $0x0,-0x14(%rbp)
jge    115f <file_exists+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1166 <file_exists+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <close@plt>
shr    $0x1f,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @file_exists(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = tail call i32 @close(i32 %3)
%5 = lshr i32 %3, 31
ret i32 %5
}
int test_imm_3Eint8_mem(signed char *val) {
  return ((*val) & (0x3E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Eint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 62
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *application_title_string(char *);
char *application_title(char *application_string) {
  return application_title_string(application_string);
}


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

x86 assembly (clang, -O2):
<application_title>:
jmp    1030 <application_title_string@plt>

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

LLVM IR (-O2):
define i8* @application_title(i8* %0) {
%2 = tail call i8* @application_title_string(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void die(const char *message) {
  if (errno)
    perror(message);
  else
    fprintf(stderr, "ERROR: %s.\n", message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
cmpq   $0x0,(%rax)
je     115b <die+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    1174 <die+0x44>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     1157 <die+0x27>
mov    %rdx,%rdi
call   1040 <perror@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1149 <die+0x19>

LLVM IR (-O0):
@errno = global i64 0
@stderr = global i32 0
@.str = [12 x i8] c"ERROR: %s.\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %5
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@stderr = global i32 0
@.str = [12 x i8] c"ERROR: %s.\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %9
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %6, %4
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
}
/* Type definitions */
struct mq_attr {
  int dummy;
};
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int mq_setattr(mqd_t mqdes, const struct mq_attr *__restrict mqstat,
               struct mq_attr *__restrict omqstat) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<mq_setattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_setattr>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mq_attr = type { i32 }
@ENOSYS = global i32 0
define i32 @mq_setattr(i32 %0, %struct.mq_attr* noalias %1, %struct.mq_attr* noalias %2) {
%4 = alloca i32
%5 = alloca %struct.mq_attr*
%6 = alloca %struct.mq_attr*
store i32 %0, i32* %4
store %struct.mq_attr* %1, %struct.mq_attr** %5
store %struct.mq_attr* %2, %struct.mq_attr** %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
%struct.mq_attr = type { i32 }
@ENOSYS = global i32 0
define i32 @mq_setattr(i32 %0, %struct.mq_attr* noalias nocapture readnone %1, %struct.mq_attr* noalias nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Variables and functions */
int _toupper(int);
int toupper(int c) {
  if (c < 'a' || c > 'z')
    return c;
  return _toupper(c);
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112f <toupper+0x1f>
cmpl   $0x7a,-0x8(%rbp)
jle    113a <toupper+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <toupper+0x35>
mov    -0x8(%rbp),%edi
call   1030 <_toupper@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x7b(%rdi),%eax
cmp    $0xffffffe6,%eax
jae    111b <toupper+0xb>
mov    %edi,%eax
ret
jmp    1030 <_toupper@plt>

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 97
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 122
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %14
11: ; preds = %6
%12 = load i32, i32* %3
%13 = call i32 @_toupper(i32 %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -123
%3 = icmp ult i32 %2, -26
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @_toupper(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
void ARGBToRAWRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRAWRow_Any_AVX2() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ putc(int);
void putlu(uint64_t num) {
  if (num == 0)
    putc('0');
  else {
    if (num >= 10)
      putlu(num / 10);
    putc('0' + num % 10);
  }
}


x86 assembly (clang, -O0):
<putlu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1144 <putlu+0x24>
mov    $0x30,%edi
call   1040 <putc@plt>
jmp    1175 <putlu+0x55>
cmpl   $0xa,-0x4(%rbp)
jl     1160 <putlu+0x40>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <putlu@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1040 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putlu>:
test   %edi,%edi
je     116a <putlu+0x4a>
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jl     1140 <putlu+0x20>
mov    %ebx,%eax
mov    $0xcccccccd,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
call   1030 <putlu@plt>
movslq %ebx,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
lea    (%rbx,%rax,1),%edi
add    $0x30,%edi
pop    %rbx
jmp    1040 <putc@plt>
mov    $0x30,%edi
jmp    1040 <putc@plt>

LLVM IR (-O0):
define void @putlu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @putc(i32 48)
br label %18
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sge i32 %8, 10
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 10
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %2
%15 = srem i32 %14, 10
%16 = add nsw i32 48, %15
%17 = call i32 @putc(i32 %16)
br label %18
18: ; preds = %13, %5
ret void
}

LLVM IR (-O2):
define void @putlu(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 9
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = udiv i32 %0, 10
tail call void @putlu(i32 %6)
br label %7
7: ; preds = %5, %3
%8 = srem i32 %0, 10
%9 = add nsw i32 %8, 48
br label %10
10: ; preds = %1, %7
%11 = phi i32 [ %9, %7 ], [ 48, %1 ]
%12 = tail call i32 @putc(i32 %11)
ret void
}
/* Type definitions */
union i2c_smbus_data {
  int /*<<< orphan*/ word;
};
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u16;
typedef int /*<<< orphan*/ __s32;

/* Variables and functions */
int /*<<< orphan*/ I2C_SMBUS_WORD_DATA;
int /*<<< orphan*/ I2C_SMBUS_WRITE;
int /*<<< orphan*/ i2c_smbus_access(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, union i2c_smbus_data *);
extern __s32 i2c_smbus_write_word_data(int file, __u8 command, __u16 value) {
  union i2c_smbus_data data;
  data.word = value;
  return i2c_smbus_access(file, I2C_SMBUS_WRITE, command, I2C_SMBUS_WORD_DATA,
                          &data);
}


x86 assembly (clang, -O0):
<i2c_smbus_write_word_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2eab(%rip),%rax
mov    (%rax),%ecx
lea    -0x10(%rbp),%r8
call   1030 <i2c_smbus_access@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_smbus_write_word_data>:
push   %rax
mov    %esi,%eax
mov    %edx,(%rsp)
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%esi
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%ecx
mov    %rsp,%r8
mov    %eax,%edx
call   1030 <i2c_smbus_access@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_WRITE = global i32 0
@I2C_SMBUS_WORD_DATA = global i32 0
define i32 @i2c_smbus_write_word_data(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %union.i2c_smbus_data
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = bitcast %union.i2c_smbus_data* %7 to i32*
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = load i32, i32* @I2C_SMBUS_WRITE
%12 = load i32, i32* %5
%13 = load i32, i32* @I2C_SMBUS_WORD_DATA
%14 = call i32 @i2c_smbus_access(i32 %10, i32 %11, i32 %12, i32 %13, %union.i2c_smbus_data* %7)
ret i32 %14
}

LLVM IR (-O2):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_WRITE = global i32 0
@I2C_SMBUS_WORD_DATA = global i32 0
define i32 @i2c_smbus_write_word_data(i32 %0, i32 %1, i32 %2) {
%4 = alloca %union.i2c_smbus_data
%5 = bitcast %union.i2c_smbus_data* %4 to i8*
%6 = getelementptr inbounds %union.i2c_smbus_data, %union.i2c_smbus_data* %4, i64 0, i32 0
store i32 %2, i32* %6
%7 = load i32, i32* @I2C_SMBUS_WRITE
%8 = load i32, i32* @I2C_SMBUS_WORD_DATA
%9 = call i32 @i2c_smbus_access(i32 %0, i32 %7, i32 %1, i32 %8, %union.i2c_smbus_data* %4)
ret i32 %9
}
/* Variables and functions */
double sin(double);
double sqrt(double);
double denom(double es, double sphi) {
  double sinSphi = sin(sphi);
  return sqrt(1.0 - es * (sinSphi * sinSphi));
}


x86 assembly (clang, -O0):
<denom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe8d(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<denom>:
push   %rax
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
call   1030 <sin@plt>
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  (%rsp),%xmm1
movsd  0xebc(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1158 <denom+0x38>
sqrtsd %xmm0,%xmm0
pop    %rax
ret
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @denom(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = call double @sin(double %6)
store double %7, double* %5
%8 = load double, double* %3
%9 = load double, double* %5
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = fneg double %8
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double 1.000000e+00)
%14 = call double @sqrt(double %13)
ret double %14
}

LLVM IR (-O2):
define double @denom(double %0, double %1) {
%3 = tail call double @sin(double %1)
%4 = fmul double %3, %3
%5 = fneg double %0
%6 = tail call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = tail call double @sqrt(double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void C1Mod1Function2() {
  printf("Expected message: C1Mod1Function2.\n");
}


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

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

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

LLVM IR (-O2):
@str = [35 x i8] c"Expected message: C1Mod1Function2.\00"
define void @C1Mod1Function2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fn_sq_ch_73_ch_109_ch_112_ch_111_ch_114_ch_116(char const *);
int fn_al_sq_ch_73_ch_109_ch_112_ch_111_ch_114_ch_116(const char *text) {
  int pos = 0;
  pos = fn_sq_ch_73_ch_109_ch_112_ch_111_ch_114_ch_116(text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_73_ch_109_ch_112_ch_111_ch_114_ch_116>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_73_ch_109_ch_112_ch_111_ch_114_ch_116@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_73_ch_109_ch_112_ch_111_ch_114_ch_116+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_73_ch_109_ch_112_ch_111_ch_114_ch_116+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_73_ch_109_ch_112_ch_111_ch_114_ch_116>:
jmp    1030 <fn_sq_ch_73_ch_109_ch_112_ch_111_ch_114_ch_116@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_73_ch_109_ch_112_ch_111_ch_114_ch_116(i8* %0) {
%2 = tail call i32 @fn_sq_ch_73_ch_109_ch_112_ch_111_ch_114_ch_116(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bef_push(int);
int ins_nm5() {
  bef_push(5);
  return 1;
}


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

x86 assembly (clang, -O2):
<ins_nm5>:
push   %rax
mov    $0x5,%edi
call   1030 <bef_push@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ins_nm5() {
%1 = call i32 @bef_push(i32 5)
ret i32 1
}

LLVM IR (-O2):
define i32 @ins_nm5() {
%1 = tail call i32 @bef_push(i32 5)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void write_wrap(char **buf) { write(1, *buf, 8); }


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

x86 assembly (clang, -O2):
<write_wrap>:
mov    (%rdi),%rsi
mov    $0x1,%edi
mov    $0x8,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @write_wrap(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @write(i32 1, i8* %4, i32 8)
ret void
}

LLVM IR (-O2):
define void @write_wrap(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @write(i32 1, i8* %2, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int A, B;
  scanf("%d %d", &A, &B);
  printf("A=%d\nB=%d\nA+B=%d\n", A, B, A + B);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    (%rdx,%rsi,1),%ecx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [18 x i8] c"A=%d\0AB=%d\0AA+B=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}
int isatty(fd)
int fd;
{ return (1); }


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

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

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

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
ret i32 1
}
/* Variables and functions */
size_t strlen(const char *string) {
  size_t count = 0;
  while (string[count] != 0) {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
double do_fsincos(void) {
  double res = 0.0;
  __asm__ __volatile__("fldln2\n\t"
                       "fsincos\n\t"
                       "fsub %%st(1)\n\t"
                       "fstpl 0(%0)"
                       :
                       : "r"(&res));
  return res;
}


x86 assembly (clang, -O0):
<do_fsincos>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
fldln2
fsincos
fsub   %st(1),%st
fstpl  (%rax)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_fsincos>:
movq   $0x0,-0x8(%rsp)
lea    -0x8(%rsp),%rax
fldln2
fsincos
fsub   %st(1),%st
fstpl  (%rax)
movsd  -0x8(%rsp),%xmm0
ret

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

LLVM IR (-O2):
define double @do_fsincos() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = load double, double* %1
ret double %3
}
void ff_hevc_put_hevc_uni_epel_h4_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h4_10_sse4() {
ret void
}
int guppy_fcndef_post_setup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @guppy_fcndef_post_setup() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DrawText124(char const *, unsigned long);
void drawtext(const char *s, unsigned long cfg) { DrawText124(s, cfg); }


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

x86 assembly (clang, -O2):
<drawtext>:
jmp    1030 <DrawText124@plt>

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

LLVM IR (-O2):
define void @drawtext(i8* %0, i64 %1) {
%3 = tail call i32 @DrawText124(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int getDoomsday(int);
int getMonthAnchorDay(int, int);
int getDayOfWeek(int day, int month, int year) {
  int difference = day - getMonthAnchorDay(month, year);
  int dayOfWeek = (getDoomsday(year) + difference) % 7;
  if (dayOfWeek < 0)
    dayOfWeek += 7;
  return dayOfWeek;
}


x86 assembly (clang, -O0):
<getDayOfWeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <getMonthAnchorDay@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <getDoomsday@plt>
add    -0x10(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1175 <getDayOfWeek+0x55>
mov    -0x14(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDayOfWeek>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    %edx,%esi
call   1030 <getMonthAnchorDay@plt>
sub    %eax,%ebp
mov    %ebx,%edi
call   1040 <getDoomsday@plt>
add    %ebp,%eax
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0x2,%edx
add    %eax,%edx
lea    0x0(,%rdx,8),%eax
sub    %eax,%edx
lea    (%rdx,%rcx,1),%eax
add    $0x7,%eax
add    %edx,%ecx
cmovns %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getDayOfWeek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @getMonthAnchorDay(i32 %1, i32 %2)
%5 = sub i32 %0, %4
%6 = tail call i32 @getDoomsday(i32 %2)
%7 = add nsw i32 %5, %6
%8 = srem i32 %7, 7
%9 = icmp slt i32 %8, 0
%10 = add nsw i32 %8, 7
%11 = select i1 %9, i32 %10, i32 %8
ret i32 %11
}
void OTG_FS_IRQHandler() {}


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

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

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

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