xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void test_vmvn_u16x8(uint16_t *__restrict__ dest, uint16_t *a) {
  int i;
  for (i = 0; i < 8; i++) {
    dest[i] = ~a[i];
  }
}


x86 assembly (clang, -O0):
<test_vmvn_u16x8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1144 <test_vmvn_u16x8+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <test_vmvn_u16x8+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vmvn_u16x8>:
movdqu (%rsi),%xmm0
pcmpeqd %xmm1,%xmm1
pxor   %xmm1,%xmm0
movdqu %xmm0,(%rdi)
movdqu 0x10(%rsi),%xmm0
pxor   %xmm1,%xmm0
movdqu %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vmvn_u16x8(i32* noalias nocapture writeonly %0, i32* nocapture %1) {
%3 = bitcast i32* %1 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = xor <4 x i32> %4, <i32 -1, i32 -1, i32 -1, i32 -1>
%6 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %1, i64 4
%8 = getelementptr inbounds i32, i32* %0, i64 4
%9 = bitcast i32* %7 to <4 x i32>*
%10 = load <4 x i32>, <4 x i32>* %9
%11 = xor <4 x i32> %10, <i32 -1, i32 -1, i32 -1, i32 -1>
%12 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %12
ret void
}
int bitAnd(int a, int b) {}


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

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

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

