xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *const, char *, char *);
void read_skip_const_c(const char *const line, const char *const var) {
  sscanf(line, "%*s %s", (char *)var);
}


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

x86 assembly (clang, -O2):
<read_skip_const_c>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <sscanf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%*s %s\00"
define void @read_skip_const_c(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%*s %s\00"
define void @read_skip_const_c(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t highest_set_bit64(uint64_t val) {
  uint64_t counter = 0;
  while (val >>= 1)
    counter++;
  return counter;
}


x86 assembly (clang, -O0):
<highest_set_bit64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <highest_set_bit64+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <highest_set_bit64+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<highest_set_bit64>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <highest_set_bit64+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <highest_set_bit64+0x10>
ret

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

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


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

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

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

LLVM IR (-O2):
define void @XSecurityFreeXauth() {
ret void
}
int max(int x, int y) {
  int z;
  if (x > y)
    z = x;
  else
    z = y;
  return (z);
}


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int test_imm_28int64_lowword_mem(long long *val) {
  return ((*val) & (0x28 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_28int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 40
%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_28int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 40
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void put_unaligned_be16(uint16_t val, void *ptr) {
  uint8_t *p = ptr;
  p[0] = val >> 8;
  p[1] = val;
}


x86 assembly (clang, -O0):
<put_unaligned_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_unaligned_be16>:
mov    %edi,%eax
sar    $0x8,%eax
mov    %eax,(%rsi)
mov    %edi,0x4(%rsi)
ret

LLVM IR (-O0):
define void @put_unaligned_be16(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %3
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %3
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @put_unaligned_be16(i32 %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i32*
%4 = ashr i32 %0, 8
store i32 %4, i32* %3
%5 = getelementptr inbounds i8, i8* %1, i64 4
%6 = bitcast i8* %5 to i32*
store i32 %0, i32* %6
ret void
}
int llvm_testandset(volatile int *p) {
  int ret = 0;
  asm volatile("lock; cmpxchgl %2, %0" : "+m"(*p), "+a"(ret) : "r"(1) : "cc");
  return ret;
}


x86 assembly (clang, -O0):
<llvm_testandset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    $0x1,%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llvm_testandset>:
mov    $0x1,%ecx
xor    %eax,%eax
lock cmpxchg %ecx,(%rdi)
ret

LLVM IR (-O0):
define i32 @llvm_testandset(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = load i32, i32* %3
%6 = call i32 asm sideeffect "lock; cmpxchgl $2, $0", "=*m,={ax},r,*m,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %4, i32 1, i32* elementtype(i32) %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @llvm_testandset(i32* %0) {
%2 = tail call i32 asm sideeffect "lock; cmpxchgl $2, $0", "=*m,={ax},r,*m,1,~{cc},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 1, i32* elementtype(i32) %0, i32 0)
ret i32 %2
}
int test_imm_81int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x81 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_81int64_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, 129
%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_81int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 554050781184
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cpu_arm920_mmu_init();
void mmu_init(void) { cpu_arm920_mmu_init(); }


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

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

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

LLVM IR (-O2):
define void @mmu_init() {
%1 = tail call i32 (...) @cpu_arm920_mmu_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, int, unsigned int);
int main(int argc, char *argv[]) {
  unsigned char maxc = 255;
  unsigned char c = maxc << 1;
  printf("%u << %u : unsigned char c = %u\n", maxc, 1, c);
  unsigned int i = maxc << 1;
  printf("%u << %u : unsigned int i = %u\n", maxc, 1, i);
  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)
movb   $0xff,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x12(%rbp)
mov    -0x11(%rbp),%al
movzbl -0x12(%rbp),%ecx
lea    0xebe(%rip),%rdi
mov    $0x1,%edx
movzbl %al,%esi
call   1030 <printf@plt>
movzbl -0x11(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x11(%rbp),%al
mov    -0x18(%rbp),%ecx
lea    0xebb(%rip),%rdi
mov    $0x1,%edx
movzbl %al,%esi
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    $0xff,%esi
mov    $0x1,%edx
mov    $0xfe,%ecx
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0xff,%esi
mov    $0x1,%edx
mov    $0x1fe,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"%u << %u : unsigned char c = %u\0A\00"
@.str.1 = [32 x i8] c"%u << %u : unsigned int i = %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 -1, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %7
%13 = load i8, i8* %6
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8 zeroext %13, i32 1, i32 %15)
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 1
store i32 %19, i32* %8
%20 = load i8, i8* %6
%21 = load i32, i32* %8
%22 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %20, i32 1, i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"%u << %u : unsigned char c = %u\0A\00"
@.str.1 = [32 x i8] c"%u << %u : unsigned int i = %u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8 zeroext -1, i32 1, i32 254)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8 zeroext -1, i32 1, i32 510)
ret i32 0
}
/* Variables and functions */
char *getprop2(char const *, int /*<<< orphan*/);
char *getprop(const char *name) { return getprop2(name, 0); }


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

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

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

LLVM IR (-O2):
define i8* @getprop(i8* %0) {
%2 = tail call i8* @getprop2(i8* %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void greeting() { printf("Hello, Josh\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello, Josh\00"
define void @greeting() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("It is expected to be valid\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"It is expected to be valid\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"It is expected to be valid\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned char floor(double);
double log(unsigned short);
unsigned char mylog(unsigned short arg, unsigned short min,
                    unsigned short max) {
  double ln = log(arg - min) / log(max - min);
  return floor(ln * 255);
}


x86 assembly (clang, -O0):
<mylog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
sub    %ecx,%eax
movzwl %ax,%edi
call   1030 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x4(%rbp),%ecx
sub    %ecx,%eax
movzwl %ax,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe81(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mylog>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
sub    %esi,%edi
movzwl %di,%edi
call   1030 <log@plt>
movsd  %xmm0,(%rsp)
sub    %ebp,%ebx
movzwl %bx,%edi
call   1030 <log@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
mulsd  0xeaf(%rip),%xmm1
movapd %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <floor@plt>

LLVM IR (-O0):
define zeroext i8 @mylog(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
%7 = alloca double
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = load i16, i16* %5
%11 = zext i16 %10 to i32
%12 = sub nsw i32 %9, %11
%13 = trunc i32 %12 to i16
%14 = call double @log(i16 zeroext %13)
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = load i16, i16* %5
%18 = zext i16 %17 to i32
%19 = sub nsw i32 %16, %18
%20 = trunc i32 %19 to i16
%21 = call double @log(i16 zeroext %20)
%22 = fdiv double %14, %21
store double %22, double* %7
%23 = load double, double* %7
%24 = fmul double %23, 2.550000e+02
%25 = call zeroext i8 @floor(double %24)
ret i8 %25
}

LLVM IR (-O2):
define zeroext i8 @mylog(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
%4 = sub i16 %0, %1
%5 = tail call double @log(i16 zeroext %4)
%6 = sub i16 %2, %1
%7 = tail call double @log(i16 zeroext %6)
%8 = fdiv double %5, %7
%9 = fmul double %8, 2.550000e+02
%10 = tail call zeroext i8 @floor(double %9)
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ ru_Emit(unsigned int);
void ru_EmitI32(unsigned int value) {
  ru_Emit(value << 24 >> 24);
  ru_Emit(value << 16 >> 24);
  ru_Emit(value << 8 >> 24);
  ru_Emit(value << 0 >> 24);
}


x86 assembly (clang, -O0):
<ru_EmitI32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x18,%edi
shr    $0x18,%edi
call   1030 <ru_Emit@plt>
mov    -0x4(%rbp),%edi
shl    $0x10,%edi
shr    $0x18,%edi
call   1030 <ru_Emit@plt>
mov    -0x4(%rbp),%edi
shl    $0x8,%edi
shr    $0x18,%edi
call   1030 <ru_Emit@plt>
mov    -0x4(%rbp),%edi
shl    $0x0,%edi
shr    $0x18,%edi
call   1030 <ru_Emit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ru_EmitI32>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <ru_Emit@plt>
movzbl %bh,%edi
call   1030 <ru_Emit@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <ru_Emit@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ru_Emit@plt>

LLVM IR (-O0):
define void @ru_EmitI32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = lshr i32 %4, 24
%6 = call i32 @ru_Emit(i32 %5)
%7 = load i32, i32* %2
%8 = shl i32 %7, 16
%9 = lshr i32 %8, 24
%10 = call i32 @ru_Emit(i32 %9)
%11 = load i32, i32* %2
%12 = shl i32 %11, 8
%13 = lshr i32 %12, 24
%14 = call i32 @ru_Emit(i32 %13)
%15 = load i32, i32* %2
%16 = shl i32 %15, 0
%17 = lshr i32 %16, 24
%18 = call i32 @ru_Emit(i32 %17)
ret void
}

LLVM IR (-O2):
define void @ru_EmitI32(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @ru_Emit(i32 %2)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @ru_Emit(i32 %5)
%7 = lshr i32 %0, 16
%8 = and i32 %7, 255
%9 = tail call i32 @ru_Emit(i32 %8)
%10 = lshr i32 %0, 24
%11 = tail call i32 @ru_Emit(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void Usage(char *f) { printf("Usage: %s <threshold> < stdin > stdout\n", f); }


x86 assembly (clang, -O0):
<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):
<Usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [40 x i8] c"Usage: %s <threshold> < stdin > stdout\0A\00"
define void @Usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc21(void) {
  printf("Executing exitfunc"
         "21"
         ".\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc21>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc21>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc21.\0A\00"
define void @exitfunc21() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc21.\00"
define void @exitfunc21() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct xdg_shell {
  int dummy;
};
struct wl_proxy {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
void xdg_shell_use_unstable_version(struct xdg_shell *xdg_shell,
                                    int32_t version) {
  wl_proxy_marshal((struct wl_proxy *)xdg_shell, 0, version);
}


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

x86 assembly (clang, -O2):
<xdg_shell_use_unstable_version>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.xdg_shell = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_shell_use_unstable_version(%struct.xdg_shell* %0, i32 %1) {
%3 = alloca %struct.xdg_shell*
%4 = alloca i32
store %struct.xdg_shell* %0, %struct.xdg_shell** %3
store i32 %1, i32* %4
%5 = load %struct.xdg_shell*, %struct.xdg_shell** %3
%6 = bitcast %struct.xdg_shell* %5 to %struct.wl_proxy*
%7 = load i32, i32* %4
%8 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %6, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.xdg_shell = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_shell_use_unstable_version(%struct.xdg_shell* %0, i32 %1) {
%3 = bitcast %struct.xdg_shell* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %3, i32 0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
char base64b16(unsigned char Val) {
  const uint32_t base64b16values[4] = {
      (uint32_t)((uint32_t)'A' + ((uint32_t)'E' << 8) + ((uint32_t)'I' << 16) +
                 ((uint32_t)'M' << 24)),
      (uint32_t)((uint32_t)'Q' + ((uint32_t)'U' << 8) + ((uint32_t)'Y' << 16) +
                 ((uint32_t)'c' << 24)),
      (uint32_t)((uint32_t)'g' + ((uint32_t)'k' << 8) + ((uint32_t)'o' << 16) +
                 ((uint32_t)'s' << 24)),
      (uint32_t)((uint32_t)'w' + ((uint32_t)'0' << 8) + ((uint32_t)'4' << 16) +
                 ((uint32_t)'8' << 24))};
  return (char)((base64b16values[Val >> 2] >> ((Val & 0x03) << 3)) & 0xFF);
}


x86 assembly (clang, -O0):
<base64b16>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x18(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x2,%eax
cltq
mov    -0x20(%rbp,%rax,4),%eax
movzbl -0x1(%rbp),%ecx
and    $0x3,%ecx
shl    $0x3,%ecx
sar    %cl,%eax
and    $0xff,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64b16>:
lea    0x0(,%rdi,8),%ecx
and    $0xfffffffc,%edi
lea    0xeef(%rip),%rax
mov    (%rdi,%rax,1),%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
@__const.base64b16.base64b16values = [4 x i32] [i32 1296647489, i32 1666798929, i32 1936681831, i32 942944375]
define signext i8 @base64b16(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca [4 x i32]
store i8 %0, i8* %2
%4 = bitcast [4 x i32]* %3 to i8*
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = ashr i32 %6, 2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = and i32 %12, 3
%14 = shl i32 %13, 3
%15 = ashr i32 %10, %14
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
@__const.base64b16.base64b16values = [4 x i32] [i32 1296647489, i32 1666798929, i32 1936681831, i32 942944375]
define signext i8 @base64b16(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = lshr i32 %2, 2
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @__const.base64b16.base64b16values, i64 0, i64 %4
%6 = load i32, i32* %5
%7 = shl nuw nsw i32 %2, 3
%8 = and i32 %7, 24
%9 = ashr i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int EPERM;
int settimeofday(struct timeval *_tp, ...) { return -EPERM; }


x86 assembly (clang, -O0):
<settimeofday>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<settimeofday>:
mov    0x2ed1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@EPERM = global i32 0
define i32 @settimeofday(%struct.timeval* %0, ...) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load i32, i32* @EPERM
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@EPERM = global i32 0
define i32 @settimeofday(%struct.timeval* nocapture readnone %0, ...) {
%2 = load i32, i32* @EPERM
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
double sin(double);
double sin_lat(double lat) {
  return sin(lat * 0.017453292519943295769236907684886);
}


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

x86 assembly (clang, -O2):
<sin_lat>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @sin_lat(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3F91DF46A2529D39
%5 = call double @sin(double %4)
ret double %5
}

LLVM IR (-O2):
define double @sin_lat(double %0) {
%2 = fmul double %0, 0x3F91DF46A2529D39
%3 = tail call double @sin(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ print_arglist();
int /*<<< orphan*/ stderr;
void check_lim(int i, int argc) {
  if (i >= argc) {
    fprintf(stderr, "argument list is one short\n");
    print_arglist();
  }
}


x86 assembly (clang, -O0):
<check_lim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1156 <check_lim+0x36>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <print_arglist@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_lim>:
cmp    %esi,%edi
jge    1125 <check_lim+0x5>
ret
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <print_arglist@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"argument list is one short\0A\00"
define void @check_lim(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 = icmp sge i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @print_arglist()
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"argument list is one short\0A\00"
define void @check_lim(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @print_arglist()
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int a, x, max;
  max = __VERIFIER_nondet_int();
  if (max > 0) {
    a = 0;
    x = 1;
    while (x <= max) {
      if (__VERIFIER_nondet_int() != 0) {
        a = a + 1;
      } else {
        a = a - 1;
      }
      x = x + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1187 <main+0x77>
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1182 <main+0x72>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     116b <main+0x5b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <main+0x64>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <main+0x31>
jmp    1187 <main+0x77>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jle    112c <main+0x1c>
mov    %eax,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 1
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 1, %0 ]
%5 = tail call i32 (...) @__VERIFIER_nondet_int()
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %4, %1
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret i32 0
}
int device_is_mounted(const char *dev) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @device_is_mounted(i8* nocapture readnone %0) {
ret i32 0
}
unsigned int VerifyIndex(unsigned int i, unsigned int maxVal, const char *s) {
  ;
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @VerifyIndex(i32 returned %0, i32 %1, i8* nocapture readnone %2) {
ret i32 %0
}
void foo685() {}


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

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

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

LLVM IR (-O2):
define void @foo685() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int init(void) {
  printk("Added test module\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Added test module\0A\00"
define i32 @init() {
%1 = call i32 @printk(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Added test module\0A\00"
define i32 @init() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handle_PROF(int /*<<< orphan*/);
int gen_PROF(void) {
  handle_PROF(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<gen_PROF>:
push   %rax
xor    %edi,%edi
call   1030 <handle_PROF@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gen_PROF() {
%1 = call i32 @handle_PROF(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_PROF() {
%1 = tail call i32 @handle_PROF(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUGF(char *);
int /*<<< orphan*/ close(int);
void udp_close(int fd) {
  DEBUGF("Entered udp_close\n");
  close(fd);
  return;
}


x86 assembly (clang, -O0):
<udp_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <DEBUGF@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_close>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <DEBUGF@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"Entered udp_close\0A\00"
define void @udp_close(i32 %0) {
%2 = tail call i32 @DEBUGF(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @close(i32 %0)
ret void
}
void nrf_cel() { *(unsigned char *)0x500A &= ~(1 << 3); }


x86 assembly (clang, -O0):
<nrf_cel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x500a,%eax
movzbl (%rax),%eax
and    $0xfffffff7,%eax
mov    %al,%cl
mov    $0x500a,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_cel>:
andb   $0xf7,0x500a
f7
ret

LLVM IR (-O0):
define void @nrf_cel() {
%1 = load i8, i8* inttoptr (i64 20490 to i8*)
%2 = zext i8 %1 to i32
%3 = and i32 %2, -9
%4 = trunc i32 %3 to i8
store i8 %4, i8* inttoptr (i64 20490 to i8*)
ret void
}

LLVM IR (-O2):
define void @nrf_cel() {
%1 = load i8, i8* inttoptr (i64 20490 to i8*)
%2 = and i8 %1, -9
store i8 %2, i8* inttoptr (i64 20490 to i8*)
ret void
}
/* Variables and functions */
scalar_t__ sin(float);
float sinf(float x) { return (float)sin(x); }


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

x86 assembly (clang, -O2):
<sinf>:
push   %rax
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @sin(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @sinf(float %0) {
%2 = tail call i64 @sin(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Variables and functions */
int fail(int /*<<< orphan*/);
int test_select_(int, int, int);
int test_select(void) {
  if (test_select_(4, 5, 6) != 5)
    return fail(0);
  if (test_select_(0, 5, 6) != 6)
    return fail(0);
  return 0x80000000;
}


x86 assembly (clang, -O0):
<test_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1040 <test_select_@plt>
cmp    $0x5,%eax
je     1154 <test_select+0x34>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    1184 <test_select+0x64>
xor    %edi,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1040 <test_select_@plt>
cmp    $0x6,%eax
je     117d <test_select+0x5d>
xor    %edi,%edi
call   1030 <fail@plt>
mov    %eax,-0x4(%rbp)
jmp    1184 <test_select+0x64>
movl   $0x80000000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_select>:
push   %rax
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1040 <test_select_@plt>
cmp    $0x5,%eax
jne    1157 <test_select+0x37>
xor    %edi,%edi
mov    $0x5,%esi
mov    $0x6,%edx
call   1040 <test_select_@plt>
cmp    $0x6,%eax
jne    1157 <test_select+0x37>
mov    $0x80000000,%eax
pop    %rcx
ret
xor    %edi,%edi
pop    %rax
jmp    1030 <fail@plt>

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

LLVM IR (-O2):
define i32 @test_select() {
%1 = tail call i32 @test_select_(i32 4, i32 5, i32 6)
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @test_select_(i32 0, i32 5, i32 6)
%5 = icmp eq i32 %4, 6
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 @fail(i32 0)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ -2147483648, %3 ], [ %7, %6 ]
ret i32 %9
}
long jm_jdiv_round_up(long a, long b) { return (a + b - 1L) / b; }


x86 assembly (clang, -O0):
<jm_jdiv_round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
cqto
idivq  -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<jm_jdiv_round_up>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111a <jm_jdiv_round_up+0x1a>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @jm_jdiv_round_up(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
%8 = sub nsw i64 %7, 1
%9 = load i64, i64* %4
%10 = sdiv i64 %8, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @jm_jdiv_round_up(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = sdiv i64 %4, %1
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ out_byte(int, int);
void init_8259A() {
  out_byte(0x20, 0x11);
  out_byte(0xA0, 0x11);
  out_byte(0x21, 0x20);
  out_byte(0xA1, 0x28);
  out_byte(0x21, 0x4);
  out_byte(0xA1, 0x2);
  out_byte(0x21, 0x1);
  out_byte(0xA1, 0x1);
  out_byte(0x21, 0xFF);
  out_byte(0xA1, 0xFF);
}


x86 assembly (clang, -O0):
<init_8259A>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <out_byte@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0xff,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <out_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_8259A>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <out_byte@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0xff,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <out_byte@plt>

LLVM IR (-O0):
define void @init_8259A() {
%1 = call i32 @out_byte(i32 32, i32 17)
%2 = call i32 @out_byte(i32 160, i32 17)
%3 = call i32 @out_byte(i32 33, i32 32)
%4 = call i32 @out_byte(i32 161, i32 40)
%5 = call i32 @out_byte(i32 33, i32 4)
%6 = call i32 @out_byte(i32 161, i32 2)
%7 = call i32 @out_byte(i32 33, i32 1)
%8 = call i32 @out_byte(i32 161, i32 1)
%9 = call i32 @out_byte(i32 33, i32 255)
%10 = call i32 @out_byte(i32 161, i32 255)
ret void
}

LLVM IR (-O2):
define void @init_8259A() {
%1 = tail call i32 @out_byte(i32 32, i32 17)
%2 = tail call i32 @out_byte(i32 160, i32 17)
%3 = tail call i32 @out_byte(i32 33, i32 32)
%4 = tail call i32 @out_byte(i32 161, i32 40)
%5 = tail call i32 @out_byte(i32 33, i32 4)
%6 = tail call i32 @out_byte(i32 161, i32 2)
%7 = tail call i32 @out_byte(i32 33, i32 1)
%8 = tail call i32 @out_byte(i32 161, i32 1)
%9 = tail call i32 @out_byte(i32 33, i32 255)
%10 = tail call i32 @out_byte(i32 161, i32 255)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ left_motor_forward(int);
int /*<<< orphan*/ right_motor_forward(int);
void circle_left() {
  left_motor_forward(50 * 1.5);
  right_motor_forward(50);
}


x86 assembly (clang, -O0):
<circle_left>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4b,%edi
call   1030 <left_motor_forward@plt>
mov    $0x32,%edi
call   1040 <right_motor_forward@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle_left>:
push   %rax
mov    $0x4b,%edi
call   1030 <left_motor_forward@plt>
mov    $0x32,%edi
pop    %rax
jmp    1040 <right_motor_forward@plt>

LLVM IR (-O0):
define void @circle_left() {
%1 = call i32 @left_motor_forward(i32 75)
%2 = call i32 @right_motor_forward(i32 50)
ret void
}

LLVM IR (-O2):
define void @circle_left() {
%1 = tail call i32 @left_motor_forward(i32 75)
%2 = tail call i32 @right_motor_forward(i32 50)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hello_world() { printf("hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @hello_world() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EvalutateExpression(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int main(int argc, const char *argv[]) {
  EvalutateExpression(getchar());
  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 <getchar@plt>
mov    %eax,%edi
call   1030 <EvalutateExpression@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%edi
call   1030 <EvalutateExpression@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 (...) @getchar()
%7 = call i32 @EvalutateExpression(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 @EvalutateExpression(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int file_exists_p(const char *filename) { return access(filename, F_OK) >= 0; }


x86 assembly (clang, -O0):
<file_exists_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists_p>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @file_exists_p(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i64 @access(i8* %3, i32 %4)
%6 = icmp sge i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @file_exists_p(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, 1
ret i32 %6
}
void Hal_hook_wr_sgnarray(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_wr_sgnarray() {
ret void
}
/* Variables and functions */
double const copysignk(double, double);
__attribute__((visibility("default"))) const double xcopysign(double x,
                                                              double y) {
  return copysignk(x, y);
}


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

x86 assembly (clang, -O2):
<xcopysign>:
jmp    1030 <copysignk@plt>

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

LLVM IR (-O2):
define double @xcopysign(double %0, double %1) {
%3 = tail call double @copysignk(double %0, double %1)
ret double %3
}
__attribute__((type_annotate("tainted"))) int g() { return 2; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 2
}

LLVM IR (-O2):
define i32 @g() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ ymouse();
void basYMouse() { pushNumber(ymouse()); }


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

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

LLVM IR (-O0):
define void @basYMouse() {
%1 = call i32 (...) @ymouse()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basYMouse() {
%1 = tail call i32 (...) @ymouse()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}