xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int div3 = 999 / 3;
  int div5 = 999 / 5;
  int div3Union5 = 999 / (3 * 5);
  int sumMult3 = 3 * div3 * (div3 + 1) / 2;
  int sumMult5 = 5 * div5 * (div5 + 1) / 2;
  int sumMult3Union5 = 3 * 5 * div3Union5 * (div3Union5 + 1) / 2;
  int inc_exc = sumMult3 + sumMult5 - sumMult3Union5;
  printf("%d\n", inc_exc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14d,-0x8(%rbp)
movl   $0xc7,-0xc(%rbp)
movl   $0x42,-0x10(%rbp)
imul   $0x3,-0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
imul   $0x5,-0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
imul   $0xf,-0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 333, i32* %2
store i32 199, i32* %3
store i32 66, i32* %4
%9 = load i32, i32* %2
%10 = mul nsw i32 3, %9
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
%13 = mul nsw i32 %10, %12
%14 = sdiv i32 %13, 2
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = mul nsw i32 5, %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
%19 = mul nsw i32 %16, %18
%20 = sdiv i32 %19, 2
store i32 %20, i32* %6
%21 = load i32, i32* %4
%22 = mul nsw i32 15, %21
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
%25 = mul nsw i32 %22, %24
%26 = sdiv i32 %25, 2
store i32 %26, i32* %7
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = add nsw i32 %27, %28
%30 = load i32, i32* %7
%31 = sub nsw i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 233168)
ret i32 0
}
double mu_timer_cpu(void) { return -1; }


x86 assembly (clang, -O0):
<mu_timer_cpu>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mu_timer_cpu>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @mu_timer_cpu() {
ret double -1.000000e+00
}

LLVM IR (-O2):
define double @mu_timer_cpu() {
ret double -1.000000e+00
}
void invlpg(volatile void *va) {
  asm volatile("invlpg (%0)" ::"r"(va) : "memory");
}


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

x86 assembly (clang, -O2):
<invlpg>:
invlpg (%rdi)
ret

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

LLVM IR (-O2):
define void @invlpg(i8* %0) {
tail call void asm sideeffect "invlpg ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Type definitions */
struct char_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_to_char(char *, struct char_data *);
void do_shutdow(struct char_data *ch, char *argument, int cmd) {
  send_to_char("If you want to shut something down - say so!\r\n", ch);
}


x86 assembly (clang, -O0):
<do_shutdow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <send_to_char@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.char_data = type { i32 }
@.str = [47 x i8] c"If you want to shut something down - say so!\0D\0A\00"
define void @do_shutdow(%struct.char_data* %0, i8* %1, i32 %2) {
%4 = alloca %struct.char_data*
%5 = alloca i8*
%6 = alloca i32
store %struct.char_data* %0, %struct.char_data** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.char_data*, %struct.char_data** %4
%8 = call i32 @send_to_char(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), %struct.char_data* %7)
ret void
}