LLVM IR (-O2):
define i32 @bitAnd(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
double frexp(double, int *);
double c_frexp(double arg0, int *arg1) { return frexp(arg0, arg1); }


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

x86 assembly (clang, -O2):
<c_frexp>:
jmp    1030 <frexp@plt>

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

LLVM IR (-O2):
define double @c_frexp(double %0, i32* nocapture %1) {
%3 = tail call double @frexp(double %0, i32* %1)
ret double %3
}
char *my_memory(char *dest, const char *src, unsigned int n) {
  void *_ret = dest;
  __asm__("cld;rep;movsb" ::"D"((void *)(_ret)), "S"((void *)(src)), "c"((n)));
  return _ret;
}


x86 assembly (clang, -O0):
<my_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
cld
rep movsb %ds:(%rsi),%es:(%rdi)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_memory>:
mov    %edx,%ecx
cld
rep movsb %ds:(%rsi),%es:(%rdi)
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @my_memory(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
ret i8* %12
}

LLVM IR (-O2):
define i8* @my_memory(i8* returned %0, i8* %1, i32 %2) {
tail call void asm sideeffect "cld;rep;movsb", "{di},{si},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1, i32 %2)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_screen();
int /*<<< orphan*/ setup_screen();
int /*<<< orphan*/ zombie_wrap();
int main() {
  setup_screen();
  zombie_wrap();
  cleanup_screen();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup_screen()
%2 = tail call i32 (...) @zombie_wrap()
%3 = tail call i32 (...) @cleanup_screen()
ret i32 0
}
/* Variables and functions */
int fib_accum(int, int, int);
int __dynamic_fn_entry_point__(void *args, void *result) {
  int fib_result;
  fib_result = fib_accum(*(int *)args, 1, 1);
  *(int *)result = fib_result;
  return 0;
}


x86 assembly (clang, -O0):
<__dynamic_fn_entry_point__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fib_accum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dynamic_fn_entry_point__>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fib_accum@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__dynamic_fn_entry_point__(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = call i32 @fib_accum(i32 %8, i32 1, i32 1)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @__dynamic_fn_entry_point__(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @fib_accum(i32 %4, i32 1, i32 1)
%6 = bitcast i8* %1 to i32*
store i32 %5, i32* %6
ret i32 0
}
int int_range(int min, int max) {
  extern int int_value(void);
  int n = int_value();
  return n < min || max < n ? min : n;
}


x86 assembly (clang, -O0):
<int_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
call   1030 <int_value@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     113e <int_range+0x2e>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1149 <int_range+0x39>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114f <int_range+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <int_value@plt>
cmp    %ebx,%eax
mov    %eax,%ecx
cmovg  %ebp,%ecx
cmp    %ebp,%eax
cmovl  %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @int_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @int_value()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10, %2
%15 = load i32, i32* %3
br label %18
16: ; preds = %10
%17 = load i32, i32* %5
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @int_range(i32 %0, i32 %1) {
%3 = tail call i32 @int_value()
%4 = icmp slt i32 %3, %0
%5 = icmp sgt i32 %3, %1
%6 = or i1 %4, %5
%7 = select i1 %6, i32 %0, i32 %3
ret i32 %7
}
int IPE1() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @IPE1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ error(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int open_listener_socket() {
  int s = socket(PF_INET, SOCK_STREAM, 0);
  if (s == -1)
    error("Can't open socket");
  return s;
}


x86 assembly (clang, -O0):
<open_listener_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    115a <open_listener_socket+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_listener_socket>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    114d <open_listener_socket+0x2d>
lea    0xeb8(%rip),%rdi
call   1030 <error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [18 x i8] c"Can't open socket\00"
define i32 @open_listener_socket() {
%1 = alloca i32
%2 = load i32, i32* @PF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [18 x i8] c"Can't open socket\00"
define i32 @open_listener_socket() {
%1 = load i32, i32* @PF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 %3
}
unsigned long HibernateIsActive(void) {
  return ((*((volatile unsigned long *)(0x400FC010))) & 0x00000040 ? 1 : 0);
}


x86 assembly (clang, -O0):
<HibernateIsActive>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rdx
and    $0x40,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIsActive>:
mov    0x400fc010,%rax
40
shr    $0x6,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @HibernateIsActive() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, 64
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @HibernateIsActive() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = lshr i64 %1, 6
%3 = and i64 %2, 1
ret i64 %3
}
void DesMem(void *buf, int size, int encrypt) {}


x86 assembly (clang, -O0):
<DesMem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @DesMem(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @DesMem(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int sem_unlink(char *);
void deletesem() {
  if (sem_unlink("send") == -1 || sem_unlink("rec") == -1) {
    printf("delete sem failed!\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<deletesem>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <sem_unlink@plt>
cmp    $0xffffffff,%eax
je     115e <deletesem+0x2e>
lea    0xeb5(%rip),%rdi
call   1050 <sem_unlink@plt>
cmp    $0xffffffff,%eax
jne    1174 <deletesem+0x44>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<deletesem>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <sem_unlink@plt>
cmp    $0xffffffff,%eax
je     1155 <deletesem+0x25>
lea    0xebc(%rip),%rdi
call   1050 <sem_unlink@plt>
cmp    $0xffffffff,%eax
je     1155 <deletesem+0x25>
pop    %rax
ret
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"send\00"
@.str.1 = [4 x i8] c"rec\00"
@.str.2 = [20 x i8] c"delete sem failed!\0A\00"
define void @deletesem() {
%1 = call i32 @sem_unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i32 @sem_unlink(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3, %0
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"send\00"
@.str.1 = [4 x i8] c"rec\00"
@str = [19 x i8] c"delete sem failed!\00"
define void @deletesem() {
%1 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @sem_unlink(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3, %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sidTable();
int /*<<< orphan*/ sineTable();
int main(int argc, char *argv[]) {
  sidTable();
  sineTable();
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sidTable()
%4 = tail call i32 (...) @sineTable()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n = 5;
  int times;
  scanf("%d", &times);
  printf("%d", times * n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0x4(%rbp),%esi
lea    0xeb3(%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),%eax
lea    (%rax,%rax,4),%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 = alloca i32
store i32 5, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = mul nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
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 = mul nsw i32 %4, 5
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int av_isdigit(int c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<av_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <av_isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @av_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ strcasecmp(int /*<<< orphan*/, char *);
int /*<<< orphan*/ truncsp(char *);
int is_eof(char *str) {
  return (*str == '!' && strcasecmp(truncsp(str), "!eof") == 0);
}


x86 assembly (clang, -O0):
<is_eof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x21,%ecx
mov    %al,-0x9(%rbp)
jne    1162 <is_eof+0x42>
mov    -0x8(%rbp),%rdi
call   1040 <truncsp@plt>
mov    %eax,%edi
lea    0xead(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_eof>:
push   %rax
xor    %eax,%eax
cmpb   $0x21,(%rdi)
jne    1146 <is_eof+0x26>
call   1040 <truncsp@plt>
lea    0xecc(%rip),%rsi
mov    %eax,%edi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"!eof\00"
define i32 @is_eof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 33
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @truncsp(i8* %8)
%10 = call i64 @strcasecmp(i32 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"!eof\00"
define i32 @is_eof(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 33
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @truncsp(i8* %0)
%6 = tail call i64 @strcasecmp(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int __recvn(int, void *, size_t, int);
void Recvn(int fd, void *buf, size_t count, int flags) {
  ssize_t ret;
  ret = __recvn(fd, buf, count, flags);
  if (ret == -1) {
    Sys_failure("Recvn");
  }
}


x86 assembly (clang, -O0):
<Recvn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <__recvn@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    1162 <Recvn+0x42>
lea    0xea3(%rip),%rdi
call   1040 <Sys_failure@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Recvn>:
push   %rax
call   1030 <__recvn@plt>
cmp    $0xffffffff,%eax
je     112d <Recvn+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <Sys_failure@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Recvn\00"
define void @Recvn(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i32, i32* %8
%14 = call i32 @__recvn(i32 %10, i8* %11, i64 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %19
17: ; preds = %4
%18 = call i32 @Sys_failure(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %4
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Recvn\00"
define void @Recvn(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @__recvn(i32 %0, i8* %1, i64 %2, i32 %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t SysCtlSRAMSizeGet(void) {
  return (((*((volatile unsigned long *)(0x400FDFC4))) + 1) * 256);
}


x86 assembly (clang, -O0):
<SysCtlSRAMSizeGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fdfc4,%eax
mov    (%rax),%rax
add    $0x1,%rax
shl    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlSRAMSizeGet>:
mov    0x400fdfc4,%rax
40
shl    $0x8,%rax
add    $0x100,%rax
ret

LLVM IR (-O0):
define i64 @SysCtlSRAMSizeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782148 to i64*)
%2 = add i64 %1, 1
%3 = mul i64 %2, 256
ret i64 %3
}

LLVM IR (-O2):
define i64 @SysCtlSRAMSizeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782148 to i64*)
%2 = shl i64 %1, 8
%3 = add i64 %2, 256
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_25519_opp(uintptr_t, uintptr_t);
void fiat_25519_opp(uint64_t out1[5], const uint64_t arg1[5]) {
  internal_fiat_25519_opp((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_25519_opp>:
jmp    1030 <internal_fiat_25519_opp@plt>

LLVM IR (-O0):
define void @fiat_25519_opp(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_25519_opp(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_25519_opp(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_25519_opp(i64 %3, i64 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *open_timing_log() { return fopen("timing.txt", "w"); }


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

x86 assembly (clang, -O2):
<open_timing_log>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"timing.txt\00"
@.str.1 = [2 x i8] c"w\00"
define i32* @open_timing_log() {
%1 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32* %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"timing.txt\00"
@.str.1 = [2 x i8] c"w\00"
define noalias i32* @open_timing_log() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32* %1
}
OP(ed, f8) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_2()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ceil(int);
int log(int);
scalar_t__ pow(int, int /*<<< orphan*/);
int findPowerCeil(int input) { return (int)pow(2, ceil(log(input) / log(2))); }


x86 assembly (clang, -O0):
<findPowerCeil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <log@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
mov    %eax,%esi
mov    $0x2,%edi
call   1050 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findPowerCeil>:
push   %rbx
call   1040 <log@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
mov    $0x2,%edi
mov    %eax,%esi
pop    %rbx
jmp    1050 <pow@plt>

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

LLVM IR (-O2):
define i32 @findPowerCeil(i32 %0) {
%2 = tail call i32 @log(i32 %0)
%3 = tail call i32 @log(i32 2)
%4 = sdiv i32 %2, %3
%5 = tail call i32 @ceil(i32 %4)
%6 = tail call i64 @pow(i32 2, i32 %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}
int troca(int *xp, int y) {
  int x = *xp;
  *xp = y;
  return x;
}


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

x86 assembly (clang, -O2):
<troca>:
mov    (%rdi),%eax
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @troca(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
store i32 %1, i32* %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ parseConfigurationFileOptions();
int /*<<< orphan*/ parseEnvironmentOptions();
extern void readOptionConfiguration() {
  parseConfigurationFileOptions();
  parseEnvironmentOptions();
}


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

x86 assembly (clang, -O2):
<readOptionConfiguration>:
push   %rax
xor    %eax,%eax
call   1030 <parseConfigurationFileOptions@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <parseEnvironmentOptions@plt>

LLVM IR (-O0):
define void @readOptionConfiguration() {
%1 = call i32 (...) @parseConfigurationFileOptions()
%2 = call i32 (...) @parseEnvironmentOptions()
ret void
}

LLVM IR (-O2):
define void @readOptionConfiguration() {
%1 = tail call i32 (...) @parseConfigurationFileOptions()
%2 = tail call i32 (...) @parseEnvironmentOptions()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void isplativost(char *naziv_piva, float kolicina, float cijena,
                 char *najboljePivo, float *najboljaCijena) {
  float cijenaPoLitri = cijena / kolicina;
  if (cijenaPoLitri < *najboljaCijena) {
    strcpy(najboljePivo, naziv_piva);
    *najboljaCijena = cijenaPoLitri;
  }
}


x86 assembly (clang, -O0):
<isplativost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movss  -0x10(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    116d <isplativost+0x5d>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
movss  -0x24(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isplativost>:
push   %rbx
sub    $0x10,%rsp
divss  %xmm0,%xmm1
movss  (%rdx),%xmm0
ucomiss %xmm1,%xmm0
jbe    1143 <isplativost+0x33>
mov    %rdx,%rbx
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
movss  %xmm1,0xc(%rsp)
call   1030 <strcpy@plt>
movss  0xc(%rsp),%xmm0
movss  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @isplativost(i8* %0, float %1, float %2, i8* %3, float* %4) {
%6 = alloca i8*
%7 = alloca float
%8 = alloca float
%9 = alloca i8*
%10 = alloca float*
%11 = alloca float
store i8* %0, i8** %6
store float %1, float* %7
store float %2, float* %8
store i8* %3, i8** %9
store float* %4, float** %10
%12 = load float, float* %8
%13 = load float, float* %7
%14 = fdiv float %12, %13
store float %14, float* %11
%15 = load float, float* %11
%16 = load float*, float** %10
%17 = load float, float* %16
%18 = fcmp olt float %15, %17
br i1 %18, label %19, label %25
19: ; preds = %5
%20 = load i8*, i8** %9
%21 = load i8*, i8** %6
%22 = call i32 @strcpy(i8* %20, i8* %21)
%23 = load float, float* %11
%24 = load float*, float** %10
store float %23, float* %24
br label %25
25: ; preds = %19, %5
ret void
}

LLVM IR (-O2):
define void @isplativost(i8* %0, float %1, float %2, i8* %3, float* nocapture %4) {
%6 = fdiv float %2, %1
%7 = load float, float* %4
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @strcpy(i8* %3, i8* %0)
store float %6, float* %4
br label %11
11: ; preds = %9, %5
ret void
}
/* Variables and functions */
bool nrf51_errata_21(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_21() {
ret i32 0
}
int test_imm_1Bint8_mem(signed char *val) {
  return ((*val) & (0x1B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Bint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 27
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
int copyVec(double tgt[], double src[], int n) {
  memcpy(tgt, src, n * sizeof(double));
  return 0;
}


x86 assembly (clang, -O0):
<copyVec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyVec>:
push   %rax
shl    $0x3,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @copyVec(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(double* %7, double* %8, i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @copyVec(double* %0, double* %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = tail call i32 @memcpy(double* %0, double* %1, i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t downcast_8(uint64_t x) {
  int8_t y = (int8_t)x;
  return y;
}


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

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

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

LLVM IR (-O2):
define i32 @downcast_8(i32 returned %0) {
ret i32 %0
}
DEFINE_TEST(test_password_to_key) { return password_testall(); }


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

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

LLVM IR (-O0):
define i32 @DEFINE_TEST(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @password_testall()
ret i32 %3
}

LLVM IR (-O2):
define i32 @DEFINE_TEST(i32 %0) {
%2 = tail call i32 (...) @password_testall()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void SIGUSR2_handler(int signo __attribute__((unused))) {
  printf("do nothing useful\n");
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"do nothing useful\0A\00"
define void @SIGUSR2_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"do nothing useful\00"
define void @SIGUSR2_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _free0(void **ptr) {
  free(*ptr);
  *ptr = NULL;
}


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

x86 assembly (clang, -O2):
<_free0>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @_free0(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
int http_connect(char *url) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @http_connect(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int cbmarch_driver_open(int *, int);
int cbm_driver_open(int *HandleDevice, int PortNumber) {
  ;
  return cbmarch_driver_open(HandleDevice, PortNumber);
}


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

x86 assembly (clang, -O2):
<cbm_driver_open>:
jmp    1030 <cbmarch_driver_open@plt>

LLVM IR (-O0):
define i32 @cbm_driver_open(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 @cbmarch_driver_open(i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbm_driver_open(i32* %0, i32 %1) {
%3 = tail call i32 @cbmarch_driver_open(i32* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ init();
int /*<<< orphan*/ interact();
int32_t main() {
  alarm(60);
  init();
  while (1) {
    interact();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3c,%edi
call   1040 <alarm@plt>
mov    $0x0,%al
call   1050 <init@plt>
mov    $0x0,%al
call   1030 <interact@plt>
jmp    1150 <main+0x20>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3c,%edi
call   1040 <alarm@plt>
xor    %eax,%eax
call   1050 <init@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <interact@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @alarm(i32 60)
%3 = call i32 (...) @init()
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @interact()
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @alarm(i32 60)
%2 = tail call i32 (...) @init()
br label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @interact()
br label %3
}
void gtk_tree_row_reference_valid() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_row_reference_valid() {
ret void
}
int isSpace(int c) {
  switch (c) {
  case 0x20:
  case 0xD:
  case 0xA:
  case 0x9:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1140 <isSpace+0x40>
jmp    111e <isSpace+0x1e>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     1140 <isSpace+0x40>
jmp    112f <isSpace+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    114c <isSpace+0x4c>
jmp    1140 <isSpace+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1153 <isSpace+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSpace>:
cmp    $0x20,%edi
ja     111d <isSpace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    111d <isSpace+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isSpace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 32, label %5
i32 13, label %5
i32 10, label %5
i32 9, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @isSpace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 13, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void null_flush(void *ui) {}


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

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

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

LLVM IR (-O2):
define void @null_flush(i8* nocapture %0) {
ret void
}
void gtk_window_group_add_window() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_group_add_window() {
ret void
}
void foo() {
  unsigned long l;
  void *p = 0;
  __builtin_unwind_init();
  l = 0;
  __builtin_eh_return(l, p);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rdx
push   %rax
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdi
mov    %rbp,%rcx
mov    %rdi,0x8(%rcx,%rsi,1)
lea    0x8(%rcx,%rsi,1),%rcx
pop    %rax
pop    %rdx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
mov    %rcx,%rsp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rdx
push   %rax
movq   $0x0,0x8(%rbp)
lea    0x8(%rbp),%rcx
pop    %rax
pop    %rdx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
mov    %rcx,%rsp
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i64
%2 = alloca i8*
store i8* null, i8** %2
store i64 0, i64* %1
%3 = load i64, i64* %1
%4 = load i8*, i8** %2
unreachable
}

LLVM IR (-O2):
define void @foo() {
tail call void @llvm.eh.unwind.init()
tail call void @llvm.eh.return.i64(i64 0, i8* null)
unreachable
}
int *voidtoint(const void *source) { return (int *)source; }


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

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

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

LLVM IR (-O2):
define i32* @voidtoint(i8* readnone %0) {
%2 = bitcast i8* %0 to i32*
ret i32* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int cfg_check_config_file(char *filename) {
  FILE *file;
  int result = 0;
  file = fopen(filename, "r");
  if (file == NULL)
    result = -1;
  else
    fclose(file);
  return result;
}


x86 assembly (clang, -O0):
<cfg_check_config_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115e <cfg_check_config_file+0x3e>
movl   $0xffffffff,-0x14(%rbp)
jmp    1167 <cfg_check_config_file+0x47>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfg_check_config_file>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     113e <cfg_check_config_file+0x1e>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @cfg_check_config_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}