xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *simplifyPath(char *);
int main() {
  printf("%s\n", simplifyPath("/a/b/c/d/"));
  printf("%s\n", simplifyPath("/a/../c/.."));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <simplifyPath@plt>
mov    %rax,%rsi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
call   1030 <simplifyPath@plt>
mov    %rax,%rsi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xedc(%rip),%rdi
call   1030 <simplifyPath@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1030 <simplifyPath@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [10 x i8] c"/a/b/c/d/\00"
@.str.2 = [11 x i8] c"/a/../c/..\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* @simplifyPath(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @simplifyPath(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [10 x i8] c"/a/b/c/d/\00"
@.str.2 = [11 x i8] c"/a/../c/..\00"
define i32 @main() {
%1 = tail call i8* @simplifyPath(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i8* @simplifyPath(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
unsigned long _get_base(char *addr) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @_get_base(i8* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int get_info_nc(int, int);
scalar_t__ is_valid_position(int, int);
int get_info_wc(int x, int y) {
  if (is_valid_position(x, y)) {
    return get_info_nc(x, y);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_info_wc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <is_valid_position@plt>
cmp    $0x0,%rax
je     1156 <get_info_wc+0x36>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <get_info_nc@plt>
mov    %eax,-0x4(%rbp)
jmp    115d <get_info_wc+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_info_wc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <is_valid_position@plt>
test   %rax,%rax
je     1140 <get_info_wc+0x20>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <get_info_nc@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @get_info_wc(i32 %0, i32 %1) {
%3 = tail call i64 @is_valid_position(i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @get_info_nc(i32 %0, i32 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
void ChooseUnit() {}


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

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

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

LLVM IR (-O2):
define void @ChooseUnit() {
ret void
}
void counter(void *data, void *placement) {
  (void)placement;
  ++*(int *)data;
}


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

x86 assembly (clang, -O2):
<counter>:
addl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @counter(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @counter(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ sio_puts(char *, int);
void Sio_error(char *msg, int len) {
  sio_puts(msg, len);
  _exit(1);
}


x86 assembly (clang, -O0):
<Sio_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <sio_puts@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<Sio_error>:
push   %rax
call   1040 <sio_puts@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @Sio_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @sio_puts(i8* %5, i32 %6)
%8 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @Sio_error(i8* %0, i32 %1) {
%3 = tail call i32 @sio_puts(i8* %0, i32 %1)
%4 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int lua_dobuffer(char *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ strlen(char *);
int lua_dostring(char *str) { return lua_dobuffer(str, strlen(str), str); }


x86 assembly (clang, -O0):
<lua_dostring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
call   1040 <lua_dobuffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_dostring>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <lua_dobuffer@plt>

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

LLVM IR (-O2):
define i32 @lua_dostring(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @lua_dobuffer(i8* %0, i32 %2, i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cfg_get(char *);
int file_exists_in_dir(int /*<<< orphan*/, char const *);
int file_exists_in_save_dir(const char *fname) {
  return file_exists_in_dir(cfg_get("saved-games-dirname"), fname);
}


x86 assembly (clang, -O0):
<file_exists_in_save_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <cfg_get@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <file_exists_in_dir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists_in_save_dir>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <cfg_get@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <file_exists_in_dir@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"saved-games-dirname\00"
define i32 @file_exists_in_save_dir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @cfg_get(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @file_exists_in_dir(i32 %3, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [20 x i8] c"saved-games-dirname\00"
define i32 @file_exists_in_save_dir(i8* %0) {
%2 = tail call i32 @cfg_get(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @file_exists_in_dir(i32 %2, i8* %0)
ret i32 %3
}
void highbank_lluart_map_io(void) {}


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

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

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

LLVM IR (-O2):
define void @highbank_lluart_map_io() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ close(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  FILE *f = fopen("openpf2.c", "rb");
  if (f == NULL)
    abort();
  close(f);
  printf("pass\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <main+0x3f>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rdi
call   1050 <close@plt>
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     1171 <main+0x31>
mov    %rax,%rdi
call   1050 <close@plt>
lea    0xea5(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"openpf2.c\00"
@.str.1 = [3 x i8] c"rb\00"
@str = [5 x i8] c"pass\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = tail call i32 @close(i32* %3)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void append(char *s1, const char *s2) {
  while (*s1 != '\0') {
    ++s1;
  }
  while (*s1 = *s2) {
    ++s1, ++s2;
  }
  return;
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112d <append+0x2d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <append+0xc>
jmp    1132 <append+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1163 <append+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1132 <append+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <append>
mov    (%rsi),%al
mov    %al,-0x1(%rdi)
test   %al,%al
je     1130 <append+0x30>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1120 <append+0x20>
ret

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

LLVM IR (-O2):
define void @append(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
store i8 %9, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8, %11
%12 = phi i8* [ %15, %11 ], [ %1, %8 ]
%13 = phi i8* [ %14, %11 ], [ %4, %8 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = load i8, i8* %15
store i8 %16, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %11
18: ; preds = %11, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heap_sift(int, int, double *);
void heap_build(int n, double x[]) {
  int i;
  for (i = n / 2; i >= 0; i--)
    heap_sift(i, n - 1, x);
}


x86 assembly (clang, -O0):
<heap_build>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1157 <heap_build+0x47>
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
mov    -0x10(%rbp),%rdx
call   1030 <heap_sift@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <heap_build+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_build>:
push   %rbp
push   %r14
push   %rbx
cmp    $0xffffffff,%edi
jl     1141 <heap_build+0x31>
mov    %rsi,%r14
mov    %edi,%ebx
mov    %edi,%ebp
shr    $0x1f,%ebp
add    %edi,%ebp
sar    %ebp
add    $0xffffffff,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14,%rdx
call   1030 <heap_sift@plt>
add    $0xffffffff,%ebp
jb     1130 <heap_build+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @heap_build(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 2
store i32 %7, i32* %5
br label %8
8: ; preds = %17, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
%15 = load double*, double** %4
%16 = call i32 @heap_sift(i32 %12, i32 %14, double* %15)
br label %17
17: ; preds = %11
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %8
20: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @heap_build(i32 %0, double* %1) {
%3 = icmp sgt i32 %0, -2
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = sdiv i32 %0, 2
%6 = add nsw i32 %0, -1
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %5, %4 ], [ %10, %7 ]
%9 = tail call i32 @heap_sift(i32 %8, i32 %6, double* %1)
%10 = add nsw i32 %8, -1
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XIconifyWindow() {
  printf("XIconifyWindow called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"XIconifyWindow called\00"
define i32 @XIconifyWindow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x57() {
  Assert_real((isbdigit(87) == 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_isbdigit.c",
              440, ("isbdigit should be 0 for W"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x57>:
push   %rax
mov    $0x57,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1b8,%edx
pop    %rax
jmp    1030 <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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for W\00"
define void @t_isbdigit_0x57() {
%1 = call i64 @isbdigit(i32 87)
%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 440, 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for W\00"
define void @t_isbdigit_0x57() {
%1 = tail call i64 @isbdigit(i32 87)
%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 440, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int closeQueue();
int terminate() {
  int ret = 0;
  if ((ret = closeQueue()) != 0) {
    return ret;
  }
  return ret;
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <closeQueue@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     113d <terminate+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <terminate+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @terminate() {
%1 = tail call i32 (...) @closeQueue()
ret i32 %1
}
int _chdir(const char *path) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_chdir(i8* nocapture readnone %0) {
ret i32 -1
}
void CounterToLocalTimeC__1__Counter__overflow(void) {}


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

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

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

LLVM IR (-O2):
define void @CounterToLocalTimeC__1__Counter__overflow() {
ret void
}
/* Variables and functions */
size_t retro_serialize_size() { return 0; }


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

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

LLVM IR (-O0):
define i64 @retro_serialize_size() {
ret i64 0
}

LLVM IR (-O2):
define i64 @retro_serialize_size() {
ret i64 0
}
int check_blocksize(int size) {
  switch (size) {
  case 512:
  case 1024:
  case 2048:
  case 4096:
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<check_blocksize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x200,%eax
je     1156 <check_blocksize+0x56>
jmp    111d <check_blocksize+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x400,%eax
je     1156 <check_blocksize+0x56>
jmp    1130 <check_blocksize+0x30>
mov    -0xc(%rbp),%eax
sub    $0x800,%eax
je     1156 <check_blocksize+0x56>
jmp    1143 <check_blocksize+0x43>
mov    -0xc(%rbp),%eax
sub    $0x1000,%eax
jne    1162 <check_blocksize+0x62>
jmp    1156 <check_blocksize+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1169 <check_blocksize+0x69>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_blocksize>:
add    $0xfffffe00,%edi
rol    $0x17,%edi
mov    $0xffffffff,%eax
cmp    $0x7,%edi
ja     1120 <check_blocksize+0x20>
movslq %edi,%rax
lea    0xee3(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @check_blocksize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 512, label %5
i32 1024, label %5
i32 2048, label %5
i32 4096, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 0, i32* %2
br label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@switch.table.check_blocksize = [8 x i32] [i32 0, i32 0, i32 -1, i32 0, i32 -1, i32 -1, i32 -1, i32 0]
define i32 @check_blocksize(i32 %0) {
%2 = add i32 %0, -512
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 23)
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.check_blocksize, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ -1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *proc) { fprintf(stderr, "usage: %s [-s] <file>\n", proc); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"usage: %s [-s] <file>\0A\00"
define void @usage(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 ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"usage: %s [-s] <file>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int __bsfq(long long);
int test__bsfq(long long X) { return __bsfq(X); }


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

x86 assembly (clang, -O2):
<test__bsfq>:
jmp    1030 <__bsfq@plt>

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

LLVM IR (-O2):
define i32 @test__bsfq(i64 %0) {
%2 = tail call i32 @__bsfq(i64 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_UTCTIME;

/* Variables and functions */
int /*<<< orphan*/ ASN1_UTCTIME_it;
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
ASN1_UTCTIME *ASN1_UTCTIME_new(void) {
  return (ASN1_UTCTIME *)ASN1_item_new(&ASN1_UTCTIME_it);
}


x86 assembly (clang, -O0):
<ASN1_UTCTIME_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_UTCTIME_new>:
mov    0x2ed1(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@ASN1_UTCTIME_it = global i32 0
define i32* @ASN1_UTCTIME_new() {
%1 = call i64 @ASN1_item_new(i32* @ASN1_UTCTIME_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@ASN1_UTCTIME_it = global i32 0
define i32* @ASN1_UTCTIME_new() {
%1 = tail call i64 @ASN1_item_new(i32* @ASN1_UTCTIME_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
int hashKey(char *s) {
  unsigned long key = 0;
  while (*s)
    key += *s++;
  return key % 256;
}


x86 assembly (clang, -O0):
<hashKey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <hashKey+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbq (%rax),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashKey+0x10>
mov    -0x10(%rbp),%rax
and    $0xff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashKey>:
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <hashKey+0x25>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashKey+0x10>
movzbl %al,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hashKey(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = sext i8 %11 to i64
%13 = load i64, i64* %3
%14 = add i64 %13, %12
store i64 %14, i64* %3
br label %4
15: ; preds = %4
%16 = load i64, i64* %3
%17 = urem i64 %16, 256
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @hashKey(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = zext i8 %5 to i64
%10 = add i64 %6, %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = trunc i64 %10 to i32
%15 = and i32 %14, 255
br label %16
16: ; preds = %13, %1
%17 = phi i32 [ 0, %1 ], [ %15, %13 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ set_wram_mode(int);
void set_wram_default_mode() { set_wram_mode(1); }


x86 assembly (clang, -O0):
<set_wram_default_mode>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <set_wram_mode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_wram_default_mode>:
mov    $0x1,%edi
jmp    1030 <set_wram_mode@plt>

LLVM IR (-O0):
define void @set_wram_default_mode() {
%1 = call i32 @set_wram_mode(i32 1)
ret void
}

LLVM IR (-O2):
define void @set_wram_default_mode() {
%1 = tail call i32 @set_wram_mode(i32 1)
ret void
}
void enable_interrupt_key(void) {}


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

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

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

LLVM IR (-O2):
define void @enable_interrupt_key() {
ret void
}
long int __strtol_l(int a) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @__strtol_l(i32 %0) {
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int);
int /*<<< orphan*/ pr_indent(int /*<<< orphan*/ *, int);
int pr_title_n(FILE *fp, int indent, char *title, int n) {
  (void)pr_indent(fp, indent);
  (void)fprintf(fp, "%s (%d):\n", title, n);
  return (indent + 3);
}


x86 assembly (clang, -O0):
<pr_title_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <pr_indent@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_title_n>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <pr_indent@plt>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1030 <fprintf@plt>
add    $0x3,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s (%d):\0A\00"
define i32 @pr_title_n(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @pr_indent(i32* %0, i32 %1)
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
%7 = add nsw i32 %1, 3
ret i32 %7
}
int is_in_bound(int *arr, int size, int *ptr) {
  if (ptr <= arr + size && ptr >= arr)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
ja     1145 <is_in_bound+0x45>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1145 <is_in_bound+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <is_in_bound+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rax
cmp    %rdx,%rax
setae  %al
cmp    %rdi,%rdx
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = icmp uge i32* %5, %2
%7 = icmp uge i32* %2, %0
%8 = and i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
int main() { _Exit(2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <_Exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <_Exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
unreachable
}

LLVM IR (-O2):
define i32 @main() {
tail call void @_Exit(i32 2)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void __runtime_error(int64_t c) { exit(c); }


x86 assembly (clang, -O0):
<__runtime_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<__runtime_error>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @__runtime_error(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int nnls_(double *, int const *, int const *, int const *, double *, double *,
          double *, double *, double *, int *, int *);
int nnls_c(double *a, const int *mda, const int *m, const int *n, double *b,
           double *x, double *rnorm, double *w, double *zz, int *index,
           int *mode) {
  return (nnls_(a, mda, m, n, b, x, rnorm, w, zz, index, mode));
}


x86 assembly (clang, -O0):
<nnls_c>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    -0x40(%rbp),%r9
mov    0x10(%rbp),%r14
mov    0x18(%rbp),%rbx
mov    0x20(%rbp),%r11
mov    0x28(%rbp),%r10
mov    0x30(%rbp),%rax
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <nnls_@plt>
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<nnls_c>:
jmp    1030 <nnls_@plt>

LLVM IR (-O0):
define i32 @nnls_c(double* %0, i32* %1, i32* %2, i32* %3, double* %4, double* %5, double* %6, double* %7, double* %8, i32* %9, i32* %10) {
%12 = alloca double*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca i32*
%22 = alloca i32*
store double* %0, double** %12
store i32* %1, i32** %13
store i32* %2, i32** %14
store i32* %3, i32** %15
store double* %4, double** %16
store double* %5, double** %17
store double* %6, double** %18
store double* %7, double** %19
store double* %8, double** %20
store i32* %9, i32** %21
store i32* %10, i32** %22
%23 = load double*, double** %12
%24 = load i32*, i32** %13
%25 = load i32*, i32** %14
%26 = load i32*, i32** %15
%27 = load double*, double** %16
%28 = load double*, double** %17
%29 = load double*, double** %18
%30 = load double*, double** %19
%31 = load double*, double** %20
%32 = load i32*, i32** %21
%33 = load i32*, i32** %22
%34 = call i32 @nnls_(double* %23, i32* %24, i32* %25, i32* %26, double* %27, double* %28, double* %29, double* %30, double* %31, i32* %32, i32* %33)
ret i32 %34
}

LLVM IR (-O2):
define i32 @nnls_c(double* %0, i32* %1, i32* %2, i32* %3, double* %4, double* %5, double* %6, double* %7, double* %8, i32* %9, i32* %10) {
%12 = tail call i32 @nnls_(double* %0, i32* %1, i32* %2, i32* %3, double* %4, double* %5, double* %6, double* %7, double* %8, i32* %9, i32* %10)
ret i32 %12
}
float f_sin_xx_10(float xx) {
  return 0.7853981633974483 +
         xx * (-0.08074551218802455 +
               xx * (0.002490394567124187 +
                     xx * (-3.65761914008964e-05 +
                           xx * (3.133376118159403e-07 +
                                 xx * (-1.736214417895343e-09)))));
}


x86 assembly (clang, -O0):
<f_sin_xx_10>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x4(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x4(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
movss  -0x4(%rbp),%xmm4
cvtss2sd %xmm4,%xmm4
movsd  0xee2(%rip),%xmm5
mulsd  %xmm5,%xmm4
movsd  0xede(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xebe(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xea6(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe8e(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe76(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_sin_xx_10>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeec(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee0(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f_sin_xx_10(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = call double @llvm.fmuladd.f64(double %12, double 0xBE1DD3F3A6BFFFFF, double 0x3E95071963F43001)
%14 = call double @llvm.fmuladd.f64(double %10, double %13, double 0xBF032D2C5DF5DABF)
%15 = call double @llvm.fmuladd.f64(double %8, double %14, double 0x3F6466BC6709B3FE)
%16 = call double @llvm.fmuladd.f64(double %6, double %15, double 0xBFB4ABBCE6257633)
%17 = call double @llvm.fmuladd.f64(double %4, double %16, double 0x3FE921FB54442D18)
%18 = fptrunc double %17 to float
ret float %18
}

LLVM IR (-O2):
define float @f_sin_xx_10(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0xBE1DD3F3A6BFFFFF, double 0x3E95071963F43001)
%4 = tail call double @llvm.fmuladd.f64(double %2, double %3, double 0xBF032D2C5DF5DABF)
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double 0x3F6466BC6709B3FE)
%6 = tail call double @llvm.fmuladd.f64(double %2, double %5, double 0xBFB4ABBCE6257633)
%7 = tail call double @llvm.fmuladd.f64(double %2, double %6, double 0x3FE921FB54442D18)
%8 = fptrunc double %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
void set_filemode(int fd, int set) {
  int flags = fcntl(fd, F_GETFL, 0);
  if (set)
    flags &= ~O_NONBLOCK;
  else
    flags |= O_NONBLOCK;
  fcntl(fd, F_SETFL, flags);
}


x86 assembly (clang, -O0):
<set_filemode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1155 <set_filemode+0x45>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <set_filemode+0x54>
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_filemode>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eba(%rip),%rcx
mov    (%rcx),%edx
mov    %edx,%ecx
not    %ecx
and    %eax,%ecx
or     %eax,%edx
test   %ebx,%ebx
cmovne %ecx,%edx
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @set_filemode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* @F_GETFL
%8 = call i32 @fcntl(i32 %6, i32 %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @O_NONBLOCK
%13 = xor i32 %12, -1
%14 = load i32, i32* %5
%15 = and i32 %14, %13
store i32 %15, i32* %5
br label %20
16: ; preds = %2
%17 = load i32, i32* @O_NONBLOCK
%18 = load i32, i32* %5
%19 = or i32 %18, %17
store i32 %19, i32* %5
br label %20
20: ; preds = %16, %11
%21 = load i32, i32* %3
%22 = load i32, i32* @F_SETFL
%23 = load i32, i32* %5
%24 = call i32 @fcntl(i32 %21, i32 %22, i32 %23)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @set_filemode(i32 %0, i32 %1) {
%3 = load i32, i32* @F_GETFL
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 0)
%5 = icmp eq i32 %1, 0
%6 = load i32, i32* @O_NONBLOCK
%7 = xor i32 %6, -1
%8 = and i32 %4, %7
%9 = or i32 %6, %4
%10 = select i1 %5, i32 %9, i32 %8
%11 = load i32, i32* @F_SETFL
%12 = tail call i32 @fcntl(i32 %0, i32 %11, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((no)) void actual(void) { printf("in actual\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"in actual\00"
define void @actual() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eh_valido(int, char *);
int resto(int, char *);
int contar_soma_bits(int n, char *p) {
  int c = 0;
  while (!eh_valido(n, p)) {
    int r = resto(n, p);
    if (r == 1)
      c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<contar_soma_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <eh_valido@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1157 <contar_soma_bits+0x37>
jmp    117e <contar_soma_bits+0x5e>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <resto@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1179 <contar_soma_bits+0x59>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <contar_soma_bits+0x16>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contar_soma_bits>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1040 <eh_valido@plt>
xor    %ebx,%ebx
test   %eax,%eax
jne    1162 <contar_soma_bits+0x42>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <resto@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %ecx,%ebx
mov    %ebp,%edi
mov    %r14,%rsi
call   1040 <eh_valido@plt>
test   %eax,%eax
je     1140 <contar_soma_bits+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @contar_soma_bits(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %7
7: ; preds = %22, %2
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i32 @eh_valido(i32 %8, i8* %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %23
13: ; preds = %7
%14 = load i32, i32* %3
%15 = load i8*, i8** %4
%16 = call i32 @resto(i32 %14, i8* %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %22
22: ; preds = %19, %13
br label %7
23: ; preds = %7
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @contar_soma_bits(i32 %0, i8* %1) {
%3 = tail call i32 @eh_valido(i32 %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ 0, %2 ]
%7 = tail call i32 @resto(i32 %0, i8* %1)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %6, %9
%11 = tail call i32 @eh_valido(i32 %0, i8* %1)
%12 = icmp eq i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %5, %2
%14 = phi i32 [ 0, %2 ], [ %10, %5 ]
ret i32 %14
}