LLVM IR (-O2):
%struct.char_data = type { i32 }
@.str = [47 x i8] c"If you want to shut something down - say so!\0D\0A\00"
define void @do_shutdow(%struct.char_data* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @send_to_char(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), %struct.char_data* %0)
ret void
}
int add(int param1, int param2) { return param1 + param2; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void itlbmiss_except() {}


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

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

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

LLVM IR (-O2):
define void @itlbmiss_except() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ build_opcode_table();
int main() {
  build_opcode_table();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @build_opcode_table()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x4b() {
  Assert_real((isxdigit(75) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              380, ("isxdigit should be 0 for K"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x4b>:
push   %rax
mov    $0x4b,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x17c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for K\00"
define void @t_isxdigit_0x4b() {
%1 = call i64 @isxdigit(i32 75)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 380, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for K\00"
define void @t_isxdigit_0x4b() {
%1 = tail call i64 @isxdigit(i32 75)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 380, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_dup3;
scalar_t__ syscall(int /*<<< orphan*/, int, int, int);
int xdup3(int oldfd, int newfd, int flags) {
  int ret = (int)syscall(__NR_dup3, oldfd, newfd, flags);
  if (ret == -1) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xdup3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <syscall@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    114a <xdup3+0x3a>
jmp    114a <xdup3+0x3a>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdup3>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_dup3 = global i32 0
define i32 @xdup3(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
%8 = load i32, i32* @__NR_dup3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i64 @syscall(i32 %8, i32 %9, i32 %10, i32 %11)
%13 = trunc i64 %12 to i32
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %17
16: ; preds = %3
br label %17
17: ; preds = %16, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@__NR_dup3 = global i32 0
define i32 @xdup3(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @__NR_dup3
%5 = tail call i64 @syscall(i32 %4, i32 %0, i32 %1, i32 %2)
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ print_current_time();
int /*<<< orphan*/ print_process_info();
int /*<<< orphan*/ print_process_time();
int /*<<< orphan*/ printf(char *, char *);
void print_termination_info(char *process_name) {
  printf("%s preparing to terminate.\n", process_name);
  print_current_time();
  print_process_info();
  print_process_time();
}


x86 assembly (clang, -O0):
<print_termination_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <print_current_time@plt>
mov    $0x0,%al
call   1050 <print_process_info@plt>
mov    $0x0,%al
call   1030 <print_process_time@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_termination_info>:
push   %rax
mov    %rdi,%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <print_current_time@plt>
xor    %eax,%eax
call   1050 <print_process_info@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <print_process_time@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"%s preparing to terminate.\0A\00"
define void @print_termination_info(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @print_current_time()
%6 = call i32 (...) @print_process_info()
%7 = call i32 (...) @print_process_time()
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s preparing to terminate.\0A\00"
define void @print_termination_info(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @print_current_time()
%4 = tail call i32 (...) @print_process_info()
%5 = tail call i32 (...) @print_process_time()
ret void
}
void __attribute__((visibility("default")))
__cyg_profile_func_exit(void *child, void *parent) {}


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

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

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

LLVM IR (-O2):
define void @__cyg_profile_func_exit(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_Engine();
int main(int argc, char *argv[]) {
  console_Engine();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @console_Engine()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char *);
int is_exist_dir(char *_dir) {
  DIR *dir = NULL;
  dir = opendir(_dir);
  if (dir == NULL) {
    closedir(dir);
    return 0;
  } else {
    closedir(dir);
    return 1;
  }
}


x86 assembly (clang, -O0):
<is_exist_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <is_exist_dir+0x41>
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x0,-0x4(%rbp)
jmp    1171 <is_exist_dir+0x51>
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_exist_dir>:
push   %rbx
call   1030 <opendir@plt>
test   %rax,%rax
je     113a <is_exist_dir+0x1a>
mov    %rax,%rdi
call   1040 <closedir@plt>
mov    $0x1,%ebx
jmp    1143 <is_exist_dir+0x23>
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <closedir@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_exist_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* null, i32** %4
%5 = load i8*, i8** %3
%6 = call i32* @opendir(i8* %5)
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %4
%11 = call i32 @closedir(i32* %10)
store i32 0, i32* %2
br label %15
12: ; preds = %1
%13 = load i32*, i32** %4
%14 = call i32 @closedir(i32* %13)
store i32 1, i32* %2
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_exist_dir(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @closedir(i32* null)
br label %8
6: ; preds = %1
%7 = tail call i32 @closedir(i32* %2)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 0, %4 ], [ 1, %6 ]
ret i32 %9
}
int test_imm_CBuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xCB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CBuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13303808
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ errorMessage(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int write(int, unsigned char *, int);
int i2cWrite(int fileDescriptor, unsigned char data) {
  int bytesWritten = write(fileDescriptor, &data, 1);
  if (bytesWritten < 0) {
    errorMessage("error %d writing byte via i2c: %s", errno, strerror(errno));
  }
  return bytesWritten;
}


x86 assembly (clang, -O0):
<i2cWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    118a <i2cWrite+0x5a>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe7b(%rip),%rdi
call   1040 <errorMessage@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2cWrite>:
push   %rbp
push   %rbx
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    116d <i2cWrite+0x3d>
mov    0x2e8c(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1050 <strerror@plt>
lea    0xe9c(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <errorMessage@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"error %d writing byte via i2c: %s\00"
@errno = global i32 0
define i32 @i2cWrite(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i32, i32* %3
%7 = call i32 @write(i32 %6, i8* %4, i32 1)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @errno
%12 = load i32, i32* @errno
%13 = call i32 @strerror(i32 %12)
%14 = call i32 @errorMessage(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %13)
br label %15
15: ; preds = %10, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [34 x i8] c"error %d writing byte via i2c: %s\00"
@errno = global i32 0
define i32 @i2cWrite(i32 %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 @errorMessage(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6, %2
ret i32 %4
}
/* Variables and functions */
scalar_t__ ilogbl(long double);
int /*<<< orphan*/ link_failure_ilogbl();
void test_ilogbl(long double ld) {
  if (ilogbl(ld) != ilogbl(ld))
    link_failure_ilogbl();
}


x86 assembly (clang, -O0):
<test_ilogbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <ilogbl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <ilogbl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_ilogbl+0x43>
mov    $0x0,%al
call   1040 <link_failure_ilogbl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ilogbl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <ilogbl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <ilogbl@plt>
cmp    %rax,%rbx
jne    1151 <test_ilogbl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_ilogbl@plt>

LLVM IR (-O0):
define void @test_ilogbl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @ilogbl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @ilogbl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_ilogbl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_ilogbl(x86_fp80 %0) {
%2 = tail call i64 @ilogbl(x86_fp80 %0)
%3 = tail call i64 @ilogbl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_ilogbl()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int xdoj_jc3_toplev(int, char **);
int main(int argc, char **argv) { return xdoj_jc3_toplev(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <xdoj_jc3_toplev@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @xdoj_jc3_toplev(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ isalpha(char);
int util_checkalpha(char *str) {
  while (*str) {
    if (!isalpha(*str))
      return -1;
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<util_checkalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <util_checkalpha+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%eax
jne    114a <util_checkalpha+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <util_checkalpha+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <util_checkalpha+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_checkalpha>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
xor    %ebp,%ebp
test   %al,%al
je     114e <util_checkalpha+0x3e>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isalpha@plt>
test   %eax,%eax
je     1149 <util_checkalpha+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <util_checkalpha+0x20>
jmp    114e <util_checkalpha+0x3e>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @util_checkalpha(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %14, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i32 @isalpha(i8 signext %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %8
store i32 -1, i32* %2
br label %18
14: ; preds = %8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %4
17: ; preds = %4
store i32 0, i32* %2
br label %18
18: ; preds = %17, %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @util_checkalpha(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isalpha(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 0, %1 ], [ 0, %4 ], [ -1, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ io_error_msg(char *, int);
int /*<<< orphan*/ signal(int, void (*)(int));
void handler(int sig) {
  signal(sig, handler);
  io_error_msg("Plotutils: got signal %d, aborting", sig);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rsi
call   1030 <signal@plt>
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1040 <io_error_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    %edi,%ebx
mov    0x2ebe(%rip),%rsi
call   1030 <signal@plt>
lea    0xeca(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <io_error_msg@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Plotutils: got signal %d, aborting\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @signal(i32 %3, void (i32)* @handler)
%5 = load i32, i32* %2
%6 = call i32 @io_error_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Plotutils: got signal %d, aborting\00"
define void @handler(i32 %0) {
%2 = tail call i32 @signal(i32 %0, void (i32)* @handler)
%3 = tail call i32 @io_error_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func_no_leaf();
void func1(void) {
  int a = 0;
  func_no_leaf();
}


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

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

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

LLVM IR (-O2):
define void @func1() {
%1 = tail call i32 (...) @func_no_leaf()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int *);
int /*<<< orphan*/ assert(int);
int *malloc(int);
int main() {
  int *p, *q;
  q = p = malloc(sizeof(int));
  __ESBMC_assume(p);
  *p = 2;
  p = malloc(sizeof(int));
  __ESBMC_assume(p);
  *p = 3;
  assert(*q == 2);
  assert(*p == 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__ESBMC_assume@plt>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__ESBMC_assume@plt>
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x2,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x3,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1030 <__ESBMC_assume@plt>
movl   $0x2,(%r14)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <__ESBMC_assume@plt>
movl   $0x3,(%rbx)
xor    %edi,%edi
cmpl   $0x2,(%r14)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x3,(%rbx)
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %1
store i32* %3, i32** %2
%4 = load i32*, i32** %1
%5 = call i32 @__ESBMC_assume(i32* %4)
%6 = load i32*, i32** %1
store i32 2, i32* %6
%7 = call i32* @malloc(i32 4)
store i32* %7, i32** %1
%8 = load i32*, i32** %1
%9 = call i32 @__ESBMC_assume(i32* %8)
%10 = load i32*, i32** %1
store i32 3, i32* %10
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 2
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32*, i32** %1
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 3
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @__ESBMC_assume(i32* %1)
store i32 2, i32* %1
%3 = tail call i32* @malloc(i32 4)
%4 = tail call i32 @__ESBMC_assume(i32* %3)
store i32 3, i32* %3
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_version() { printf("crater %s\n", "0.1.dev0"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"crater %s\0A\00"
@.str.1 = [9 x i8] c"0.1.dev0\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void error() { printf("some thing worring"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"some thing worring\00"
define void @error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"some thing worring\00"
define void @error() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SIOCSIFNETMASK;
int wapi_set_addr(int, char const *, int /*<<< orphan*/,
                  struct in_addr const *);
int wapi_set_netmask(int sock, const char *ifname, const struct in_addr *addr) {
  return wapi_set_addr(sock, ifname, SIOCSIFNETMASK, addr);
}


x86 assembly (clang, -O0):
<wapi_set_netmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rcx
call   1030 <wapi_set_addr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wapi_set_netmask>:
mov    %rdx,%rcx
mov    0x2ece(%rip),%rax
mov    (%rax),%edx
jmp    1030 <wapi_set_addr@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@SIOCSIFNETMASK = global i32 0
define i32 @wapi_set_netmask(i32 %0, i8* %1, %struct.in_addr* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.in_addr*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.in_addr* %2, %struct.in_addr** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* @SIOCSIFNETMASK
%10 = load %struct.in_addr*, %struct.in_addr** %6
%11 = call i32 @wapi_set_addr(i32 %7, i8* %8, i32 %9, %struct.in_addr* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@SIOCSIFNETMASK = global i32 0
define i32 @wapi_set_netmask(i32 %0, i8* %1, %struct.in_addr* %2) {
%4 = load i32, i32* @SIOCSIFNETMASK
%5 = tail call i32 @wapi_set_addr(i32 %0, i8* %1, i32 %4, %struct.in_addr* %2)
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ menu(int, char **);
int main(int argc, char *argv[]) {
  menu(argc, argv);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <menu@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <menu@plt>
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @menu(i32 %6, i8** %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @menu(i32 %0, i8** %1)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(int);
int my_print_digits(void) {
  int digit;
  digit = 48;
  while (digit <= 57) {
    my_putchar(digit);
    digit++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<my_print_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x30,-0x4(%rbp)
cmpl   $0x39,-0x4(%rbp)
jg     113f <my_print_digits+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <my_putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <my_print_digits+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_print_digits>:
push   %rax
mov    $0x30,%edi
call   1030 <my_putchar@plt>
mov    $0x31,%edi
call   1030 <my_putchar@plt>
mov    $0x32,%edi
call   1030 <my_putchar@plt>
mov    $0x33,%edi
call   1030 <my_putchar@plt>
mov    $0x34,%edi
call   1030 <my_putchar@plt>
mov    $0x35,%edi
call   1030 <my_putchar@plt>
mov    $0x36,%edi
call   1030 <my_putchar@plt>
mov    $0x37,%edi
call   1030 <my_putchar@plt>
mov    $0x38,%edi
call   1030 <my_putchar@plt>
mov    $0x39,%edi
call   1030 <my_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @my_print_digits() {
%1 = alloca i32
store i32 48, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 57
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @my_putchar(i32 %6)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @my_print_digits() {
%1 = tail call i32 @my_putchar(i32 48)
%2 = tail call i32 @my_putchar(i32 49)
%3 = tail call i32 @my_putchar(i32 50)
%4 = tail call i32 @my_putchar(i32 51)
%5 = tail call i32 @my_putchar(i32 52)
%6 = tail call i32 @my_putchar(i32 53)
%7 = tail call i32 @my_putchar(i32 54)
%8 = tail call i32 @my_putchar(i32 55)
%9 = tail call i32 @my_putchar(i32 56)
%10 = tail call i32 @my_putchar(i32 57)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sighandler(int signo) { printf("In signal handler.\n"); }


x86 assembly (clang, -O0):
<sighandler>:
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):
<sighandler>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"In signal handler.\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"In signal handler.\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ method2();
int main(void) {
  method2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @method2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void help(void) {
  const char *helpText = "Usage: bin2mem [-d <data start address>] <text "
                         "segment> <data segment> <output file>\n";
  printf("%s\n", helpText);
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xf18(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xf2e(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [86 x i8] c"Usage: bin2mem [-d <data start address>] <text segment> <data segment> <output file>\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @help() {
%1 = alloca i8*
store i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [86 x i8] c"Usage: bin2mem [-d <data start address>] <text segment> <data segment> <output file>\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
const int alignconv(int align) {
  int i;
  if ((i = align) >= 1) {
    align = 1;
    while (i >>= 1)
      ;
    align++;
  }
  return align;
}


x86 assembly (clang, -O0):
<alignconv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x1,%eax
jl     113d <alignconv+0x3d>
movl   $0x1,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1134 <alignconv+0x34>
jmp    111d <alignconv+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alignconv>:
test   %edi,%edi
mov    $0x2,%eax
cmovle %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @alignconv(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 2, i32 %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void endgroup(void) { printf("</g>\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"</g>\0A\00"
define void @endgroup() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"</g>\00"
define void @endgroup() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
void ASN1_i2d_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_i2d_bio() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_program;
typedef int /*<<< orphan*/ cl_kernel;
typedef scalar_t__ cl_int;
typedef int /*<<< orphan*/ cl_context;

/* Variables and functions */
scalar_t__ CL_SUCCESS;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ clCreateKernel(int /*<<< orphan*/, char *, scalar_t__ *);
int CreateKernel(cl_kernel *kernel, cl_context ctx, cl_program program) {
  cl_int status = 0;
  kernel[0] = clCreateKernel(program, "matrix_transpose", &status);
  assert(status == CL_SUCCESS);
  return 0;
}


x86 assembly (clang, -O0):
<CreateKernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%edi
lea    0xebc(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <clCreateKernel@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateKernel>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%eax
mov    %rdi,%rbx
movq   $0x0,0x8(%rsp)
lea    0xec6(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %eax,%edi
call   1040 <clCreateKernel@plt>
mov    %eax,(%rbx)
mov    0x8(%rsp),%rax
mov    0x2e8c(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%rax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"matrix_transpose\00"
@CL_SUCCESS = global i64 0
define i32 @CreateKernel(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i64 0, i64* %7
%8 = load i32, i32* %6
%9 = call i32 @clCreateKernel(i32 %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64* %7)
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i64, i64* %7
%13 = load i64, i64* @CL_SUCCESS
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"matrix_transpose\00"
@CL_SUCCESS = global i64 0
define i32 @CreateKernel(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%6 = call i32 @clCreateKernel(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64* %4)
store i32 %6, i32* %0
%7 = load i64, i64* %4
%8 = load i64, i64* @CL_SUCCESS
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}
/* Variables and functions */
int S_IRWXG;
int S_IRWXU;
int /*<<< orphan*/ close(int);
int creat(char *, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int fd;
  char ch;
  fd = creat("Demo.txt", S_IRWXU | S_IRWXG);
  printf("\n New File Desp : %d", fd);
  getchar();
  close(fd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    0x2e88(%rip),%rax
or     (%rax),%esi
lea    0xe9f(%rip),%rdi
call   1060 <creat@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    0x2e91(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xea6(%rip),%rdi
call   1060 <creat@plt>
mov    %eax,%ebx
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Demo.txt\00"
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@.str.1 = [21 x i8] c"\0A New File Desp : %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = load i32, i32* @S_IRWXU
%4 = load i32, i32* @S_IRWXG
%5 = or i32 %3, %4
%6 = call i32 @creat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @getchar()
%10 = load i32, i32* %1
%11 = call i32 @close(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Demo.txt\00"
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@.str.1 = [21 x i8] c"\0A New File Desp : %d\00"
define i32 @main() {
%1 = load i32, i32* @S_IRWXU
%2 = load i32, i32* @S_IRWXG
%3 = or i32 %2, %1
%4 = tail call i32 @creat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @getchar()
%7 = tail call i32 @close(i32 %4)
ret i32 0
}
/* Variables and functions */
double pow(double, double);
double cents2interv(double cents) { return pow(2.0, cents / 1200.0); }


x86 assembly (clang, -O0):
<cents2interv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xede(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cents2interv>:
divsd  0xee8(%rip),%xmm0
jmp    1030 <exp2@plt>

LLVM IR (-O0):
define double @cents2interv(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.200000e+03
%5 = call double @pow(double 2.000000e+00, double %4)
ret double %5
}

LLVM IR (-O2):
define double @cents2interv(double %0) {
%2 = fdiv double %0, 1.200000e+03
%3 = tail call double @exp2(double %2)
ret double %3
}
int stempty(int top) { return top == 0 ? 1 : 0; }


x86 assembly (clang, -O0):
<stempty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stempty>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @stempty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @stempty(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}