xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sfree(void *);
void guppy_udo_tempnamechook_free(void *hook) {
  if (!hook) {
    return;
  }
  sfree(hook);
  return;
}


x86 assembly (clang, -O0):
<guppy_udo_tempnamechook_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <guppy_udo_tempnamechook_free+0x1c>
jmp    1135 <guppy_udo_tempnamechook_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <sfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<guppy_udo_tempnamechook_free>:
test   %rdi,%rdi
je     111a <guppy_udo_tempnamechook_free+0xa>
jmp    1030 <sfree@plt>
ret

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

LLVM IR (-O2):
define void @guppy_udo_tempnamechook_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sfree(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
int int_cmp(int x, int y) {
  if (x > y)
    return x;
  return y;
}


x86 assembly (clang, -O0):
<int_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <int_cmp+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <int_cmp+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_cmp>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @int_cmp(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;

/* Variables and functions */
int ENOSYS;
int posix_spawnattr_setschedpolicy(posix_spawnattr_t *attr, int policy) {
  return ENOSYS;
}


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

x86 assembly (clang, -O2):
<posix_spawnattr_setschedpolicy>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @posix_spawnattr_setschedpolicy(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
ret i32 %3
}
int ti_ceil_start(double const *options) {
  (void)options;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_ceil_start(double* nocapture readnone %0) {
ret i32 0
}
int config_MODULE_CAMD35_TCP(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @config_MODULE_CAMD35_TCP() {
ret i32 1
}
unsigned char OutputToMotorNum(unsigned char Output) {
  switch (Output) {
  case 0x01:
    return 0;
  case 0x02:
    return 1;
  case 0x04:
    return 2;
  case 0x08:
    return 3;
  }
  return 4;
}


x86 assembly (clang, -O0):
<OutputToMotorNum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     1158 <OutputToMotorNum+0x58>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x0,-0x1(%rbp)
jmp    115c <OutputToMotorNum+0x5c>
movb   $0x1,-0x1(%rbp)
jmp    115c <OutputToMotorNum+0x5c>
movb   $0x2,-0x1(%rbp)
jmp    115c <OutputToMotorNum+0x5c>
movb   $0x3,-0x1(%rbp)
jmp    115c <OutputToMotorNum+0x5c>
movb   $0x4,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<OutputToMotorNum>:
add    $0xff,%dil
movzbl %dil,%eax
lea    0x0(,%rax,8),%ecx
movabs $0x304040402040100,%rdx
04 04 03
shr    %cl,%rdx
cmp    $0x8,%al
mov    $0x4,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @OutputToMotorNum(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %10 [
i32 1, label %6
i32 2, label %7
i32 4, label %8
i32 8, label %9
]
6: ; preds = %1
store i8 0, i8* %2
br label %11
7: ; preds = %1
store i8 1, i8* %2
br label %11
8: ; preds = %1
store i8 2, i8* %2
br label %11
9: ; preds = %1
store i8 3, i8* %2
br label %11
10: ; preds = %1
store i8 4, i8* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @OutputToMotorNum(i8 zeroext %0) {
%2 = add i8 %0, -1
%3 = icmp ult i8 %2, 8
%4 = zext i8 %2 to i64
%5 = shl nuw nsw i64 %4, 3
%6 = lshr i64 217303097280823552, %5
%7 = trunc i64 %6 to i8
%8 = select i1 %3, i8 %7, i8 4
ret i8 %8
}
int rtmon_get_defaults(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rtmon_get_defaults() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xaa() {
  Assert_real((isalnum(170) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              855, ("isalnum should be 0 for 0xaa"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xaa\00"
define void @t_isalnum_0xaa() {
%1 = call i64 @isalnum(i32 170)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 855, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xaa\00"
define void @t_isalnum_0xaa() {
%1 = tail call i64 @isalnum(i32 170)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 855, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void TM03_intr(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @sandbox_check() {
ret i32 0
}
char clower(c)
register char c;
{ return (isupper(c) ? tolower(c) : c); }


x86 assembly (clang, -O0):
<clower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%eax
je     1151 <clower+0x31>
movsbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x8(%rbp)
jmp    1158 <clower+0x38>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clower>:
push   %rbx
movsbl %dil,%ebx
mov    %ebx,%edi
call   1040 <isupper@plt>
test   %eax,%eax
je     1139 <clower+0x19>
mov    %ebx,%edi
call   1030 <tolower@plt>
mov    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @clower(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 @isupper(i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = call i32 @tolower(i32 %10)
br label %15
12: ; preds = %1
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
br label %15
15: ; preds = %12, %8
%16 = phi i32 [ %11, %8 ], [ %14, %12 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @clower(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 @isupper(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @tolower(i32 %3)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ %3, %1 ]
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int *data_set, int f, int k) {
  if (f < k) {
    int q = partition(data_set, f, k);
    quick_sort(data_set, f, q - 1);
    quick_sort(data_set, q + 1, k);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
main() { print("Hello, world!\n"); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int kbd_init(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @kbd_init() {
ret i32 1
}
unsigned int foo(unsigned int eax) {
  eax |= 4;
  eax &= 247;
  eax |= 16;
  eax &= 223;
  eax |= 64;
  eax &= 127;
  return eax;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf7,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x10,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xdf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x40,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
and    $0x3,%edi
lea    0x54(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 %3, 4
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 247
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = or i32 %7, 16
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 223
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = or i32 %11, 64
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = and i32 %13, 127
store i32 %14, i32* %2
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = and i32 %0, 3
%3 = or i32 %2, 84
ret i32 %3
}
int cmp(const void *a, const void *b) {
  int *p = (int *)a;
  int *q = (int *)b;
  return *q - *p;
}


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

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

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
ret i32 %7
}
float ct_maddf(const float a, const float b, const float c) {
  return a * b + c;
}


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

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

LLVM IR (-O0):
define float @ct_maddf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fmuladd.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @ct_maddf(float %0, float %1, float %2) {
%4 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %2)
ret float %4
}
void *lookupCommandByCString(void) { return (void *)0; }


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

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

LLVM IR (-O0):
define i8* @lookupCommandByCString() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @lookupCommandByCString() {
ret i8* null
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
scalar_t__ search_dict(struct forth_instance *, char *, intptr_t, int);
intptr_t st_pop(struct forth_instance *);
int /*<<< orphan*/ st_push(struct forth_instance *, intptr_t);
void tick_addr(struct forth_instance *fi) {
  intptr_t len;
  char *name;
  len = st_pop(fi);
  name = (char *)st_pop(fi);
  st_push(fi, (intptr_t)search_dict(fi, name, len, 1));
}


x86 assembly (clang, -O0):
<tick_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <st_pop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <st_pop@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <search_dict@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1050 <st_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tick_addr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <st_pop@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <st_pop@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
call   1030 <search_dict@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @tick_addr(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
%3 = alloca i64
%4 = alloca i8*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%5 = load %struct.forth_instance*, %struct.forth_instance** %2
%6 = call i64 @st_pop(%struct.forth_instance* %5)
store i64 %6, i64* %3
%7 = load %struct.forth_instance*, %struct.forth_instance** %2
%8 = call i64 @st_pop(%struct.forth_instance* %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load %struct.forth_instance*, %struct.forth_instance** %2
%11 = load %struct.forth_instance*, %struct.forth_instance** %2
%12 = load i8*, i8** %4
%13 = load i64, i64* %3
%14 = call i64 @search_dict(%struct.forth_instance* %11, i8* %12, i64 %13, i32 1)
%15 = call i32 @st_push(%struct.forth_instance* %10, i64 %14)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @tick_addr(%struct.forth_instance* %0) {
%2 = tail call i64 @st_pop(%struct.forth_instance* %0)
%3 = tail call i64 @st_pop(%struct.forth_instance* %0)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i64 @search_dict(%struct.forth_instance* %0, i8* %4, i64 %2, i32 1)
%6 = tail call i32 @st_push(%struct.forth_instance* %0, i64 %5)
ret void
}
void CFGMR3QueryS16Def(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryS16Def() {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  char *arr = malloc(-10);
  (void)write(1, arr, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xfffffff6,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
mov    $0xa,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffff6,%edi
call   1040 <malloc@plt>
mov    $0x1,%edi
mov    %rax,%rsi
mov    $0xa,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(4294967286) i8* @malloc(i32 -10)
%2 = tail call i32 @write(i32 1, i8* %1, i32 10)
ret i32 0
}
/* Variables and functions */
int sscanf(char *, char *, long double *);
int string2longdouble(char *_string, long double *_longdouble) {
  if (sscanf(_string, "%Lf", _longdouble) != 1) {
    *_longdouble = -1;
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<string2longdouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1153 <string2longdouble+0x43>
mov    -0x18(%rbp),%rax
fld1
fchs
fstpt  (%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <string2longdouble+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string2longdouble>:
push   %rbx
mov    %rsi,%rbx
lea    0xee5(%rip),%rsi
mov    %rbx,%rdx
call   1030 <sscanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
je     1137 <string2longdouble+0x27>
fld1
fchs
fstpt  (%rbx)
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%Lf\00"
define i32 @string2longdouble(i8* nocapture %0, x86_fp80* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %6, label %5
5: ; preds = %2
store x86_fp80 0xKBFFF8000000000000000, x86_fp80* %1
br label %6
6: ; preds = %2, %5
%7 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %7
}
char *langRomTypeMegaSCSI1mb() { return "1MB MEGA-SCSI"; }


x86 assembly (clang, -O0):
<langRomTypeMegaSCSI1mb>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeMegaSCSI1mb>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"1MB MEGA-SCSI\00"
define i8* @langRomTypeMegaSCSI1mb() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"1MB MEGA-SCSI\00"
define i8* @langRomTypeMegaSCSI1mb() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ tc_putp(int /*<<< orphan*/);
int /*<<< orphan*/ tparm(char *);
void put_mode(char *s) { tc_putp(tparm(s)); }


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

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

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

LLVM IR (-O2):
define void @put_mode(i8* %0) {
%2 = tail call i32 @tparm(i8* %0)
%3 = tail call i32 @tc_putp(i32 %2)
ret void
}
void XShapeGetRectangles() {}


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

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

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

LLVM IR (-O2):
define void @XShapeGetRectangles() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpu_reset();
void maincpu_reset(void) { cpu_reset(); }


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

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

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

LLVM IR (-O2):
define void @maincpu_reset() {
%1 = tail call i32 (...) @cpu_reset()
ret void
}
int test_imm_E0uint8_mem(unsigned char *val) {
  return ((*val) & (-0xE0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E0uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -224
%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_E0uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 32
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t read_FP_BE(int /*<<< orphan*/ *, double *, int);
size_t float64ReadFromFP(FILE *fp, double *data) {
  return read_FP_BE(fp, data, sizeof(double));
}


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

x86 assembly (clang, -O2):
<float64ReadFromFP>:
mov    $0x8,%edx
jmp    1030 <read_FP_BE@plt>

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

LLVM IR (-O2):
define i64 @float64ReadFromFP(i32* %0, double* %1) {
%3 = tail call i64 @read_FP_BE(i32* %0, double* %1, i32 8)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct icmp {
  int /*<<< orphan*/ icmp_cksum;
};

/* Variables and functions */
int /*<<< orphan*/ icmp_checksum(struct icmp *, int /*<<< orphan*/ *, int);
void set_icmp_sum(struct icmp *self, int val) {
  self->icmp_cksum = icmp_checksum(self, (uint8_t *)self + 8, 4);
}


x86 assembly (clang, -O0):
<set_icmp_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x20,%rsi
mov    $0x4,%edx
call   1030 <icmp_checksum@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_icmp_sum>:
push   %rbx
mov    %rdi,%rbx
lea    0x20(%rdi),%rsi
mov    $0x4,%edx
call   1030 <icmp_checksum@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.icmp = type { i32 }
define void @set_icmp_sum(%struct.icmp* %0, i32 %1) {
%3 = alloca %struct.icmp*
%4 = alloca i32
store %struct.icmp* %0, %struct.icmp** %3
store i32 %1, i32* %4
%5 = load %struct.icmp*, %struct.icmp** %3
%6 = load %struct.icmp*, %struct.icmp** %3
%7 = bitcast %struct.icmp* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 8
%9 = call i32 @icmp_checksum(%struct.icmp* %5, i32* %8, i32 4)
%10 = load %struct.icmp*, %struct.icmp** %3
%11 = getelementptr inbounds %struct.icmp, %struct.icmp* %10, i32 0, i32 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
%struct.icmp = type { i32 }
define void @set_icmp_sum(%struct.icmp* %0, i32 %1) {
%3 = getelementptr inbounds %struct.icmp, %struct.icmp* %0, i64 8, i32 0
%4 = tail call i32 @icmp_checksum(%struct.icmp* %0, i32* %3, i32 4)
%5 = getelementptr inbounds %struct.icmp, %struct.icmp* %0, i64 0, i32 0
store i32 %4, i32* %5
ret void
}
void PWMARRSet(unsigned long ulBase, unsigned long ulCRRValue) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) &= ~0x0000FFFF;
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) = ulCRRValue;
}


x86 assembly (clang, -O0):
<PWMARRSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rcx
and    $0xffffffffffff0000,%rcx
mov    %rcx,0x2c(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x2c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMARRSet>:
andq   $0xffffffffffff0000,0x2c(%rdi)
ff
mov    %rsi,0x2c(%rdi)
ret

LLVM IR (-O0):
define void @PWMARRSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 44
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -65536
store volatile i64 %9, i64* %7
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = add i64 %11, 44
%13 = inttoptr i64 %12 to i64*
store volatile i64 %10, i64* %13
ret void
}

LLVM IR (-O2):
define void @PWMARRSet(i64 %0, i64 %1) {
%3 = add i64 %0, 44
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -65536
store volatile i64 %6, i64* %4
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_POT_POWER_PIN() { return 0x01 & (inp_emulate(0x71) >> 7); }


x86 assembly (clang, -O0):
<TOSH_READ_POT_POWER_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x71,%edi
call   1030 <inp_emulate@plt>
sar    $0x7,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_POT_POWER_PIN>:
push   %rax
mov    $0x71,%edi
call   1030 <inp_emulate@plt>
shr    $0x7,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_POT_POWER_PIN() {
%1 = call i32 @inp_emulate(i32 113)
%2 = ashr i32 %1, 7
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_POT_POWER_PIN() {
%1 = tail call i32 @inp_emulate(i32 113)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 7
ret i8 %3
}
void ASN1_VISIBLESTRING_new(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_VISIBLESTRING_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar(void) { printf("foo: bar\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"foo: bar\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pollen_interfaces_Gpio_clear__E();
void test7_Led_on__E() {
  { pollen_interfaces_Gpio_clear__E(); }
}


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

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

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

LLVM IR (-O2):
define void @test7_Led_on__E() {
%1 = tail call i32 (...) @pollen_interfaces_Gpio_clear__E()
ret void
}
void tune_stopchans(void) {}


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

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

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

LLVM IR (-O2):
define void @tune_stopchans() {
ret void
}
int test_imm_F2int16_reg(short val) {
  return ((val) & (-0xF2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F2int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff0e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F2int16_reg>:
test   $0xff0e,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F2int16_reg(i16 signext %0) {
%2 = and i16 %0, -242
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_haxe_comments() {
  test_parser_verify_parse(test_parser_sourcefile("haxe", " //comment"), "haxe",
                           "", "//comment", 0);
}


x86 assembly (clang, -O0):
<test_haxe_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebd(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_haxe_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec6(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"haxe\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_haxe_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"haxe\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_haxe_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
scalar_t__ asinh(double);
int /*<<< orphan*/ link_failure_asinh();
void test_asinh(double d) {
  if (asinh(d) != asinh(d))
    link_failure_asinh();
}


x86 assembly (clang, -O0):
<test_asinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <asinh@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <asinh@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_asinh+0x3c>
mov    $0x0,%al
call   1030 <link_failure_asinh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_asinh>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <asinh@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <asinh@plt>
cmp    %rax,%rbx
jne    1149 <test_asinh+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_asinh@plt>

LLVM IR (-O0):
define void @test_asinh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @asinh(double %3)
%5 = load double, double* %2
%6 = call i64 @asinh(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_asinh()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_asinh(double %0) {
%2 = tail call i64 @asinh(double %0)
%3 = tail call i64 @asinh(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_asinh()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t q15_div(const int32_t numer, const int32_t denom) {
  return (numer << 15) / denom;
}


x86 assembly (clang, -O0):
<q15_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xf,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<q15_div>:
mov    %edi,%eax
shl    $0xf,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @q15_div(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 = shl i32 %5, 15
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @q15_div(i32 %0, i32 %1) {
%3 = shl i32 %0, 15
%4 = sdiv i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ jlog(int, char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
int system(char *);
extern int tun_up(char *devname, char *addr) {
  char sys[128];
  int ret;
  snprintf(sys, 128, "%s %s %s", "ifconfig", devname, addr);
  jlog(0x08, "tunnel]> %s", sys);
  ret = system(sys);
  return ret;
}


x86 assembly (clang, -O0):
<tun_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    $0x80,%esi
lea    0xea2(%rip),%rdx
lea    0xea4(%rip),%rcx
call   1040 <snprintf@plt>
lea    -0x90(%rbp),%rdx
mov    $0x8,%edi
lea    0xe95(%rip),%rsi
call   1050 <jlog@plt>
lea    -0x90(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x94(%rbp)
mov    -0x94(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tun_up>:
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%r9
mov    %rdi,%r8
lea    0xebb(%rip),%rdx
lea    0xebd(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1040 <snprintf@plt>
lea    0xeaf(%rip),%rsi
mov    $0x8,%edi
mov    %rbx,%rdx
call   1050 <jlog@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s %s %s\00"
@.str.1 = [9 x i8] c"ifconfig\00"
@.str.2 = [12 x i8] c"tunnel]> %s\00"
define i32 @tun_up(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @snprintf(i8* %7, i32 128, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%12 = call i32 @jlog(i32 8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%14 = call i32 @system(i8* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s %s %s\00"
@.str.1 = [9 x i8] c"ifconfig\00"
@.str.2 = [12 x i8] c"tunnel]> %s\00"
define i32 @tun_up(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @jlog(i32 8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%7 = call i32 @system(i8* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ listDir(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("ERROR: you must supply a directory!\n");
    exit(1);
  } else {
    listDir(argv[1]);
    exit(0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1166 <main+0x36>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <listDir@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     114c <main+0x1c>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x8(%rsi),%rdi
call   1040 <listDir@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"ERROR: you must supply a directory!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @listDir(i8* %14)
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [36 x i8] c"ERROR: you must supply a directory!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @listDir(i8* %9)
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
struct udcFile {
  int dummy;
};

/* Variables and functions */
double byteSwapDouble(double);
int /*<<< orphan*/ udcMustRead(struct udcFile *, double *, int);
double udcReadDouble(struct udcFile *file, int isSwapped) {
  double val;
  udcMustRead(file, &val, sizeof(val));
  if (isSwapped)
    val = byteSwapDouble(val);
  return val;
}


x86 assembly (clang, -O0):
<udcReadDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1040 <udcMustRead@plt>
cmpl   $0x0,-0xc(%rbp)
je     115a <udcReadDouble+0x3a>
movsd  -0x18(%rbp),%xmm0
call   1030 <byteSwapDouble@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udcReadDouble>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1040 <udcMustRead@plt>
movsd  0x8(%rsp),%xmm0
test   %ebx,%ebx
je     1145 <udcReadDouble+0x25>
call   1030 <byteSwapDouble@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.udcFile = type { i32 }
define double @udcReadDouble(%struct.udcFile* %0, i32 %1) {
%3 = alloca %struct.udcFile*
%4 = alloca i32
%5 = alloca double
store %struct.udcFile* %0, %struct.udcFile** %3
store i32 %1, i32* %4
%6 = load %struct.udcFile*, %struct.udcFile** %3
%7 = call i32 @udcMustRead(%struct.udcFile* %6, double* %5, i32 8)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load double, double* %5
%12 = call double @byteSwapDouble(double %11)
store double %12, double* %5
br label %13
13: ; preds = %10, %2
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
%struct.udcFile = type { i32 }
define double @udcReadDouble(%struct.udcFile* %0, i32 %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = call i32 @udcMustRead(%struct.udcFile* %0, double* %3, i32 8)
%6 = icmp eq i32 %1, 0
%7 = load double, double* %3
br i1 %6, label %10, label %8
8: ; preds = %2
%9 = call double @byteSwapDouble(double %7)
br label %10
10: ; preds = %2, %8
%11 = phi double [ %9, %8 ], [ %7, %2 ]
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void _explicit_bzero(void *mem, size_t mem_len) {
#pragma optimize("-no-dead-code-removal")
#pragma optimize("-no-dce")
  volatile void *vmem = (volatile void *)mem;
  memset((void *)vmem, 0, mem_len);
#pragma optimize("-dead-code-removal")
#pragma optimize("-dce")
}


x86 assembly (clang, -O0):
<_explicit_bzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_explicit_bzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @_explicit_bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}