xunge/DecIR huggingface dataset:
void rt_check(void) { ((void)0); }


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

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

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

LLVM IR (-O2):
define void @rt_check() {
ret void
}
void __DELETE_org_xmlvm_runtime_XMLVMUtil(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_org_xmlvm_runtime_XMLVMUtil(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 @__DELETE_org_xmlvm_runtime_XMLVMUtil(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ strCmd;

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ strncpy(char *, char const *, int);
int /*<<< orphan*/ *strtok(char *, char *);
int isEmpty(const char *pCmd) {
  char strCmd[BUFSIZ];
  strncpy(strCmd, pCmd, sizeof(strCmd));
  if (strtok(strCmd, " \t") == NULL) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isEmpty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
mov    -0x30(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1040 <strtok@plt>
cmp    $0x0,%rax
jne    1190 <isEmpty+0x70>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x24(%rbp)
jmp    119e <isEmpty+0x7e>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEmpty>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rsi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rdx,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1030 <strncpy@plt>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strtok@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [3 x i8] c" \09\00"
define i32 @isEmpty(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %3
%7 = load i32, i32* @BUFSIZ
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %4
%10 = alloca i8, i64 %8
store i64 %8, i64* %5
%11 = load i8*, i8** %3
%12 = trunc i64 %8 to i32
%13 = call i32 @strncpy(i8* %10, i8* %11, i32 %12)
%14 = call i32* @strtok(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %17
16: ; preds = %1
store i32 1, i32* %2
store i32 1, i32* %6
br label %18
17: ; preds = %1
store i32 0, i32* %2
store i32 1, i32* %6
br label %18
18: ; preds = %17, %16
%19 = load i8*, i8** %4
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str = [3 x i8] c" \09\00"
define i32 @isEmpty(i8* %0) {
%2 = load i32, i32* @BUFSIZ
%3 = zext i32 %2 to i64
%4 = alloca i8, i64 %3
%5 = call i32 @strncpy(i8* %4, i8* %0, i32 %2)
%6 = call i32* @strtok(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32* %6, null
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_help(void) {
  static const char *help =
      "Usage: ownership [OPTIONS]\n"
      "Options are:\n"
      " -d, --dev-mem FILE     Read memory from device FILE (default: "
      "/dev/mem"
      ")\n"
      " -h, --help             Display this help text and exit\n"
      " -V, --version          Display the version and exit\n";
  printf("%s", help);
}


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

x86 assembly (clang, -O2):
<print_help>:
lea    0xfc8(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@print_help.help = internal global i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i32 0, i32 0)
@.str = [223 x i8] c"Usage: ownership [OPTIONS]\0AOptions are:\0A -d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)\0A -h, --help Display this help text and exit\0A -V, --version Display the version and exit\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_help() {
%1 = load i8*, i8** @print_help.help
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [223 x i8] c"Usage: ownership [OPTIONS]\0AOptions are:\0A -d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)\0A -h, --help Display this help text and exit\0A -V, --version Display the version and exit\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move_cursor(int /*<<< orphan*/, int /*<<< orphan*/);
void key_home() { move_cursor(0, 0); }


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

x86 assembly (clang, -O2):
<key_home>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <move_cursor@plt>

LLVM IR (-O0):
define void @key_home() {
%1 = call i32 @move_cursor(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @key_home() {
%1 = tail call i32 @move_cursor(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
long sysconf(int /*<<< orphan*/);
long dv_get_cpu_num(void) { return sysconf(_SC_NPROCESSORS_ONLN); }


x86 assembly (clang, -O0):
<dv_get_cpu_num>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv_get_cpu_num>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i64 @dv_get_cpu_num() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i64 @dv_get_cpu_num() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
int test_imm_EBint16_mem(short *val) {
  return ((*val) & (0xEB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_EBint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 235
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void glutHideWindow(void) {}


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

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

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

LLVM IR (-O2):
define void @glutHideWindow() {
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR55_get(void) { return U_WMRCORENONE_get("U_WMR55"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR55\00"
define i32 @U_WMR55_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR55\00"
define i32 @U_WMR55_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int av_set_volume(int volume) {
  if ((volume < 0) || (volume > 255))
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<av_set_volume>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111e <av_set_volume+0x1e>
cmpl   $0xff,-0x8(%rbp)
jle    112a <av_set_volume+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1131 <av_set_volume+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_set_volume>:
xor    %eax,%eax
cmp    $0x100,%edi
adc    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @av_set_volume(i32 %0) {
%2 = icmp ugt i32 %0, 255
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int id = 1;
  int p;
  for (p = 0; p < 32; ++p) {
    id <<= 1;
  }
  printf("%d\n", id);
  id = 1;
  id <<= 32;
  printf("%d\n", id);
  printf("%d\n", 1 << 32);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    114e <main+0x3e>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = shl i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
store i32 1, i32* %2
%16 = load i32, i32* %2
%17 = shl i32 %16, 32
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 poison)
%21 = load i32, i32* %1
ret i32 %21
}

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 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 poison)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 poison)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hd44780_display_hal_cursor_visibility(int);
void display_enable_cursor(bool visible) {
  hd44780_display_hal_cursor_visibility(visible);
}


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

x86 assembly (clang, -O2):
<display_enable_cursor>:
jmp    1030 <hd44780_display_hal_cursor_visibility@plt>

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

LLVM IR (-O2):
define void @display_enable_cursor(i32 %0) {
%2 = tail call i32 @hd44780_display_hal_cursor_visibility(i32 %0)
ret void
}
/* Variables and functions */
char *malloc(int);
char *memcpy(char *, char const *, int);
int strlen(char const *);
char *strdup1(const char *src) {
  int n = strlen(src) + 1;
  char *des = malloc(n * sizeof(*des));
  des[n] = '\0';
  return des ? memcpy(des, src, n) : NULL;
}


x86 assembly (clang, -O0):
<strdup1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
cmpq   $0x0,-0x18(%rbp)
je     118e <strdup1+0x5e>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    %rax,-0x20(%rbp)
jmp    1199 <strdup1+0x69>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1199 <strdup1+0x69>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup1>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
movslq %eax,%rbx
lea    0x1(%rbx),%r15
mov    %r15d,%edi
call   1050 <malloc@plt>
movb   $0x0,0x1(%rax,%rbx,1)
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define i8* @strdup1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %4
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %24
19: ; preds = %1
%20 = load i8*, i8** %4
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = call i8* @memcpy(i8* %20, i8* %21, i32 %22)
br label %25
24: ; preds = %1
br label %25
25: ; preds = %24, %19
%26 = phi i8* [ %23, %19 ], [ null, %24 ]
ret i8* %26
}

LLVM IR (-O2):
define i8* @strdup1(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i32 %3)
%6 = getelementptr inbounds i8, i8* %5, i64 %4
store i8 0, i8* %6
%7 = tail call i8* @memcpy(i8* %5, i8* %0, i32 %3)
ret i8* %7
}
int finite(double x) {
  int hx;
  hx = *(1 + (int *)&x);
  return (unsigned)((hx & 0x7fffffff) - 0x7ff00000) >> 31;
}


x86 assembly (clang, -O0):
<finite>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
sub    $0x7ff00000,%eax
shr    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<finite>:
movq   %xmm0,%rax
shr    $0x20,%rax
and    $0x7fffffff,%eax
add    $0x80100000,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @finite(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = bitcast double* %2 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, 2147483647
%9 = sub nsw i32 %8, 2146435072
%10 = lshr i32 %9, 31
ret i32 %10
}

LLVM IR (-O2):
define i32 @finite(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 32
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 2147483647
%6 = add nsw i32 %5, -2146435072
%7 = lshr i32 %6, 31
ret i32 %7
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ print_console(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, int, char *);
char *strerror(int);
void warn(char *s) {
  int saved_errno = errno;
  char buf[4096];
  snprintf(buf, 4095, "Warning: %s (%i, %s)\n", s, saved_errno,
           strerror(saved_errno));
  print_console(buf);
}


x86 assembly (clang, -O0):
<warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1030,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1028(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x1020(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1014(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x1028(%rbp),%rdi
mov    -0x1020(%rbp),%rcx
mov    -0x1014(%rbp),%r8d
mov    %rax,%r9
mov    $0xfff,%esi
lea    0xe67(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x1010(%rbp),%rdi
call   1040 <print_console@plt>
add    $0x1030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1000,%rsp
mov    %rdi,%rbx
mov    0x2e9b(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1050 <strerror@plt>
lea    0xeab(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xfff,%esi
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %rax,%r9
call   1030 <snprintf@plt>
mov    %r14,%rdi
call   1040 <print_console@plt>
add    $0x1000,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [22 x i8] c"Warning: %s (%i, %s)\0A\00"
define void @warn(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [4096 x i8]
store i8* %0, i8** %2
%5 = load i32, i32* @errno
store i32 %5, i32* %3
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = call i8* @strerror(i32 %9)
%11 = call i32 @snprintf(i8* %6, i32 4095, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %10)
%12 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%13 = call i32 @print_console(i8* %12)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [22 x i8] c"Warning: %s (%i, %s)\0A\00"
define void @warn(i8* %0) {
%2 = alloca [4096 x i8]
%3 = load i32, i32* @errno
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%5 = tail call i8* @strerror(i32 %3)
%6 = call i32 @snprintf(i8* %4, i32 4095, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3, i8* %5)
%7 = call i32 @print_console(i8* %4)
ret void
}
const char *Copy_Definition(void) {
  return "struct Copy {\n"
         "  var (*copy)(var);\n"
         "};\n";
}


x86 assembly (clang, -O0):
<Copy_Definition>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Copy_Definition>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [38 x i8] c"struct Copy {\0A var (*copy)(var);\0A};\0A\00"
define i8* @Copy_Definition() {
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [38 x i8] c"struct Copy {\0A var (*copy)(var);\0A};\0A\00"
define i8* @Copy_Definition() {
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ aes_cbc(unsigned char *, unsigned char *, unsigned char *,
                           size_t, unsigned char *, int, int);
void openssl_AES_enc128_CBC(unsigned char *in, unsigned char *out,
                            unsigned char *key, size_t num_blocks,
                            unsigned char *iv) {
  aes_cbc(in, out, key, num_blocks, iv, 128, 1);
}


x86 assembly (clang, -O0):
<openssl_AES_enc128_CBC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x80,%r9d
movl   $0x1,(%rsp)
call   1030 <aes_cbc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_AES_enc128_CBC>:
push   %rax
movl   $0x1,(%rsp)
mov    $0x80,%r9d
call   1030 <aes_cbc@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @openssl_AES_enc128_CBC(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = load i8*, i8** %10
%16 = call i32 @aes_cbc(i8* %11, i8* %12, i8* %13, i64 %14, i8* %15, i32 128, i32 1)
ret void
}

LLVM IR (-O2):
define void @openssl_AES_enc128_CBC(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = tail call i32 @aes_cbc(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4, i32 128, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_help(void) {
  printf("\nUsage: photorec [/log] [/debug] [/d recup_dir] "
         "[file.dd|file.e01|device]\n"
         "       photorec /version\n"
         "\n"
         "/log          : create a photorec.log file\n"
         "/debug        : add debug information\n"
         "\n"
         "PhotoRec searches for various file formats (JPEG, Office...). It "
         "stores files\n"
         "in the recup_dir directory.\n");
}


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

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

LLVM IR (-O0):
@.str = [289 x i8] c"\0AUsage: photorec [/log] [/debug] [/d recup_dir] [file.dd|file.e01|device]\0A photorec /version\0A\0A/log : create a photorec.log file\0A/debug : add debug information\0A\0APhotoRec searches for various file formats (JPEG, Office...). It stores files\0Ain the recup_dir directory.\0A\00"
define void @display_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([289 x i8], [289 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [288 x i8] c"\0AUsage: photorec [/log] [/debug] [/d recup_dir] [file.dd|file.e01|device]\0A photorec /version\0A\0A/log : create a photorec.log file\0A/debug : add debug information\0A\0APhotoRec searches for various file formats (JPEG, Office...). It stores files\0Ain the recup_dir directory.\00"
define void @display_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([288 x i8], [288 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
int /*<<< orphan*/ exynos_5410_gpio_write_mask(unsigned int, unsigned int,
                                               unsigned int);
void odroid_xu_gpio_toggle_13() {
  unsigned int bank_offset = 0x0C20;
  unsigned int bit_index = 5;
  unsigned int d = exynos_5410_gpio_read(bank_offset);
  d ^= (1U << bit_index);
  exynos_5410_gpio_write_mask(bank_offset, d, (1U << bit_index));
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_toggle_13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc20,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <exynos_5410_gpio_read@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1030 <exynos_5410_gpio_write_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_toggle_13>:
push   %rax
mov    $0xc20,%edi
call   1040 <exynos_5410_gpio_read@plt>
xor    $0x20,%eax
mov    $0xc20,%edi
mov    %eax,%esi
mov    $0x20,%edx
pop    %rax
jmp    1030 <exynos_5410_gpio_write_mask@plt>

LLVM IR (-O0):
define void @odroid_xu_gpio_toggle_13() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 3104, i32* %1
store i32 5, i32* %2
%4 = load i32, i32* %1
%5 = call i32 @exynos_5410_gpio_read(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = shl i32 1, %6
%8 = load i32, i32* %3
%9 = xor i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = shl i32 1, %12
%14 = call i32 @exynos_5410_gpio_write_mask(i32 %10, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @odroid_xu_gpio_toggle_13() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3104)
%2 = xor i32 %1, 32
%3 = tail call i32 @exynos_5410_gpio_write_mask(i32 3104, i32 %2, i32 32)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t BaseToInt(char base) {
  switch (base) {
  case 0:
  case '0':
  case 'A':
  case 'a':
    return 0;
  case 1:
  case '1':
  case 'C':
  case 'c':
    return 1;
  case 2:
  case '2':
  case 'G':
  case 'g':
    return 2;
  case 3:
  case '3':
  case 'T':
  case 't':
    return 3;
  default:
    return 4;
  }
}


x86 assembly (clang, -O0):
<BaseToInt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x74,%eax
ja     1161 <BaseToInt+0x61>
mov    -0x10(%rbp),%rax
lea    0xed8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1168 <BaseToInt+0x68>
movl   $0x1,-0x4(%rbp)
jmp    1168 <BaseToInt+0x68>
movl   $0x2,-0x4(%rbp)
jmp    1168 <BaseToInt+0x68>
movl   $0x3,-0x4(%rbp)
jmp    1168 <BaseToInt+0x68>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BaseToInt>:
cmp    $0x74,%edi
ja     112c <BaseToInt+0x2c>
xor    %eax,%eax
mov    %edi,%ecx
lea    0xef0(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
ret
mov    $0x1,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @BaseToInt(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 0, label %6
i32 48, label %6
i32 65, label %6
i32 97, label %6
i32 1, label %7
i32 49, label %7
i32 67, label %7
i32 99, label %7
i32 2, label %8
i32 50, label %8
i32 71, label %8
i32 103, label %8
i32 3, label %9
i32 51, label %9
i32 84, label %9
i32 116, label %9
]
6: ; preds = %1, %1, %1, %1
store i32 0, i32* %2
br label %11
7: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %11
8: ; preds = %1, %1, %1, %1
store i32 2, i32* %2
br label %11
9: ; preds = %1, %1, %1, %1
store i32 3, i32* %2
br label %11
10: ; preds = %1
store i32 4, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @BaseToInt(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 0, label %7
i32 48, label %7
i32 65, label %7
i32 97, label %7
i32 1, label %3
i32 49, label %3
i32 67, label %3
i32 99, label %3
i32 2, label %4
i32 50, label %4
i32 71, label %4
i32 103, label %4
i32 3, label %5
i32 51, label %5
i32 84, label %5
i32 116, label %5
]
3: ; preds = %1, %1, %1, %1
br label %7
4: ; preds = %1, %1, %1, %1
br label %7
5: ; preds = %1, %1, %1, %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %1, %1, %6, %5, %4, %3
%8 = phi i32 [ 4, %6 ], [ 3, %5 ], [ 2, %4 ], [ 1, %3 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
char const *tcerrmsg(int);
const char *tcbdberrmsg(int ecode) { return tcerrmsg(ecode); }


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

x86 assembly (clang, -O2):
<tcbdberrmsg>:
jmp    1030 <tcerrmsg@plt>

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

LLVM IR (-O2):
define i8* @tcbdberrmsg(i32 %0) {
%2 = tail call i8* @tcerrmsg(i32 %0)
ret i8* %2
}
void pass_int_ref(void (*f)(int *)) {
  int x = 1984;
  f(&x);
}


x86 assembly (clang, -O0):
<pass_int_ref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x7c0,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pass_int_ref>:
push   %rax
mov    %rdi,%rax
movl   $0x7c0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   *%rax
pop    %rax
ret

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

LLVM IR (-O2):
define void @pass_int_ref(void (i32*)* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1984, i32* %2
ret void
}
void PWMGenFaultConfigure(unsigned long ulBase, unsigned long ulGen,
                          unsigned long ulMinFaultPeriod,
                          unsigned long ulFaultSenses) {
  ;
  ;
  ;
  ;

  ;
  (*((volatile unsigned long *)(((ulBase) + (ulGen)) + 0x0000003C))) =
      ulMinFaultPeriod;
  (*((volatile unsigned long *)(((ulBase) + 0x00000800 +
                                 ((ulGen)-0x00000040) * 2) +
                                0x00000000))) = ulFaultSenses;
}


x86 assembly (clang, -O0):
<PWMGenFaultConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rcx,0x3c(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x800,%rax
mov    -0x10(%rbp),%rdx
sub    $0x40,%rdx
shl    $0x1,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenFaultConfigure>:
mov    %rdx,0x3c(%rdi,%rsi,1)
mov    %rcx,0x780(%rdi,%rsi,2)
ret

LLVM IR (-O0):
define void @PWMGenFaultConfigure(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %7
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = add i64 %10, %11
%13 = add i64 %12, 60
%14 = inttoptr i64 %13 to i64*
store volatile i64 %9, i64* %14
%15 = load i64, i64* %8
%16 = load i64, i64* %5
%17 = add i64 %16, 2048
%18 = load i64, i64* %6
%19 = sub i64 %18, 64
%20 = mul i64 %19, 2
%21 = add i64 %17, %20
%22 = add i64 %21, 0
%23 = inttoptr i64 %22 to i64*
store volatile i64 %15, i64* %23
ret void
}

LLVM IR (-O2):
define void @PWMGenFaultConfigure(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %0, 60
%6 = add i64 %5, %1
%7 = inttoptr i64 %6 to i64*
store volatile i64 %2, i64* %7
%8 = shl i64 %1, 1
%9 = add i64 %0, 1920
%10 = add i64 %9, %8
%11 = inttoptr i64 %10 to i64*
store volatile i64 %3, i64* %11
ret void
}
/* Variables and functions */
int _itoa(int, char *, int, int);
int itoa(int val, char *_str, int base) {
  char *str = _str;
  int sign = 0;
  if (base == 10)
    sign = 1;
  return _itoa(val, str, base, sign);
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x14(%rbp)
jne    1142 <itoa+0x32>
movl   $0x1,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x24(%rbp),%ecx
call   1030 <_itoa@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
xor    %ecx,%ecx
cmp    $0xa,%edx
sete   %cl
jmp    1030 <_itoa@plt>

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

LLVM IR (-O2):
define i32 @itoa(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 10
%5 = zext i1 %4 to i32
%6 = tail call i32 @_itoa(i32 %0, i8* %1, i32 %2, i32 %5)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int atoi(char *);
int strToInt(uint32_t *env) { return atoi(*(char **)(env + 1)); }


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

x86 assembly (clang, -O2):
<strToInt>:
mov    0x4(%rdi),%rdi
jmp    1030 <atoi@plt>

LLVM IR (-O0):
define i32 @strToInt(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = bitcast i32* %4 to i8**
%6 = load i8*, i8** %5
%7 = call i32 @atoi(i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @strToInt(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = bitcast i32* %2 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
ret i32 %5
}
/* Variables and functions */
int getfile(char *);
int rlreply(char *, char *, int);
int filefind(int f, int n) {
  char fname[80];
  int s;
  if ((s = rlreply("Find file: ", fname, 80)) != 1)
    return (s);
  return (getfile(fname));
}


x86 assembly (clang, -O0):
<filefind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x60(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x50,%edx
call   1030 <rlreply@plt>
mov    %eax,-0x64(%rbp)
cmp    $0x1,%eax
je     115a <filefind+0x3a>
mov    -0x64(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <filefind+0x46>
lea    -0x60(%rbp),%rdi
call   1040 <getfile@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filefind>:
sub    $0x58,%rsp
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
mov    $0x50,%edx
call   1030 <rlreply@plt>
cmp    $0x1,%eax
jne    1145 <filefind+0x25>
mov    %rsp,%rdi
call   1040 <getfile@plt>
add    $0x58,%rsp
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"Find file: \00"
define i32 @filefind(i32 %0, i32 %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = call i32 @rlreply(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4, i32 80)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @getfile(i8* %4)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %5, %2 ]
ret i32 %10
}
void escapes() {
  const char *const foo = "\x66\x6f\x6f";
  int x = 1 | 2;
}


x86 assembly (clang, -O0):
<escapes>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define void @escapes() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i32 3, i32* %2
ret void
}

LLVM IR (-O2):
define void @escapes() {
ret void
}
int cmx_shm_unpack_iserror(const int value_handle) {
  return (value_handle < 0) ? 1 : 0;
}


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

x86 assembly (clang, -O2):
<cmx_shm_unpack_iserror>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @cmx_shm_unpack_iserror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt 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 @cmx_shm_unpack_iserror(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
int fibonacci(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%i\n", fibonacci(5));
  printf("%i\n", fibonacci(1));
  printf("%i\n", fibonacci(0));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1040 <fibonacci@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <fibonacci@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <fibonacci@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1040 <fibonacci@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <fibonacci@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <fibonacci@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @fibonacci(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @fibonacci(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @fibonacci(i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fail(char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int NI_USUAL_RTSI_SELECT(unsigned int);
unsigned NI_EXT_RTSI(unsigned rtsi_channel) {
  return NI_USUAL_RTSI_SELECT(rtsi_channel) - 1;
}


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

x86 assembly (clang, -O2):
<NI_EXT_RTSI>:
push   %rax
call   1030 <NI_USUAL_RTSI_SELECT@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @NI_EXT_RTSI(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @NI_USUAL_RTSI_SELECT(i32 %3)
%5 = sub nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @NI_EXT_RTSI(i32 %0) {
%2 = tail call i32 @NI_USUAL_RTSI_SELECT(i32 %0)
%3 = add nsw i32 %2, -1
ret i32 %3
}
void XSharpFreeFontSet(void *dpy, void *fontSet) {}


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

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

LLVM IR (-O0):
define void @XSharpFreeFontSet(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 @XSharpFreeFontSet(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_error(char *);
int sscanf(char const *, char *, int *);
int parse_hex(char const *str) {
  int value;
  if (sscanf(str, "0x%x", &value) != 1 && sscanf(str, "0X%x", &value) != 1)
    parse_error("expected hexadecimal value");
  return value;
}


x86 assembly (clang, -O0):
<parse_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1172 <parse_hex+0x52>
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1172 <parse_hex+0x52>
lea    0xe9d(%rip),%rdi
call   1040 <parse_error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_hex>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xed1(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1163 <parse_hex+0x43>
lea    0xec0(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1163 <parse_hex+0x43>
lea    0xeac(%rip),%rdi
call   1040 <parse_error@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"0x%x\00"
@.str.1 = [5 x i8] c"0X%x\00"
@.str.2 = [27 x i8] c"expected hexadecimal value\00"
define i32 @parse_hex(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @parse_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %7, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"0x%x\00"
@.str.1 = [5 x i8] c"0X%x\00"
@.str.2 = [27 x i8] c"expected hexadecimal value\00"
define i32 @parse_hex(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = icmp eq i32 %7, 1
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = call i32 @parse_error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %6, %1
%12 = load i32, i32* %2
ret i32 %12
}
/* Variables and functions */
int matrizes_iguais(double **, double **, int, int);
bool confere_interpolacao_polinomial(double **P, double **P_ok, int dim) {
  return matrizes_iguais(P, P_ok, dim, 1);
}


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

x86 assembly (clang, -O2):
<confere_interpolacao_polinomial>:
mov    $0x1,%ecx
jmp    1030 <matrizes_iguais@plt>

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

LLVM IR (-O2):
define i32 @confere_interpolacao_polinomial(double** %0, double** %1, i32 %2) {
%4 = tail call i32 @matrizes_iguais(double** %0, double** %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xfe() {
  Assert_real((iscntrl(254) == 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_iscntrl.c",
              1275, ("iscntrl should be 0 for 0xfe"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xfe>:
push   %rax
mov    $0xfe,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4fb,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xfe\00"
define void @t_iscntrl_0xfe() {
%1 = call i64 @iscntrl(i32 254)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1275, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xfe\00"
define void @t_iscntrl_0xfe() {
%1 = tail call i64 @iscntrl(i32 254)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1275, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}