xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ crc32_close(unsigned long *);
int /*<<< orphan*/ crc32_feed_bytes(unsigned long *, void const *,
                                    unsigned int);
int /*<<< orphan*/ crc32_init(unsigned long *);
unsigned long crc32(const void *buf, unsigned len) {
  unsigned long crc;
  crc32_init(&crc);
  crc32_feed_bytes(&crc, buf, len);
  crc32_close(&crc);
  return crc;
}


x86 assembly (clang, -O0):
<crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <crc32_init@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    -0x18(%rbp),%rdi
call   1030 <crc32_feed_bytes@plt>
lea    -0x18(%rbp),%rdi
call   1050 <crc32_close@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1040 <crc32_init@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <crc32_feed_bytes@plt>
mov    %r14,%rdi
call   1050 <crc32_close@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @crc32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 @crc32_init(i64* %5)
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @crc32_feed_bytes(i64* %5, i8* %7, i32 %8)
%10 = call i32 @crc32_close(i64* %5)
%11 = load i64, i64* %5
ret i64 %11
}

LLVM IR (-O2):
define i64 @crc32(i8* %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @crc32_init(i64* %3)
%6 = call i32 @crc32_feed_bytes(i64* %3, i8* %0, i32 %1)
%7 = call i32 @crc32_close(i64* %3)
%8 = load i64, i64* %3
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void leave(int i) {
  if (i == 0) {
    abort();
  }
  exit(0);
}


x86 assembly (clang, -O0):
<leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113c <leave+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<leave>:
push   %rax
test   %edi,%edi
jne    112c <leave+0xc>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @leave(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @leave(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = tail call i32 @exit(i32 0)
unreachable
}
int do_755() { return 755; }


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

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

LLVM IR (-O0):
define i32 @do_755() {
ret i32 755
}

LLVM IR (-O2):
define i32 @do_755() {
ret i32 755
}
/* Variables and functions */
char *strrchr(char *, char);
char *base_name(char *path) {
  char *s = strrchr(path, '/');
  return (s == NULL) ? path : ++s;
}


x86 assembly (clang, -O0):
<base_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <base_name+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1156 <base_name+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_name>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @base_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %13
13: ; preds = %10, %8
%14 = phi i8* [ %9, %8 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @base_name(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
double genrand_int32();
double genrand_float32_notone(void) {
  return genrand_int32() * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<genrand_float32_notone>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand_int32@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_float32_notone>:
push   %rax
xor    %eax,%eax
call   1030 <genrand_int32@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genrand_float32_notone() {
%1 = call double (...) @genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}

LLVM IR (-O2):
define double @genrand_float32_notone() {
%1 = tail call double (...) @genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}
int found_action(char symb) {
  int it;
  if (!symb)
    return (-1);
  it = -1;
  while ("+-*/%"[++it])
    if ("+-*/%"[it] == symb)
      return (it);
  return (-1);
}


x86 assembly (clang, -O0):
<found_action>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
cmpb   $0x0,-0x5(%rbp)
jne    1120 <found_action+0x20>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <found_action+0x76>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq %eax,%rcx
lea    0xec6(%rip),%rax
cmpb   $0x0,(%rax,%rcx,1)
je     116f <found_action+0x6f>
movslq -0xc(%rbp),%rcx
lea    0xeb1(%rip),%rax
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    116a <found_action+0x6a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <found_action+0x76>
jmp    1127 <found_action+0x27>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<found_action>:
add    $0xdb,%dil
mov    $0xffffffff,%eax
cmp    $0xa,%dil
ja     111d <found_action+0x1d>
movsbq %dil,%rax
lea    0xee6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"+-*/%\00"
define i32 @found_action(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 -1, i32* %2
br label %29
8: ; preds = %1
store i32 -1, i32* %4
br label %9
9: ; preds = %27, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [6 x i8], [6 x i8]* @.str, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %28
16: ; preds = %9
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [6 x i8], [6 x i8]* @.str, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %21, %23
br i1 %24, label %25, label %27
25: ; preds = %16
%26 = load i32, i32* %4
store i32 %26, i32* %2
br label %29
27: ; preds = %16
br label %9
28: ; preds = %9
store i32 -1, i32* %2
br label %29
29: ; preds = %28, %25, %7
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
@switch.table.found_action = [11 x i32] [i32 4, i32 -1, i32 -1, i32 -1, i32 -1, i32 2, i32 0, i32 -1, i32 1, i32 -1, i32 3]
define i32 @found_action(i8 signext %0) {
%2 = add i8 %0, -37
%3 = icmp ult i8 %2, 11
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.found_action, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
char *gen_unique_global_name(char *, int);
scalar_t__ xrandom(int);
char *gen_new_macro_name(void) {
  return gen_unique_global_name("M", (xrandom(3) > 0));
}


x86 assembly (clang, -O0):
<gen_new_macro_name>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <xrandom@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xebf(%rip),%rdi
call   1030 <gen_unique_global_name@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_new_macro_name>:
push   %rax
mov    $0x3,%edi
call   1040 <xrandom@plt>
xor    %esi,%esi
test   %rax,%rax
setg   %sil
lea    0xec5(%rip),%rdi
pop    %rax
jmp    1030 <gen_unique_global_name@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"M\00"
define i8* @gen_new_macro_name() {
%1 = call i64 @xrandom(i32 3)
%2 = icmp sgt i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i8* @gen_unique_global_name(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [2 x i8] c"M\00"
define i8* @gen_new_macro_name() {
%1 = tail call i64 @xrandom(i32 3)
%2 = icmp sgt i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i8* @gen_unique_global_name(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* %4
}
int main() {
  *(int *)0xdeadcee9 = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0xdeadcee9,%eax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xdeadcee9,%eax
movl   $0x0,(%rax)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store i32 0, i32* inttoptr (i64 3735932649 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
store i32 0, i32* inttoptr (i64 3735932649 to i32*)
ret i32 0
}
long syscall3(int op, unsigned int arg1, unsigned int arg2, unsigned int arg3) {
  long ret;
  asm volatile("int $0xff"
               : "=a"(ret)
               : "0"(op), "d"(arg1), "c"(arg2), "b"(arg3)
               : "cc", "edi", "esi", "memory");
  return ret;
}


x86 assembly (clang, -O0):
<syscall3>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%ebx
int    $0xff
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall3>:
push   %rbx
mov    %ecx,%ebx
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%eax
int    $0xff
pop    %rbx
ret

LLVM IR (-O0):
define i64 @syscall3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call i64 asm sideeffect "int $$0xff", "={ax},0,{dx},{cx},{bx},~{cc},~{edi},~{esi},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %11, i32 %12, i32 %13, i32 %14)
store i64 %15, i64* %9
%16 = load i64, i64* %9
ret i64 %16
}

LLVM IR (-O2):
define i64 @syscall3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = zext i32 %0 to i64
%6 = tail call i64 asm sideeffect "int $$0xff", "={ax},0,{dx},{cx},{bx},~{cc},~{edi},~{esi},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %5, i32 %1, i32 %2, i32 %3)
ret i64 %6
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ readlink(char *, char *, int);
int getExeFullPath(char *buf, int len) {
  ssize_t length = readlink("/proc/self/exe", buf, len);
  if (length > 0) {
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<getExeFullPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <readlink@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jle    114d <getExeFullPath+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1154 <getExeFullPath+0x44>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getExeFullPath>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
call   1030 <readlink@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/self/exe\00"
define i32 @getExeFullPath(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i64 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
store i64 %9, i64* %6
%10 = load i64, i64* %6
%11 = icmp sgt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/self/exe\00"
define i32 @getExeFullPath(i8* nocapture %0, i32 %1) {
%3 = tail call i64 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = icmp slt i64 %3, 1
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int conf_set_string(char *, char *, char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int conf_set_int(char *section, char *key, int value, int verify) {
  char buffer[40];
  snprintf(buffer, sizeof(buffer), "%d", value);
  return conf_set_string(section, key, buffer, verify);
}


x86 assembly (clang, -O0):
<conf_set_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    $0x28,%esi
lea    0xeb7(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    -0x18(%rbp),%ecx
call   1030 <conf_set_string@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_set_int>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %ecx,%r14d
mov    %edx,%ecx
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xec4(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x28,%esi
call   1040 <snprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1030 <conf_set_string@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @conf_set_int(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [40 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [40 x i8], [40 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %7
%12 = call i32 @snprintf(i8* %10, i32 40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = getelementptr inbounds [40 x i8], [40 x i8]* %9, i64 0, i64 0
%16 = load i32, i32* %8
%17 = call i32 @conf_set_string(i8* %13, i8* %14, i8* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @conf_set_int(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca [40 x i8]
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%8 = call i32 @conf_set_string(i8* %0, i8* %1, i8* %6, i32 %3)
ret i32 %8
}
OP(ed, bc) {}


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

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

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 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
struct ptrlist_struct {
  int dummy;
};
struct elasticarray {
  int dummy;
};

/* Variables and functions */
int elasticarray_resize(struct elasticarray *, size_t, int);
int ptrlist_resize(struct ptrlist_struct *EA, size_t nrec) {
  return (elasticarray_resize((struct elasticarray *)EA, nrec, sizeof(void *)));
}


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

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

LLVM IR (-O0):
%struct.ptrlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define i32 @ptrlist_resize(%struct.ptrlist_struct* %0, i64 %1) {
%3 = alloca %struct.ptrlist_struct*
%4 = alloca i64
store %struct.ptrlist_struct* %0, %struct.ptrlist_struct** %3
store i64 %1, i64* %4
%5 = load %struct.ptrlist_struct*, %struct.ptrlist_struct** %3
%6 = bitcast %struct.ptrlist_struct* %5 to %struct.elasticarray*
%7 = load i64, i64* %4
%8 = call i32 @elasticarray_resize(%struct.elasticarray* %6, i64 %7, i32 8)
ret i32 %8
}

LLVM IR (-O2):
%struct.ptrlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define i32 @ptrlist_resize(%struct.ptrlist_struct* %0, i64 %1) {
%3 = bitcast %struct.ptrlist_struct* %0 to %struct.elasticarray*
%4 = tail call i32 @elasticarray_resize(%struct.elasticarray* %3, i64 %1, i32 8)
ret i32 %4
}
void tstat_new_logdir(char *filename, struct timeval *pckt_time) {}


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

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

LLVM IR (-O0):
%struct.timeval = type opaque
define void @tstat_new_logdir(i8* %0, %struct.timeval* %1) {
%3 = alloca i8*
%4 = alloca %struct.timeval*
store i8* %0, i8** %3
store %struct.timeval* %1, %struct.timeval** %4
ret void
}

LLVM IR (-O2):
%struct.timeval = type opaque
define void @tstat_new_logdir(i8* nocapture %0, %struct.timeval* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void unload_mod1() { printf("unload mod1\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"unload mod1\0A\00"
define void @unload_mod1() {
%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"unload mod1\00"
define void @unload_mod1() {
%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 *);
void printHelp() {
  printf("c(onv):            \tWrite c, then the conversion.\n            "
         "\t\tExample:\n            \t\t>> c 50m ft\n            \t\t164.04 "
         "ft\n\n");
  printf("a(dd):            \tWrite a, then the conversion to add it to the "
         "conversion dictionary.\n            \t\tExample:\n            \t\t>> "
         "a m ft 3.281\n\n");
  printf("h(elp):            \tPrints help.\n\n");
  printf("q(uit):            \tQuits.\n");
  return;
}


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

x86 assembly (clang, -O2):
<printHelp>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf58(%rip),%rdi
call   1030 <puts@plt>
lea    0xfda(%rip),%rdi
call   1030 <puts@plt>
lea    0xff0(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [125 x i8] c"c(onv): \09Write c, then the conversion.\0A \09\09Example:\0A \09\09>> c 50m ft\0A \09\09164.04 ft\0A\0A\00"
@.str.1 = [143 x i8] c"a(dd): \09Write a, then the conversion to add it to the conversion dictionary.\0A \09\09Example:\0A \09\09>> a m ft 3.281\0A\0A\00"
@.str.2 = [35 x i8] c"h(elp): \09Prints help.\0A\0A\00"
@.str.3 = [28 x i8] c"q(uit): \09Quits.\0A\00"
define void @printHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [124 x i8] c"c(onv): \09Write c, then the conversion.\0A \09\09Example:\0A \09\09>> c 50m ft\0A \09\09164.04 ft\0A\00"
@str.4 = [142 x i8] c"a(dd): \09Write a, then the conversion to add it to the conversion dictionary.\0A \09\09Example:\0A \09\09>> a m ft 3.281\0A\00"
@str.5 = [34 x i8] c"h(elp): \09Prints help.\0A\00"
@str.6 = [27 x i8] c"q(uit): \09Quits.\00"
define void @printHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([124 x i8], [124 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([142 x i8], [142 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
ret void
}
void pthread_rwlockattr_destroy() {}


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

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

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

LLVM IR (-O2):
define void @pthread_rwlockattr_destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ helper(int *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                          int, int *);
int findTargetSumWays(int *nums, int numsSize, int S) {
  int cnt = 0;
  helper(nums, numsSize, 0, 0, S, &cnt);
  return cnt;
}


x86 assembly (clang, -O0):
<findTargetSumWays>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
xor    %ecx,%ecx
lea    -0x14(%rbp),%r9
mov    %ecx,%edx
call   1030 <helper@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findTargetSumWays>:
push   %rax
mov    %edx,%r8d
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%r9
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <helper@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @findTargetSumWays(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @helper(i32* %0, i32 %1, i32 0, i32 0, i32 %2, i32* %4)
%7 = load i32, i32* %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void firePlayerBullets(int v) {
  if (v > 0) {
    printf("fire bullets\n");
  }
}


x86 assembly (clang, -O0):
<firePlayerBullets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1131 <firePlayerBullets+0x21>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<firePlayerBullets>:
test   %edi,%edi
jle    1120 <firePlayerBullets+0x10>
lea    0xee5(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [14 x i8] c"fire bullets\0A\00"
define void @firePlayerBullets(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"fire bullets\00"
define void @firePlayerBullets(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
void ldbc(void) {
  ol("ld\tb,h");
  ol("ld\tc,l");
}


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

x86 assembly (clang, -O2):
<ldbc>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <ol@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ld\09b,h\00"
@.str.1 = [7 x i8] c"ld\09c,l\00"
define void @ldbc() {
%1 = call i32 @ol(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @ol(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ld\09b,h\00"
@.str.1 = [7 x i8] c"ld\09c,l\00"
define void @ldbc() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int core8_swap(char *, int);
int U_EMREXTTEXTOUTA_swap(char *record, int torev) {
  return (core8_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMREXTTEXTOUTA_swap>:
jmp    1030 <core8_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMREXTTEXTOUTA_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core8_swap(i8* %0, i32 %1)
ret i32 %3
}
void set_white(char *p) { *p &= ~(1 << 6); }


x86 assembly (clang, -O0):
<set_white>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
and    $0xffffffbf,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_white>:
andb   $0xbf,(%rdi)
ret

LLVM IR (-O0):
define void @set_white(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, -65
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
ret void
}

LLVM IR (-O2):
define void @set_white(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -65
store i8 %3, i8* %0
ret void
}
__attribute__((always_)) int ddebug_remove_module(const char *mod) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ddebug_remove_module(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  time_t t0;
  t0 = time(NULL);
  sleep(2);
  printf("Executed in %lf seconds.\n", difftime(time(NULL), t0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1040 <difftime@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1060 <sleep@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <difftime@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Executed in %lf seconds.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
store i32 %3, i32* %2
%4 = call i32 @sleep(i32 2)
%5 = call i32 @time(i32* null)
%6 = load i32, i32* %2
%7 = call i32 @difftime(i32 %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Executed in %lf seconds.\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @sleep(i32 2)
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @difftime(i32 %3, i32 %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int __u8;

/* Variables and functions */
int set_bit(int nr, void *addr) {
  __u8 *p, mask;
  int retval;
  p = (__u8 *)addr;
  p += nr >> 3;
  mask = 1 << (nr & 0x7);
  retval = (mask & *p) != 0;
  *p |= mask;
  return retval;
}


x86 assembly (clang, -O0):
<set_bit>:
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    $0x3,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %edi,%ecx
mov    %edi,%eax
sar    $0x3,%eax
movslq %eax,%rdx
and    $0x7,%cl
mov    (%rsi,%rdx,4),%edi
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
bts    %ecx,%edi
mov    %edi,(%rsi,%rdx,4)
ret

LLVM IR (-O0):
define i32 @set_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %5
%10 = load i32, i32* %3
%11 = ashr i32 %10, 3
%12 = load i32*, i32** %5
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i32, i32* %12, i64 %13
store i32* %14, i32** %5
%15 = load i32, i32* %3
%16 = and i32 %15, 7
%17 = shl i32 1, %16
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = and i32 %18, %20
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i32
store i32 %23, i32* %7
%24 = load i32, i32* %6
%25 = load i32*, i32** %5
%26 = load i32, i32* %25
%27 = or i32 %26, %24
store i32 %27, i32* %25
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @set_bit(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = ashr i32 %0, 3
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %3, i64 %5
%7 = and i32 %0, 7
%8 = shl nuw nsw i32 1, %7
%9 = load i32, i32* %6
%10 = lshr i32 %9, %7
%11 = and i32 %10, 1
%12 = or i32 %9, %8
store i32 %12, i32* %6
ret i32 %11
}
double areaDoTrapezio(double b1, double b2, double h) {
  return (b1 + b2) * h / 2;
}


x86 assembly (clang, -O0):
<areaDoTrapezio>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<areaDoTrapezio>:
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mulsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @areaDoTrapezio(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fadd double %7, %8
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = fdiv double %11, 2.000000e+00
ret double %12
}

LLVM IR (-O2):
define double @areaDoTrapezio(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fmul double %4, %2
%6 = fmul double %5, 5.000000e-01
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ ship(char *);
int /*<<< orphan*/ shipcom(char *);
int eps_term(void) {
  ship("grestore\n");
  shipcom("%%%%EOF\n");
  return 0;
}


x86 assembly (clang, -O0):
<eps_term>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <ship@plt>
lea    0xed3(%rip),%rdi
call   1030 <shipcom@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eps_term>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <ship@plt>
lea    0xed6(%rip),%rdi
call   1030 <shipcom@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"grestore\0A\00"
@.str.1 = [9 x i8] c"%%%%EOF\0A\00"
define i32 @eps_term() {
%1 = call i32 @ship(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @shipcom(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"grestore\0A\00"
@.str.1 = [9 x i8] c"%%%%EOF\0A\00"
define i32 @eps_term() {
%1 = tail call i32 @ship(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @shipcom(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int l;
  l = 0x7fffffff;
  printf("l = %d (0x%x)\n", l, l);
  printf("l + 1 = %d (0x%x)\n", l + 1, l + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
lea    0xec4(%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
mov    $0x7fffffff,%esi
mov    $0x7fffffff,%edx
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x80000000,%esi
mov    $0x80000000,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"l = %d (0x%x)\0A\00"
@.str.1 = [19 x i8] c"l + 1 = %d (0x%x)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2147483647, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"l = %d (0x%x)\0A\00"
@.str.1 = [19 x i8] c"l + 1 = %d (0x%x)\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 2147483647, i32 2147483647)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 -2147483648, i32 -2147483648)
ret i32 0
}
void swap(int *a, int *b) {
  int t;
  t = *a;
  *a = *b;
  *b = t;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void printError(int fd, char *msg) {
  perror(msg);
  close(fd);
  exit(1);
}


x86 assembly (clang, -O0):
<printError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<printError>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1040 <perror@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @printError(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @perror(i8* %5)
%7 = load i32, i32* %3
%8 = call i32 @close(i32 %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @printError(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @perror(i8* %1)
%4 = tail call i32 @close(i32 %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void free_memory() {}


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

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

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

LLVM IR (-O2):
define void @free_memory() {
ret void
}
/* Variables and functions */
char *cs_strcat(char *, char *);
char *getenv(char *);
char *tildestr(char *line) {
  char *home;
  if (*line == '~') {
    home = getenv("HOME");
    return cs_strcat(home, line + 1);
  }
  return line;
}


x86 assembly (clang, -O0):
<tildestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7e,%eax
jne    1166 <tildestr+0x46>
lea    0xebd(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1040 <cs_strcat@plt>
mov    %rax,-0x8(%rbp)
jmp    116e <tildestr+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tildestr>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x7e,(%rdi)
jne    1145 <tildestr+0x25>
lea    0xed0(%rip),%rdi
call   1030 <getenv@plt>
add    $0x1,%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <cs_strcat@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
define i8* @tildestr(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 126
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = tail call i8* @cs_strcat(i8* %5, i8* %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ %0, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ main_main();
void main() { main_main(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @main_main()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Running executable 1...\n\n");
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [26 x i8] c"Running executable 1...\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@str = [25 x i8] c"Running executable 1...\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
int test00(int a, int b, int *x) { return (a == b) ? 0x7FFFFFFF : 0x80000000; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
mov    $0x80000000,%eax
mov    $0x7fffffff,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %ecx,%ecx
cmp    %esi,%edi
sete   %cl
mov    $0x80000000,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test00(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 2147483647, i32 -2147483648
ret i32 %11
}

LLVM IR (-O2):
define i32 @test00(i32 %0, i32 %1, i32* nocapture readnone %2) {
%4 = icmp eq i32 %0, %1
%5 = select i1 %4, i32 2147483647, i32 -2147483648
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushcomplex32array(void *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 32));
}


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

x86 assembly (clang, -O2):
<pushcomplex32array>:
shl    $0x5,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushcomplex32array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 32
%8 = call i32 @pushNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @pushcomplex32array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 5
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
void _Unlocksyslock(void) {}


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

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

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

LLVM IR (-O2):
define void @_Unlocksyslock() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_uint16_t(uint16_t const k1, uint16_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_uint16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_uint16_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_uint16_t(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 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_uint16_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bobheight(int);
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basBobHeight() {
  int n;
  n = popNumber();
  pushNumber(bobheight(n));
}


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

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

LLVM IR (-O0):
define void @basBobHeight() {
%1 = alloca i32
%2 = call i32 (...) @popNumber()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @bobheight(i32 %3)
%5 = call i32 @pushNumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basBobHeight() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @bobheight(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
unsigned int test_11(unsigned int x) { return x + (x != 0); }


x86 assembly (clang, -O0):
<test_11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_11>:
mov    %edi,%eax
cmp    $0x1,%edi
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @test_11(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add i32 %3, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_11(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = add i32 %3, %0
ret i32 %4
}