xunge/DecIR huggingface dataset:
void DMA1_Stream0_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @DMA1_Stream0_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(void *);
void LockLeave(void *p) {
  if (p) {
    pthread_mutex_unlock(p);
  }
}


x86 assembly (clang, -O0):
<LockLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <LockLeave+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @LockLeave(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 %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @pthread_mutex_unlock(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @LockLeave(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @pthread_mutex_unlock(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int time();
int /*<<< orphan*/ time_start();
void wait(int wait_usec) {
  time_start();
  while (time() < wait_usec)
    ;
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <time_start@plt>
mov    $0x0,%al
call   1040 <time@plt>
cmp    -0x4(%rbp),%eax
jge    1147 <wait+0x27>
jmp    1132 <wait+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <time_start@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <time@plt>
cmp    %ebx,%eax
jl     1130 <wait+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @wait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @time_start()
br label %4
4: ; preds = %8, %1
%5 = call i32 (...) @time()
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @wait(i32 %0) {
%2 = tail call i32 (...) @time_start()
br label %3
3: ; preds = %3, %1
%4 = tail call i32 (...) @time()
%5 = icmp slt i32 %4, %0
br i1 %5, label %3, label %6
6: ; preds = %3
ret void
}
void init_file_handling() {}


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

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

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

LLVM IR (-O2):
define void @init_file_handling() {
ret void
}
/* Type definitions */
struct ifreq {
  int dummy;
};

/* Variables and functions */
int ioctl(int, int, struct ifreq *);
int send_ioctl(int fd, struct ifreq *ifr) { return ioctl(fd, 0x8946, ifr); }


x86 assembly (clang, -O0):
<send_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x8946,%esi
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_ioctl>:
mov    %rsi,%rdx
mov    $0x8946,%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
%struct.ifreq = type { i32 }
define i32 @send_ioctl(i32 %0, %struct.ifreq* %1) {
%3 = alloca i32
%4 = alloca %struct.ifreq*
store i32 %0, i32* %3
store %struct.ifreq* %1, %struct.ifreq** %4
%5 = load i32, i32* %3
%6 = load %struct.ifreq*, %struct.ifreq** %4
%7 = call i32 @ioctl(i32 %5, i32 35142, %struct.ifreq* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.ifreq = type { i32 }
define i32 @send_ioctl(i32 %0, %struct.ifreq* %1) {
%3 = tail call i32 @ioctl(i32 %0, i32 35142, %struct.ifreq* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isspace(int);
const unsigned char *skipSpace(const unsigned char *cp) {
  while (isspace((int)*cp))
    ++cp;
  return cp;
}


x86 assembly (clang, -O0):
<skipSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipSpace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipSpace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipSpace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipSpace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipSpace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = tail call i64 @isspace(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i8* %3
}
void taUninitWindowSystem() {}


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

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

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

LLVM IR (-O2):
define void @taUninitWindowSystem() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void exprFreeMem(void *data) {
  if (data)
    free(data);
}


x86 assembly (clang, -O0):
<exprFreeMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <exprFreeMem+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @exprFreeMem(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 %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @exprFreeMem(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int bitOr(int a, int b) { return ~((~a) & (~b)); }


x86 assembly (clang, -O0):
<bitOr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bitOr(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 = xor i32 %5, -1
%7 = load i32, i32* %4
%8 = xor i32 %7, -1
%9 = and i32 %6, %8
%10 = xor i32 %9, -1
ret i32 %10
}

LLVM IR (-O2):
define i32 @bitOr(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int dlink_append_last(int);
int add(int val) { return dlink_append_last(val); }


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

x86 assembly (clang, -O2):
<add>:
jmp    1030 <dlink_append_last@plt>

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

LLVM IR (-O2):
define i32 @add(i32 %0) {
%2 = tail call i32 @dlink_append_last(i32 %0)
ret i32 %2
}
/* Variables and functions */
int syscall(int, void *, size_t, unsigned int);
int getrandom(void *buffer, size_t count, unsigned flags) {
  return syscall(318, buffer, count, flags);
}


x86 assembly (clang, -O0):
<getrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x13e,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrandom>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x13e,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @getrandom(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @syscall(i32 318, i8* %7, i64 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @getrandom(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @syscall(i32 318, i8* %0, i64 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ open_group_test();
int /*<<< orphan*/ seek_tests();
int /*<<< orphan*/ simple_tests();
int main(int ac, char **av) {
  open_group_test();
  simple_tests();
  seek_tests();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <open_group_test@plt>
mov    $0x0,%al
call   1050 <simple_tests@plt>
mov    $0x0,%al
call   1030 <seek_tests@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @open_group_test()
%7 = call i32 (...) @simple_tests()
%8 = call i32 (...) @seek_tests()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @open_group_test()
%4 = tail call i32 (...) @simple_tests()
%5 = tail call i32 (...) @seek_tests()
ret i32 0
}
void func_lens(int a, long b, short c, long d) {}


x86 assembly (clang, -O0):
<func_lens>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func_lens(i32 %0, i64 %1, i16 signext %2, i64 %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i16
%8 = alloca i64
store i32 %0, i32* %5
store i64 %1, i64* %6
store i16 %2, i16* %7
store i64 %3, i64* %8
ret void
}

LLVM IR (-O2):
define void @func_lens(i32 %0, i64 %1, i16 signext %2, i64 %3) {
ret void
}
/* Variables and functions */
long rand();
void generate_rand(long *data, int size) {
  int i;
  for (i = 0; i < size; i++)
    data[i] = rand();
}


x86 assembly (clang, -O0):
<generate_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1156 <generate_rand+0x46>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <generate_rand+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_rand>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <generate_rand+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <generate_rand+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @generate_rand(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call i64 (...) @rand()
%12 = load i64*, i64** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %12, i64 %14
store i64 %11, i64* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @generate_rand(i64* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call i64 (...) @rand()
%9 = getelementptr inbounds i64, i64* %0, i64 %7
store i64 %8, i64* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *DefaultAllocFunc(void *opaque, size_t size) {
  (void)(opaque);
  return malloc(size);
}


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

x86 assembly (clang, -O2):
<DefaultAllocFunc>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @DefaultAllocFunc(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* @malloc(i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @DefaultAllocFunc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
int Min(int x, int y) {
  if (x > y)
    return y;
  else
    return x;
}


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

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

LLVM IR (-O0):
define i32 @Min(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* %5
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
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 @Min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void pm_unregister(struct pm_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pm_dev = type opaque
define void @pm_unregister(%struct.pm_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int xyzToLabPreproc(double);
double xyzToLabA(double xin, double yin, double zin) {
  return 500 * (xyzToLabPreproc(xin) - xyzToLabPreproc(yin));
}


x86 assembly (clang, -O0):
<xyzToLabA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <xyzToLabPreproc@plt>
mov    %eax,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <xyzToLabPreproc@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
imul   $0x1f4,%eax,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyzToLabA>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
call   1030 <xyzToLabPreproc@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <xyzToLabPreproc@plt>
sub    %eax,%ebx
imul   $0x1f4,%ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @xyzToLabA(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = call i32 @xyzToLabPreproc(double %7)
%9 = load double, double* %5
%10 = call i32 @xyzToLabPreproc(double %9)
%11 = sub nsw i32 %8, %10
%12 = mul nsw i32 500, %11
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @xyzToLabA(double %0, double %1, double %2) {
%4 = tail call i32 @xyzToLabPreproc(double %0)
%5 = tail call i32 @xyzToLabPreproc(double %1)
%6 = sub nsw i32 %4, %5
%7 = mul nsw i32 %6, 500
%8 = sitofp i32 %7 to double
ret double %8
}
int fun128() { return 128; }


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

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

LLVM IR (-O0):
define i32 @fun128() {
ret i32 128
}

LLVM IR (-O2):
define i32 @fun128() {
ret i32 128
}
/* Variables and functions */
int /*<<< orphan*/ Mpu6000SettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void Mpu6000SettingsUpdated() { UAVObjUpdated(Mpu6000SettingsHandle()); }


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

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

LLVM IR (-O0):
define void @Mpu6000SettingsUpdated() {
%1 = call i32 (...) @Mpu6000SettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Mpu6000SettingsUpdated() {
%1 = tail call i32 (...) @Mpu6000SettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
int test_imm_55uint8_reg(unsigned char val) {
  return ((val) & (0x55 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_55uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x55,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_55uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 85
%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_55uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 85
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *mmalloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *nil(void) {
  char *output = mmalloc(5);
  strcpy(output, "nil\n");
  return output;
}


x86 assembly (clang, -O0):
<nil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1040 <mmalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nil>:
push   %rbx
mov    $0x5,%edi
call   1040 <mmalloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"nil\0A\00"
define i8* @nil() {
%1 = tail call i8* @mmalloc(i32 5)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
scalar_t__ strtol(char const *, char **, int);
int ParseBase(const char *str, int base, int *result, char last) {
  char *p;
  int i;
  *result = (int)strtol(str, &p, base);
  return *p == last;
}


x86 assembly (clang, -O0):
<ParseBase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    -0x28(%rbp),%rsi
call   1030 <strtol@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseBase>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
mov    %esi,%edx
mov    %rsp,%rsi
call   1030 <strtol@plt>
mov    %eax,(%rbx)
mov    (%rsp),%rcx
xor    %eax,%eax
cmp    %bpl,(%rcx)
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ParseBase(i8* %0, i32 %1, i32* %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i8 %3, i8* %8
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i64 @strtol(i8* %11, i8** %9, i32 %12)
%14 = trunc i64 %13 to i32
%15 = load i32*, i32** %7
store i32 %14, i32* %15
%16 = load i8*, i8** %9
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i8, i8* %8
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %18, %20
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @ParseBase(i8* %0, i32 %1, i32* nocapture writeonly %2, i8 signext %3) {
%5 = alloca i8*
%6 = bitcast i8** %5 to i8*
%7 = call i64 @strtol(i8* %0, i8** %5, i32 %1)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %2
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %3
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int strlen(char *);
char *trim(char *p) {
  while (p[strlen(p) - 1] == ' ')
    p[strlen(p) - 1] = '\0';
  return p;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    116c <trim+0x5c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    111c <trim+0xc>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <strlen@plt>
cltq
cmpb   $0x20,-0x1(%rax,%rbx,1)
jne    1142 <trim+0x32>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
jmp    1120 <trim+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @trim(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 32
br i1 %7, label %8, label %19
8: ; preds = %1, %8
%9 = tail call i32 @strlen(i8* %0)
%10 = add nsw i32 %9, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
%13 = tail call i32 @strlen(i8* %0)
%14 = add nsw i32 %13, -1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 32
br i1 %18, label %8, label %19
19: ; preds = %8, %1
ret i8* %0
}
/* Variables and functions */
unsigned char *blake2s_buffer(unsigned char *, unsigned char const *, size_t,
                              int /*<<< orphan*/ *, int /*<<< orphan*/);
unsigned char *hash_buffer_blake2s(unsigned char *out, const unsigned char *in,
                                   size_t in_len) {
  return blake2s_buffer(out, in, in_len, NULL, 0);
}


x86 assembly (clang, -O0):
<hash_buffer_blake2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <blake2s_buffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_buffer_blake2s>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <blake2s_buffer@plt>

LLVM IR (-O0):
define i8* @hash_buffer_blake2s(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @blake2s_buffer(i8* %7, i8* %8, i64 %9, i32* null, i32 0)
ret i8* %10
}

LLVM IR (-O2):
define i8* @hash_buffer_blake2s(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @blake2s_buffer(i8* %0, i8* %1, i64 %2, i32* null, i32 0)
ret i8* %4
}
int _lth(int x, int y, void *garb) { return x < y; }


x86 assembly (clang, -O0):
<_lth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lth>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @_lth(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @_lth(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp slt i32 %0, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ msgBlankif(int, int *);
void msg_blankif_(int *const PRIOR, int *const STATUS) {
  int status;
  int prior;
  status = *STATUS;
  prior = *PRIOR;
  msgBlankif(prior, &status);
  *STATUS = status;
}


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

x86 assembly (clang, -O2):
<msg_blankif_>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    (%rsi),%eax
mov    %eax,0xc(%rsp)
mov    (%rdi),%edi
lea    0xc(%rsp),%rsi
call   1030 <msgBlankif@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @msg_blankif_(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* %1
store i32 %5, i32* %3
%6 = load i32, i32* %0
%7 = call i32 @msgBlankif(i32 %6, i32* %3)
%8 = load i32, i32* %3
store i32 %8, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int a;
  scanf("%d", &a);
  printf("%d", a);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ angle2;
};
typedef TYPE_1__ XArc;

/* Variables and functions */
short get_XArc_angle2(void *_p) { return (short)((XArc *)_p)->angle2; }


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

x86 assembly (clang, -O2):
<get_XArc_angle2>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define signext i16 @get_XArc_angle2(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Variables and functions */
int fetch_and_add(int *, int);
int add_and_fetch(int *a, int b) { return fetch_and_add(a, b) + b; }


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

x86 assembly (clang, -O2):
<add_and_fetch>:
push   %rbx
mov    %esi,%ebx
call   1030 <fetch_and_add@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @add_and_fetch(i32* %0, i32 %1) {
%3 = tail call i32 @fetch_and_add(i32* %0, i32 %1)
%4 = add nsw i32 %3, %1
ret i32 %4
}
unsigned short VDP_getScanlineNumber() {
  if ((*(volatile unsigned short *)(0xC00004)) & ((1 << 0)))
    return 312;
  else
    return 262;
}


x86 assembly (clang, -O0):
<VDP_getScanlineNumber>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc00004,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1126 <VDP_getScanlineNumber+0x26>
movw   $0x138,-0x2(%rbp)
jmp    112c <VDP_getScanlineNumber+0x2c>
movw   $0x106,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VDP_getScanlineNumber>:
movzwl 0xc00004,%eax
test   $0x1,%al
mov    $0x106,%ecx
mov    $0x138,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @VDP_getScanlineNumber() {
%1 = alloca i16
%2 = load volatile i16, i16* inttoptr (i64 12582916 to i16*)
%3 = zext i16 %2 to i32
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i16 312, i16* %1
br label %8
7: ; preds = %0
store i16 262, i16* %1
br label %8
8: ; preds = %7, %6
%9 = load i16, i16* %1
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @VDP_getScanlineNumber() {
%1 = load volatile i16, i16* inttoptr (i64 12582916 to i16*)
%2 = and i16 %1, 1
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i16 262, i16 312
ret i16 %4
}
/* Type definitions */
struct test {
  int dummy;
};

/* Variables and functions */
void priv_clock_settime_cleanup(int asroot, int injail, struct test *test) {}


x86 assembly (clang, -O0):
<priv_clock_settime_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test = type { i32 }
define void @priv_clock_settime_cleanup(i32 %0, i32 %1, %struct.test* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.test*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.test* %2, %struct.test** %6
ret void
}

LLVM IR (-O2):
%struct.test = type { i32 }
define void @priv_clock_settime_cleanup(i32 %0, i32 %1, %struct.test* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char **argv) {
  fprintf(stderr, "Usage: %s [-a HASH] [FILE]...\n", argv[0]);
  fprintf(stderr, "\tHASH in blake2b blake2s blake2bp blake2sp\n");
  exit(111);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x6f,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%eax
mov    (%rdi),%rdx
lea    0xecc(%rip),%rsi
mov    %eax,%edi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x6f,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: %s [-a HASH] [FILE]...\0A\00"
@.str.1 = [44 x i8] c"\09HASH in blake2b blake2s blake2bp blake2sp\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 111)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: %s [-a HASH] [FILE]...\0A\00"
@.str.1 = [44 x i8] c"\09HASH in blake2b blake2s blake2bp blake2sp\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @exit(i32 111)
unreachable
}
/* Variables and functions */
float atan(float);
float call_atanf(float x) { return atan((float)x); }


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

x86 assembly (clang, -O2):
<call_atanf>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define float @call_atanf(float %0) {
%2 = tail call float @atan(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printfloathex(float value) {
  union {
    float fval;
    int ival;
  } u;
  u.fval = value;
  printf("0x%08x\n", u.ival);
}


x86 assembly (clang, -O0):
<printfloathex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printfloathex>:
movd   %xmm0,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%union.anon = type { float }
@.str = [8 x i8] c"0x%08x\0A\00"
define void @printfloathex(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"0x%08x\0A\00"
define void @printfloathex(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drftb1(int, float *, float *, float *, int *);
void __ogg_fdrfftb(int n, float *r, float *wsave, int *ifac) {
  if (n == 1)
    return;
  drftb1(n, r, wsave, wsave + n, ifac);
}


x86 assembly (clang, -O0):
<__ogg_fdrfftb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1136 <__ogg_fdrfftb+0x26>
jmp    1159 <__ogg_fdrfftb+0x49>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
mov    -0x20(%rbp),%r8
call   1030 <drftb1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ogg_fdrfftb>:
cmp    $0x1,%edi
jne    1116 <__ogg_fdrfftb+0x6>
ret
mov    %rcx,%r8
movslq %edi,%rax
lea    (%rdx,%rax,4),%rcx
jmp    1030 <drftb1@plt>

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

LLVM IR (-O2):
define void @__ogg_fdrfftb(i32 %0, float* %1, float* %2, i32* %3) {
%5 = icmp eq i32 %0, 1
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds float, float* %2, i64 %7
%9 = tail call i32 @drftb1(i32 %0, float* %1, float* %2, float* %8, i32* %3)
br label %10
10: ; preds = %4, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fA() { printf("Press a\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"Press a\00"
define void @fA() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
int CharacterIsUppercase(char ch) { return ((ch >= 'A') && (ch <= 'Z')); }


x86 assembly (clang, -O0):
<CharacterIsUppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <CharacterIsUppercase+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharacterIsUppercase>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @CharacterIsUppercase(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @CharacterIsUppercase(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
bool nrf52_errata_180(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_180() {
ret i32 0
}
long f(long a, long b) {
  if (__builtin_expect(b == 1, 1))
    return a;
  return a / b;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     1132 <f+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1140 <f+0x40>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
cmp    $0x1,%rsi
jne    110a <f+0xa>
ret
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111c <f+0x1c>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

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

LLVM IR (-O2):
define i64 @f(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i64 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ %0, %2 ]
ret i64 %7
}
unsigned int get_endian_mode(void) {
  unsigned short us = 0x1122;
  unsigned char uc = *(unsigned char *)&us;
  if (uc == 0x11)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<get_endian_mode>:
push   %rbp
mov    %rsp,%rbp
movw   $0x1122,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x7(%rbp)
movzbl -0x7(%rbp),%eax
cmp    $0x11,%eax
jne    1129 <get_endian_mode+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1130 <get_endian_mode+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_endian_mode() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i8
store i16 4386, i16* %2
%4 = bitcast i16* %2 to i8*
%5 = load i8, i8* %4
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 17
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_endian_mode() {
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
char *strcpy(char *, char *);
int strlen(char *);
char *Aig_UtilStrsav(char *s) {
  return s ? strcpy(((char *)malloc(sizeof(char) * (strlen(s) + 1))), s) : NULL;
}


x86 assembly (clang, -O0):
<Aig_UtilStrsav>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1175 <Aig_UtilStrsav+0x45>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x10(%rbp)
jmp    1180 <Aig_UtilStrsav+0x50>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1180 <Aig_UtilStrsav+0x50>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Aig_UtilStrsav>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1159 <Aig_UtilStrsav+0x29>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115c <Aig_UtilStrsav+0x2c>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @Aig_UtilStrsav(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 %5, label %16
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
%14 = load i8*, i8** %2
%15 = call i8* @strcpy(i8* %13, i8* %14)
br label %17
16: ; preds = %1
br label %17
17: ; preds = %16, %5
%18 = phi i8* [ %15, %5 ], [ null, %16 ]
ret i8* %18
}

LLVM IR (-O2):
define i8* @Aig_UtilStrsav(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i8* @strcpy(i8* dereferenceable(1) %7, i8* %0)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
void g_list_reverse() {}


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

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

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

LLVM IR (-O2):
define void @g_list_reverse() {
ret void
}
/* Variables and functions */
int b();
main() { return b(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @b()
ret i32 %1
}