xunge/DecIR huggingface dataset:
int trailingZeroes(int n) {
  int five = 5, count = 0;
  while (n > 0) {
    n = n / five;
    count += n;
  }
  return count;
}


x86 assembly (clang, -O0):
<trailingZeroes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1137 <trailingZeroes+0x37>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <trailingZeroes+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trailingZeroes>:
xor    %eax,%eax
test   %edi,%edi
jle    1123 <trailingZeroes+0x23>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x22,%rdx
add    %edx,%eax
cmp    $0x4,%edi
mov    %edx,%edi
ja     1110 <trailingZeroes+0x10>
ret

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

LLVM IR (-O2):
define i32 @trailingZeroes(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 5
%7 = add nuw nsw i32 %4, %6
%8 = icmp ult i32 %5, 5
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
void J400ToARGBRow_C() {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @J400ToARGBRow_C() {
ret void
}
int execvp(const char __attribute__((unused)) * file,
           char __attribute__((unused)) *const argv[]) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @execvp(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @execvp(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(void) {
  int c;
  while ((c = getchar()) != EOF) {
    if (c == ' ')
      putchar('\n');
    else
      putchar(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     116e <main+0x4e>
cmpl   $0x20,-0x8(%rbp)
jne    1161 <main+0x41>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1169 <main+0x49>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb7(%rip),%rbx
cmp    (%rbx),%eax
je     1158 <main+0x38>
mov    $0xa,%ebp
nopw   0x0(%rax,%rax,1)
cmp    $0x20,%eax
cmove  %ebp,%eax
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %15, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 32
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @putchar(i32 10)
br label %15
12: ; preds = %7
%13 = load i32, i32* %2
%14 = call i32 @putchar(i32 %13)
br label %15
15: ; preds = %12, %10
br label %3
16: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %12, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %9, %4 ], [ %1, %0 ]
%6 = icmp eq i32 %5, 32
%7 = select i1 %6, i32 10, i32 %5
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %4
12: ; preds = %4, %0
ret i32 0
}
int test_imm_96int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x96 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_96int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x96,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_96int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 150
%7 = icmp ne i64 %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_96int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 644245094400
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int getnpar(int, char *, char *, double *);
int getnpardouble(int n, char *name, double *ptr) {
  return getnpar(n, name, "d", ptr);
}


x86 assembly (clang, -O0):
<getnpardouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdx
call   1030 <getnpar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnpardouble>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <getnpar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"d\00"
define i32 @getnpardouble(i32 %0, i8* %1, double* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca double*
store i32 %0, i32* %4
store i8* %1, i8** %5
store double* %2, double** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load double*, double** %6
%10 = call i32 @getnpar(i32 %7, i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), double* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"d\00"
define i32 @getnpardouble(i32 %0, i8* %1, double* %2) {
%4 = tail call i32 @getnpar(i32 %0, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), double* %2)
ret i32 %4
}
/* Variables and functions */
scalar_t__ bus_to_virt(unsigned long);
void *nocache_to_muc(void *);
__attribute__((always_)) unsigned long muc_to_lhost(unsigned long addr) {
  void *tmp = nocache_to_muc((void *)addr);
  if (tmp != ((void *)((unsigned long)0))) {
    addr = (unsigned long)tmp;
  }
  return (unsigned long)bus_to_virt(addr);
}


x86 assembly (clang, -O0):
<muc_to_lhost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nocache_to_muc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <muc_to_lhost+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bus_to_virt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<muc_to_lhost>:
push   %rbx
mov    %rdi,%rbx
call   1040 <nocache_to_muc@plt>
test   %rax,%rax
cmovne %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <bus_to_virt@plt>

LLVM IR (-O0):
define i64 @muc_to_lhost(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i8*
%6 = call i8* @nocache_to_muc(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = ptrtoint i8* %10 to i64
store i64 %11, i64* %2
br label %12
12: ; preds = %9, %1
%13 = load i64, i64* %2
%14 = call i64 @bus_to_virt(i64 %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @muc_to_lhost(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = tail call i8* @nocache_to_muc(i8* %2)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = select i1 %4, i64 %0, i64 %5
%7 = tail call i64 @bus_to_virt(i64 %6)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int age = 10;
  int height;
  printf("I am %i years old.\n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %i years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %i years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xc1() {
  Assert_real((isupper(193) == 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_isupper.c",
              970, ("isupper should be 0 for 0xc1"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xc1>:
push   %rax
mov    $0xc1,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ca,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xc1\00"
define void @t_isupper_0xc1() {
%1 = call i64 @isupper(i32 193)
%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 970, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xc1\00"
define void @t_isupper_0xc1() {
%1 = tail call i64 @isupper(i32 193)
%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 970, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ internal_print_hline(int);
int /*<<< orphan*/ internal_print_rtab(int);
int num_destinations();
void print_rtab(void) {
  int size = num_destinations();
  internal_print_rtab(size);
  internal_print_hline(size);
}


x86 assembly (clang, -O0):
<print_rtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <num_destinations@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <internal_print_rtab@plt>
mov    -0x4(%rbp),%edi
call   1040 <internal_print_hline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_rtab>:
push   %rbx
xor    %eax,%eax
call   1030 <num_destinations@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <internal_print_rtab@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <internal_print_hline@plt>

LLVM IR (-O0):
define void @print_rtab() {
%1 = alloca i32
%2 = call i32 (...) @num_destinations()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @internal_print_rtab(i32 %3)
%5 = load i32, i32* %1
%6 = call i32 @internal_print_hline(i32 %5)
ret void
}

LLVM IR (-O2):
define void @print_rtab() {
%1 = tail call i32 (...) @num_destinations()
%2 = tail call i32 @internal_print_rtab(i32 %1)
%3 = tail call i32 @internal_print_hline(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
void builtin_exit(char **argv) {
  if (!argv[1])
    exit(0);
  else
    exit(strtol(argv[1], NULL, 0));
}


x86 assembly (clang, -O0):
<builtin_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    1142 <builtin_exit+0x22>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<builtin_exit>:
push   %rax
mov    0x8(%rdi),%rdi
test   %rdi,%rdi
jne    1131 <builtin_exit+0x11>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @builtin_exit(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
%10 = load i8**, i8*** %2
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strtol(i8* %12, i32* null, i32 0)
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
define void @builtin_exit(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
%8 = tail call i32 @strtol(i8* nocapture %3, i32* null, i32 0)
%9 = tail call i32 @exit(i32 %8)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint32_t XcmValueUInt32Swap(uint32_t val) {
  uint8_t *bytes = (uint8_t *)&val, new_val[4];
  {
    new_val[0] = bytes[3];
    new_val[1] = bytes[2];
    new_val[2] = bytes[1];
    new_val[3] = bytes[0];
    memcpy(&val, new_val, sizeof(uint32_t));
  }
  return val;
}


x86 assembly (clang, -O0):
<XcmValueUInt32Swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    -0x20(%rbp),%rsi
lea    -0x4(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XcmValueUInt32Swap>:
sub    $0x28,%rsp
mov    %edi,0xc(%rsp)
mov    %edi,0x1c(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0xc(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @XcmValueUInt32Swap(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [4 x i32]
store i32 %0, i32* %2
store i32* %2, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 3
%7 = load i32, i32* %6
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
store i32 %7, i32* %8
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
store i32 %11, i32* %12
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 2
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 3
store i32 %19, i32* %20
%21 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%22 = call i32 @memcpy(i32* %2, i32* %21, i32 4)
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @XcmValueUInt32Swap(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
store i32 %0, i32* %2
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
store i32 %0, i32* %6
%7 = call i32 @memcpy(i32* %2, i32* %5, i32 4)
%8 = load i32, i32* %2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_usage(const char *argv0) {
  printf("Usage: %s command [arg...]\n", argv0);
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Usage: %s command [arg...]\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Usage: %s command [arg...]\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int hammingWeight(unsigned int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main(int argc, char const *argv[]) {
  unsigned number = 0;
  scanf("%d", &number);
  printf("the number: %d\n", number);
  printf("1s in the number: %d\n", hammingWeight(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1050 <hammingWeight@plt>
mov    %eax,%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
call   1050 <hammingWeight@plt>
lea    0xe99(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"the number: %d\0A\00"
@.str.2 = [22 x i8] c"1s in the number: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %6
%11 = call i32 @hammingWeight(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"the number: %d\0A\00"
@.str.2 = [22 x i8] c"1s in the number: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @hammingWeight(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void restore_color() { printf("\033[0m"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @restore_color() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
float square_float(float x) { return x * x; }


x86 assembly (clang, -O0):
<square_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_float>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @square_float(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
double erf(double);
double c_erf(double arg0) { return erf(arg0); }


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

x86 assembly (clang, -O2):
<c_erf>:
jmp    1030 <erf@plt>

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

LLVM IR (-O2):
define double @c_erf(double %0) {
%2 = tail call double @erf(double %0)
ret double %2
}
/* Variables and functions */
float log(float);
float Float_log(float x) { return log(x); }


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

x86 assembly (clang, -O2):
<Float_log>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define float @Float_log(float %0) {
%2 = tail call float @log(float %0)
ret float %2
}
int mongo_env_sock_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mongo_env_sock_init() {
ret i32 0
}
void short_wait(void) {
  int i;
  for (i = 0; i < 100; i++) {
    i++;
    i--;
  }
}


x86 assembly (clang, -O0):
<short_wait>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1135 <short_wait+0x35>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <short_wait+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @short_wait() {
ret void
}
void push(char **stackp, char c) {
  **stackp = c;
  (*stackp)++;
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @push(i8** %0, i8 signext %1) {
%3 = alloca i8**
%4 = alloca i8
store i8** %0, i8*** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8 %5, i8* %7
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %8
ret void
}

LLVM IR (-O2):
define void @push(i8** nocapture %0, i8 signext %1) {
%3 = load i8*, i8** %0
store i8 %1, i8* %3
%4 = load i8*, i8** %0
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %0
ret void
}
/* Variables and functions */
int nthUglyNumber(int);
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  int n = 10;
  do {
    printf("%s:%d\n", "nthUglyNumber(n)", (nthUglyNumber(n)));
  } while (0);
  ;
  do {
    printf("%s:%d\n", "nthUglyNumber(1)", (nthUglyNumber(1)));
  } while (0);
  ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <nthUglyNumber@plt>
mov    %eax,%edx
lea    0xec0(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1030 <printf@plt>
jmp    1151 <main+0x31>
mov    $0x1,%edi
call   1040 <nthUglyNumber@plt>
mov    %eax,%edx
lea    0xe9c(%rip),%rdi
lea    0xead(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <nthUglyNumber@plt>
lea    0xece(%rip),%rbx
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <nthUglyNumber@plt>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [17 x i8] c"nthUglyNumber(n)\00"
@.str.2 = [17 x i8] c"nthUglyNumber(1)\00"
define i32 @main() {
%1 = alloca i32
store i32 10, i32* %1
br label %2
2: ; preds = %0
%3 = load i32, i32* %1
%4 = call i32 @nthUglyNumber(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %2
br label %7
7: ; preds = %6
%8 = call i32 @nthUglyNumber(i32 1)
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [17 x i8] c"nthUglyNumber(n)\00"
@.str.2 = [17 x i8] c"nthUglyNumber(1)\00"
define i32 @main() {
%1 = tail call i32 @nthUglyNumber(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @nthUglyNumber(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
void caller_1_1_1_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_1_1_1_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ d(char *);
void __attribute__((constructor)) initF() { d("initF"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"initF\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initF, i8* null }]
define void @initF() {
%1 = tail call i32 @d(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float log2(float);
float max(double, float const);
float R2_logDepthEncodePartial(const float z, const float depth_coefficient) {
  float half_co = depth_coefficient * 0.5;
  float clamp_z = max(0.000001, z);
  return log2(clamp_z) * half_co;
}


x86 assembly (clang, -O0):
<R2_logDepthEncodePartial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movsd  0xea3(%rip),%xmm0
call   1040 <max@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <log2@plt>
mulss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<R2_logDepthEncodePartial>:
push   %rax
movaps %xmm0,%xmm2
mulss  0xed4(%rip),%xmm1
movss  %xmm1,0x4(%rsp)
movsd  0xece(%rip),%xmm0
movaps %xmm2,%xmm1
call   1040 <max@plt>
call   1030 <log2@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @R2_logDepthEncodePartial(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = fmul double %8, 5.000000e-01
%10 = fptrunc double %9 to float
store float %10, float* %5
%11 = load float, float* %3
%12 = call float @max(double 0x3EB0C6F7A0B5ED8D, float %11)
store float %12, float* %6
%13 = load float, float* %6
%14 = call float @log2(float %13)
%15 = load float, float* %5
%16 = fmul float %14, %15
ret float %16
}

LLVM IR (-O2):
define float @R2_logDepthEncodePartial(float %0, float %1) {
%3 = fmul float %1, 5.000000e-01
%4 = tail call float @max(double 0x3EB0C6F7A0B5ED8D, float %0)
%5 = tail call float @log2(float %4)
%6 = fmul float %3, %5
ret float %6
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void timer_start(struct timeval *start) { gettimeofday(start, NULL); }


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

x86 assembly (clang, -O2):
<timer_start>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @timer_start(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
int test_imm_F4uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xF4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F4uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xf4,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_F4uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 244
%6 = icmp ne i64 %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_F4uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 15990784
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = (input[0UL] - 51238316UL) - 339126204UL;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      local1++;
    }
    output[0UL] =
        ((state[0UL] << 1UL) | (state[0UL] >> 63UL)) ^ 105059837885669120UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
sub    $0x30dd5ac,%rax
sub    $0x1436a7bc,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%rax
jae    114e <RandomFunc+0x4e>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <RandomFunc+0x2b>
mov    -0x18(%rbp),%rcx
shl    $0x1,%rcx
mov    -0x18(%rbp),%rax
shr    $0x3f,%rax
or     %rax,%rcx
movabs $0x1753f5dad55df00,%rax
3f 75 01
xor    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0xffffffffe8bb8298,%rax
add    (%rdi),%rax
rol    %rax
movabs $0x1753f5dad55df00,%rcx
3f 75 01
xor    %rax,%rcx
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = sub i64 %9, 51238316
%11 = sub i64 %10, 339126204
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %6
br label %13
13: ; preds = %19, %2
%14 = load i64, i64* %6
%15 = load i64*, i64** %3
%16 = getelementptr inbounds i64, i64* %15, i64 1
%17 = load i64, i64* %16
%18 = icmp ult i64 %14, %17
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i64, i64* %6
%21 = add i64 %20, 1
store i64 %21, i64* %6
br label %13
22: ; preds = %13
%23 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%24 = load i64, i64* %23
%25 = shl i64 %24, 1
%26 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%27 = load i64, i64* %26
%28 = lshr i64 %27, 63
%29 = or i64 %25, %28
%30 = xor i64 %29, 105059837885669120
%31 = load i64*, i64** %4
%32 = getelementptr inbounds i64, i64* %31, i64 0
store i64 %30, i64* %32
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, -390364520
%5 = tail call i64 @llvm.fshl.i64(i64 %4, i64 %4, i64 1)
%6 = xor i64 %5, 105059837885669120
store i64 %6, i64* %1
ret void
}
/* Type definitions */
struct p7_coro_cntx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct p7_coro_cntx *);
void p7_coro_cntx_delete_(struct p7_coro_cntx *cntx) { free(cntx); }


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

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

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

LLVM IR (-O2):
%struct.p7_coro_cntx = type { i32 }
define void @p7_coro_cntx_delete_(%struct.p7_coro_cntx* nocapture %0) {
%2 = tail call i32 @free(%struct.p7_coro_cntx* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ l;
};
struct TYPE_4__ {
  TYPE_1__ data;
};
typedef TYPE_2__ XClientMessageEvent;

/* Variables and functions */
void *get_XClientMessageEvent_data_l(void *_p) {
  return (void *)(((XClientMessageEvent *)_p)->data.l);
}


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

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

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

LLVM IR (-O2):
define i8* @get_XClientMessageEvent_data_l(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
char const *dogGreet(void) { return "vau!"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"vau!\00"
define i8* @dogGreet() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"vau!\00"
define i8* @dogGreet() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *realloc(void *, size_t);
void *s_realloc(void *ptr, size_t len) {
  ptr = realloc(ptr, len);
  assert(ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<s_realloc>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_realloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @s_realloc(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 i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @assert(i8* %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @s_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = tail call i32 @assert(i8* %3)
ret i8* %3
}
char foo() {
  char *x = " ";
  return x[0];
}


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

x86 assembly (clang, -O2):
<foo>:
mov    $0x20,%al
ret

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

LLVM IR (-O2):
define signext i8 @foo() {
ret i8 32
}
signed int sext8(p) signed char *p;
{ return *p; }


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

x86 assembly (clang, -O2):
<sext8>:
movsbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @sext8(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @sext8(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void USBEndpointPacketCountSet(uint32_t ui32Base, uint32_t ui32Endpoint,
                               uint32_t ui32Count) {
  (*((volatile uint32_t *)(ui32Base + 0x00000304 +
                           (0x4 * (((ui32Endpoint) >> 4) - 1))))) = ui32Count;
}


x86 assembly (clang, -O0):
<USBEndpointPacketCountSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x304,%eax
mov    -0x8(%rbp),%edx
sar    $0x4,%edx
sub    $0x1,%edx
shl    $0x2,%edx
add    %edx,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointPacketCountSet>:
movslq %edi,%rax
sar    $0x2,%esi
add    $0xfffffffc,%esi
movslq %esi,%rcx
and    $0xfffffffffffffffc,%rcx
mov    %edx,0x304(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @USBEndpointPacketCountSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 772
%10 = load i32, i32* %5
%11 = ashr i32 %10, 4
%12 = sub nsw i32 %11, 1
%13 = mul nsw i32 4, %12
%14 = add nsw i32 %9, %13
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %7, i32* %16
ret void
}

LLVM IR (-O2):
define void @USBEndpointPacketCountSet(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 772
%5 = ashr i32 %1, 2
%6 = add nsw i32 %5, -4
%7 = and i32 %6, -4
%8 = add nsw i32 %4, %7
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %2, i32* %10
ret void
}
/* Variables and functions */
scalar_t__ strchr(char const *, int);
char *c_strchr(const char *s, int c) { return (char *)strchr(s, c); }


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

x86 assembly (clang, -O2):
<c_strchr>:
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i8* @c_strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @strchr(i8* %5, i32 %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @c_strchr(i8* %0, i32 %1) {
%3 = tail call i64 @strchr(i8* %0, i32 %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
void ui_resize_window(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo65() {
ret void
}
/* Variables and functions */
int partion(int *, int, int);
void quikSort(int arr[], int first, int last) {
  if (first < last) {
    int mid = partion(arr, first, last);
    quikSort(arr, first, mid - 1);
    quikSort(arr, mid + 1, last);
  }
  int i;
}


x86 assembly (clang, -O0):
<quikSort>:
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 <quikSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <partion@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <quikSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <quikSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quikSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quikSort+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   1040 <partion@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <quikSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quikSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quikSort(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* %5
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partion(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
define void @quikSort(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 @partion(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quikSort(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
}