xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dev_read(long, long, long);
int /*<<< orphan*/ getParLong(long *);
void IF_devRead(void) {
  long n, sd, ch;
  if (!getParLong(&ch))
    return;
  if (!getParLong(&sd))
    return;
  if (!getParLong(&n))
    return;
  dev_read(n, sd, ch);
}


x86 assembly (clang, -O0):
<IF_devRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
call   1040 <getParLong@plt>
cmp    $0x0,%eax
jne    113f <IF_devRead+0x1f>
jmp    117e <IF_devRead+0x5e>
lea    -0x10(%rbp),%rdi
call   1040 <getParLong@plt>
cmp    $0x0,%eax
jne    1156 <IF_devRead+0x36>
jmp    117e <IF_devRead+0x5e>
lea    -0x8(%rbp),%rdi
call   1040 <getParLong@plt>
cmp    $0x0,%eax
jne    116d <IF_devRead+0x4d>
jmp    117e <IF_devRead+0x5e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <dev_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_devRead>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1040 <getParLong@plt>
test   %eax,%eax
je     115f <IF_devRead+0x3f>
lea    0x8(%rsp),%rdi
call   1040 <getParLong@plt>
test   %eax,%eax
je     115f <IF_devRead+0x3f>
lea    0x10(%rsp),%rdi
call   1040 <getParLong@plt>
test   %eax,%eax
je     115f <IF_devRead+0x3f>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    (%rsp),%rdx
call   1030 <dev_read@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @IF_devRead() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = call i32 @getParLong(i64* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %0
br label %20
7: ; preds = %0
%8 = call i32 @getParLong(i64* %2)
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7
br label %20
11: ; preds = %7
%12 = call i32 @getParLong(i64* %1)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %11
br label %20
15: ; preds = %11
%16 = load i64, i64* %1
%17 = load i64, i64* %2
%18 = load i64, i64* %3
%19 = call i32 @dev_read(i64 %16, i64 %17, i64 %18)
br label %20
20: ; preds = %15, %14, %10, %6
ret void
}

LLVM IR (-O2):
define void @IF_devRead() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
%5 = bitcast i64* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = call i32 @getParLong(i64* %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %20, label %9
9: ; preds = %0
%10 = call i32 @getParLong(i64* %2)
%11 = icmp eq i32 %10, 0
br i1 %11, label %20, label %12
12: ; preds = %9
%13 = call i32 @getParLong(i64* %1)
%14 = icmp eq i32 %13, 0
br i1 %14, label %20, label %15
15: ; preds = %12
%16 = load i64, i64* %1
%17 = load i64, i64* %2
%18 = load i64, i64* %3
%19 = call i32 @dev_read(i64 %16, i64 %17, i64 %18)
br label %20
20: ; preds = %12, %9, %0, %15
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int WriteFrmtd(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  FILE *fp;
  fp = fopen("file.txt", "w");
  int i = WriteFrmtd(fp, "This is just one argument %d \n", 10);
  printf("%d\n", i);
  fclose(fp);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe9a(%rip),%rsi
mov    $0xa,%edx
call   1060 <WriteFrmtd@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xead(%rip),%rsi
mov    %rax,%rdi
mov    $0xa,%edx
call   1060 <WriteFrmtd@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"file.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [31 x i8] c"This is just one argument %d \0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @WriteFrmtd(i32* %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 10)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %2
%10 = call i32 @fclose(i32* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"file.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [31 x i8] c"This is just one argument %d \0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @WriteFrmtd(i32* %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 10)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %2)
%4 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
void string_iterate_lines(char **strings, void (*closure)(char *)) {
  while (*strings != NULL) {
    closure(*strings);
    strings++;
  }
}


x86 assembly (clang, -O0):
<string_iterate_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     113c <string_iterate_lines+0x3c>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rdi
call   *%rax
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <string_iterate_lines+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_iterate_lines>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112f <string_iterate_lines+0x2f>
mov    %rsi,%r14
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
call   *%r14
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <string_iterate_lines+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @string_iterate_lines(i8** nocapture %0, void (i8*)* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %3, %2 ]
%7 = phi i8** [ %8, %5 ], [ %0, %2 ]
tail call void %1(i8* %6)
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %5
11: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ clear();
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int);
int /*<<< orphan*/ nc_populate();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
void nc_start(void) {
  initscr();
  cbreak();
  keypad(stdscr, 1);
  noecho();
  curs_set(1);
  clear();
  refresh();
  nc_populate();
}


x86 assembly (clang, -O0):
<nc_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1040 <cbreak@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1050 <keypad@plt>
mov    $0x0,%al
call   1080 <noecho@plt>
mov    $0x1,%edi
call   10a0 <curs_set@plt>
mov    $0x0,%al
call   1090 <clear@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x0,%al
call   1030 <nc_populate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nc_start>:
push   %rax
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   1040 <cbreak@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1050 <keypad@plt>
xor    %eax,%eax
call   1080 <noecho@plt>
mov    $0x1,%edi
call   10a0 <curs_set@plt>
xor    %eax,%eax
call   1090 <clear@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nc_populate@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @nc_start() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = load i32, i32* @stdscr
%4 = call i32 @keypad(i32 %3, i32 1)
%5 = call i32 (...) @noecho()
%6 = call i32 @curs_set(i32 1)
%7 = call i32 (...) @clear()
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @nc_populate()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @nc_start() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = load i32, i32* @stdscr
%4 = tail call i32 @keypad(i32 %3, i32 1)
%5 = tail call i32 (...) @noecho()
%6 = tail call i32 @curs_set(i32 1)
%7 = tail call i32 (...) @clear()
%8 = tail call i32 (...) @refresh()
%9 = tail call i32 (...) @nc_populate()
ret void
}
/* Type definitions */
struct test_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ put_clear();
void menu_clear_screen(struct test_list *test, int *state, int *ch) {
  put_clear();
}


x86 assembly (clang, -O0):
<menu_clear_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <put_clear@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_list = type { i32 }
define void @menu_clear_screen(%struct.test_list* %0, i32* %1, i32* %2) {
%4 = alloca %struct.test_list*
%5 = alloca i32*
%6 = alloca i32*
store %struct.test_list* %0, %struct.test_list** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = call i32 (...) @put_clear()
ret void
}

LLVM IR (-O2):
%struct.test_list = type { i32 }
define void @menu_clear_screen(%struct.test_list* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = tail call i32 (...) @put_clear()
ret void
}
void HariMain(void) {
  *((char *)0x00102600) = 0;
  return;
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x102600,%eax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HariMain>:
movb   $0x0,0x102600
ret

LLVM IR (-O0):
define void @HariMain() {
store i8 0, i8* inttoptr (i64 1058304 to i8*)
ret void
}

LLVM IR (-O2):
define void @HariMain() {
store i8 0, i8* inttoptr (i64 1058304 to i8*)
ret void
}
/* Variables and functions */
int fwClose(int);
int _close(int file) { return fwClose(file); }


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

x86 assembly (clang, -O2):
<_close>:
jmp    1030 <fwClose@plt>

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
%2 = tail call i32 @fwClose(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
volatile uint8_t *mem_get_reg8(uint32_t addr) {
  return (volatile uint8_t *)addr;
}


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

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

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

LLVM IR (-O2):
define i32* @mem_get_reg8(i64 %0) {
%2 = inttoptr i64 %0 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_LAZY;
int /*<<< orphan*/ dlerror();
void *dlopen(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
size_t _loadlib(const char *path) {
  void *hlib = dlopen(path, RTLD_LAZY);
  if (!hlib)
    fputs(dlerror(), stderr);
  return (size_t)hlib;
}


x86 assembly (clang, -O0):
<_loadlib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
call   1050 <dlopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <_loadlib+0x44>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %eax,%edi
mov    0x2e73(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_loadlib>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
call   1050 <dlopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115e <_loadlib+0x2e>
xor    %eax,%eax
call   1030 <dlerror@plt>
mov    0x2e8b(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <fputs@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@RTLD_LAZY = global i32 0
@stderr = global i32 0
define i64 @_loadlib(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @RTLD_LAZY
%6 = call i8* @dlopen(i8* %4, i32 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = call i32 (...) @dlerror()
%11 = load i32, i32* @stderr
%12 = call i32 @fputs(i32 %10, i32 %11)
br label %13
13: ; preds = %9, %1
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %14 to i64
ret i64 %15
}

LLVM IR (-O2):
@RTLD_LAZY = global i32 0
@stderr = global i32 0
define i64 @_loadlib(i8* %0) {
%2 = load i32, i32* @RTLD_LAZY
%3 = tail call i8* @dlopen(i8* %0, i32 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 (...) @dlerror()
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputs(i32 %6, i32 %7)
br label %9
9: ; preds = %5, %1
%10 = ptrtoint i8* %3 to i64
ret i64 %10
}
int h(double i) { return (i + 2.0) <= i; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @h(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 2.000000e+00
%5 = load double, double* %2
%6 = fcmp ole double %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @h(double %0) {
%2 = fadd double %0, 2.000000e+00
%3 = fcmp ole double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double pow(double, double);
double f3(double x) { return pow(x, 3.0) - x * x - 3.0 * x + 1.8; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
call   1030 <pow@plt>
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xea3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe8b(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xee2(%rip),%xmm1
call   1030 <pow@plt>
movsd  (%rsp),%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  0xed0(%rip),%xmm2
subsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  0xec8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 3.000000e+00)
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fneg double %5
%8 = call double @llvm.fmuladd.f64(double %7, double %6, double %4)
%9 = load double, double* %2
%10 = call double @llvm.fmuladd.f64(double -3.000000e+00, double %9, double %8)
%11 = fadd double %10, 1.800000e+00
ret double %11
}

LLVM IR (-O2):
define double @f3(double %0) {
%2 = tail call double @pow(double %0, double 3.000000e+00)
%3 = fneg double %0
%4 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %2)
%5 = tail call double @llvm.fmuladd.f64(double %0, double -3.000000e+00, double %4)
%6 = fadd double %5, 1.800000e+00
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ msg(char *, char *, char *);
void pdie(char *fn, char *cp) {
  msg("BMP %s: %s\n", fn, cp);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"BMP %s: %s\0A\00"
define void @pdie(i8* %0, i8* %1) {
%3 = tail call i32 @msg(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void console_tty_close(int console_tty_fd) { close(console_tty_fd); }


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

x86 assembly (clang, -O2):
<console_tty_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @console_tty_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
__attribute__((__weak__, __always___)) void softboundcets_puts(char *ptr) {
  puts(ptr);
}


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

x86 assembly (clang, -O2):
<softboundcets_puts>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define weak void @softboundcets_puts(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
int ft_strlen(char *str) {
  int i;
  i = 0;
  while (str[i] != '\0') {
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <ft_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ wait(int *);
void traitement_signal(int sig) { wait(&sig); }


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

x86 assembly (clang, -O2):
<traitement_signal>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <wait@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @traitement_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @wait(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
char *canonicalize_file_name(char *);
int major(int /*<<< orphan*/);
int minor(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
char *devt_to_devpath(dev_t dev) {
  char device[46];
  sprintf(device, "/sys/dev/block/%d:%d/device", major(dev), minor(dev));
  return canonicalize_file_name(device);
}


x86 assembly (clang, -O0):
<devt_to_devpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <major@plt>
mov    %eax,-0x44(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <minor@plt>
mov    -0x50(%rbp),%rdi
mov    -0x44(%rbp),%edx
mov    %eax,%ecx
lea    0xe8a(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <canonicalize_file_name@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devt_to_devpath>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
mov    %edi,%ebx
call   1040 <major@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <minor@plt>
lea    0xea3(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <canonicalize_file_name@plt>
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"/sys/dev/block/%d:%d/device\00"
define i8* @devt_to_devpath(i32 %0) {
%2 = alloca i32
%3 = alloca [46 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [46 x i8], [46 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @major(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @minor(i32 %7)
%9 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
%10 = getelementptr inbounds [46 x i8], [46 x i8]* %3, i64 0, i64 0
%11 = call i8* @canonicalize_file_name(i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [28 x i8] c"/sys/dev/block/%d:%d/device\00"
define i8* @devt_to_devpath(i32 %0) {
%2 = alloca [46 x i8]
%3 = getelementptr inbounds [46 x i8], [46 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @major(i32 %0)
%5 = tail call i32 @minor(i32 %0)
%6 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i8* @canonicalize_file_name(i8* %3)
ret i8* %7
}
int test_imm_C7int16_mem(short *val) {
  return ((*val) & (-0xC7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C7int16_mem>:
movzwl (%rdi),%eax
test   $0xff39,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C7int16_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, -199
%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_C7int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -199
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t galois16(uint16_t lfsr) {
  return (lfsr >> 1) ^ (-(lfsr & 1u) & 0xB400u);
}


x86 assembly (clang, -O0):
<galois16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
and    $0xb400,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<galois16>:
mov    %edi,%eax
sar    %eax
and    $0x1,%edi
neg    %edi
and    $0xb400,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @galois16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = and i32 %5, 1
%7 = sub i32 0, %6
%8 = and i32 %7, 46080
%9 = xor i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @galois16(i32 %0) {
%2 = ashr i32 %0, 1
%3 = and i32 %0, 1
%4 = sub nsw i32 0, %3
%5 = and i32 %4, 46080
%6 = xor i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, char *);
void main_func(void *s) {
  printf("Main thread continuation: %s\n", (char *)s);
  free(s);
}


x86 assembly (clang, -O0):
<main_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_func>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Main thread continuation: %s\0A\00"
define void @main_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Main thread continuation: %s\0A\00"
define void @main_func(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
int hash_command(const char *cmd) {
  int hash = 0;
  if (!cmd)
    return 0;
  while (*cmd) {
    hash = (hash << 1) ^ *cmd;
    cmd++;
  };
  return hash;
}


x86 assembly (clang, -O0):
<hash_command>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <hash_command+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1161 <hash_command+0x61>
jmp    112b <hash_command+0x2b>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <hash_command+0x5b>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <hash_command+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_command>:
xor    %eax,%eax
test   %rdi,%rdi
je     1132 <hash_command+0x32>
mov    (%rdi),%cl
test   %cl,%cl
je     1132 <hash_command+0x32>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %eax,%eax
movsbl %cl,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <hash_command+0x20>
ret

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

LLVM IR (-O2):
define i32 @hash_command(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %14, %6 ], [ %4, %3 ]
%8 = phi i32 [ %12, %6 ], [ 0, %3 ]
%9 = phi i8* [ %13, %6 ], [ %0, %3 ]
%10 = shl i32 %8, 1
%11 = sext i8 %7 to i32
%12 = xor i32 %10, %11
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %3, %1
%17 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %12, %6 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *gettext(char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr,
                gettext("usage: column [-tx] [-c columns] [file ...]\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <gettext@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
lea    0xebf(%rip),%rdi
call   1030 <gettext@plt>
mov    %ebx,%edi
mov    %rax,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"usage: column [-tx] [-c columns] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* @gettext(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @fprintf(i32 %1, i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"usage: column [-tx] [-c columns] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* @gettext(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32 %1, i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int getcl(int idx) { return ((idx / 13) * 40); }


x86 assembly (clang, -O0):
<getcl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
imul   $0x28,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcl>:
movslq %edi,%rax
imul   $0x4ec4ec4f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x22,%rax
add    %ecx,%eax
shl    $0x3,%eax
lea    (%rax,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getcl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 13
%5 = mul nsw i32 %4, 40
ret i32 %5
}

LLVM IR (-O2):
define i32 @getcl(i32 %0) {
%2 = sdiv i32 %0, 13
%3 = mul nsw i32 %2, 40
ret i32 %3
}
long long int
longlongint_ignoring_unsignedlonglongint(long long int x,
                                         unsigned long long int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @longlongint_ignoring_unsignedlonglongint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlongint_ignoring_unsignedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
int exact_square(int num) {
  int counter, check = 0;
  for (counter = 1; counter <= num; counter++) {
    if (counter * counter == num) {
      check = 1;
      break;
    }
  }
  if (check)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1150 <exact_square+0x50>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113d <exact_square+0x3d>
movl   $0x1,-0x10(%rbp)
jmp    1150 <exact_square+0x50>
jmp    1142 <exact_square+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <exact_square+0x15>
cmpl   $0x0,-0x10(%rbp)
je     1166 <exact_square+0x66>
movl   $0x1,-0x4(%rbp)
jmp    116d <exact_square+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%ecx
cmp    %edi,%eax
jg     1122 <exact_square+0x22>
mov    %ecx,%edx
imul   %ecx,%edx
lea    0x1(%rcx),%eax
cmp    %edi,%edx
jne    1110 <exact_square+0x10>
xor    %eax,%eax
cmp    %edi,%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %8, %2 ]
%4 = icmp sgt i32 %3, %0
%5 = mul nsw i32 %3, %3
%6 = icmp eq i32 %5, %0
%7 = select i1 %4, i1 true, i1 %6
%8 = add nuw nsw i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = xor i1 %4, true
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ test0(int, int);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2(int /*<<< orphan*/ *);
void entrypoint() {
  test0(1, 2);
  test1();
  uint64_t buf[20];
  memset(buf, 1, sizeof(buf));
  test2(buf);
}


x86 assembly (clang, -O0):
<entrypoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <test0@plt>
mov    $0x0,%al
call   1030 <test1@plt>
lea    -0x50(%rbp),%rdi
mov    $0x1,%esi
mov    $0x50,%edx
call   1040 <memset@plt>
lea    -0x50(%rbp),%rdi
call   1060 <test2@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entrypoint>:
push   %rbx
sub    $0x50,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <test0@plt>
xor    %eax,%eax
call   1030 <test1@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x50,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1060 <test2@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @entrypoint() {
%1 = alloca [20 x i32]
%2 = call i32 @test0(i32 1, i32 2)
%3 = call i32 (...) @test1()
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%5 = call i32 @memset(i32* %4, i32 1, i32 80)
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%7 = call i32 @test2(i32* %6)
ret void
}

LLVM IR (-O2):
define void @entrypoint() {
%1 = alloca [20 x i32]
%2 = tail call i32 @test0(i32 1, i32 2)
%3 = tail call i32 (...) @test1()
%4 = bitcast [20 x i32]* %1 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%6 = call i32 @memset(i32* %5, i32 1, i32 80)
%7 = call i32 @test2(i32* %5)
ret void
}
void smsdvb_debugfs_release(struct smsdvb_client_t *client) {}


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

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

LLVM IR (-O0):
%struct.smsdvb_client_t = type opaque
define void @smsdvb_debugfs_release(%struct.smsdvb_client_t* %0) {
%2 = alloca %struct.smsdvb_client_t*
store %struct.smsdvb_client_t* %0, %struct.smsdvb_client_t** %2
ret void
}

LLVM IR (-O2):
%struct.smsdvb_client_t = type opaque
define void @smsdvb_debugfs_release(%struct.smsdvb_client_t* nocapture %0) {
ret void
}
void nxtd_bt_close(struct nxtd_nxt_bt *nxt) {}


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

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

LLVM IR (-O0):
%struct.nxtd_nxt_bt = type opaque
define void @nxtd_bt_close(%struct.nxtd_nxt_bt* %0) {
%2 = alloca %struct.nxtd_nxt_bt*
store %struct.nxtd_nxt_bt* %0, %struct.nxtd_nxt_bt** %2
ret void
}

LLVM IR (-O2):
%struct.nxtd_nxt_bt = type opaque
define void @nxtd_bt_close(%struct.nxtd_nxt_bt* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) void BME_BFI_W(volatile uint32_t *addr,
                                        register uint32_t wdata, uint8_t bit,
                                        uint8_t width) {
  *(volatile uint32_t *)((uint32_t)addr | (1 << 28) | (bit << 23) |
                         ((width - 1) << 19)) = wdata;
}


x86 assembly (clang, -O0):
<BME_BFI_W>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
or     $0x10000000,%eax
mov    -0x10(%rbp),%edx
shl    $0x17,%edx
or     %edx,%eax
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
shl    $0x13,%edx
or     %edx,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BME_BFI_W>:
shl    $0x17,%edx
shl    $0x13,%ecx
add    $0xfff80000,%ecx
or     %edi,%edx
or     %ecx,%edx
movslq %edx,%rax
or     $0x10000000,%rax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
define void @BME_BFI_W(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32*, i32** %5
%11 = ptrtoint i32* %10 to i32
%12 = or i32 %11, 268435456
%13 = load i32, i32* %7
%14 = shl i32 %13, 23
%15 = or i32 %12, %14
%16 = load i32, i32* %8
%17 = sub nsw i32 %16, 1
%18 = shl i32 %17, 19
%19 = or i32 %15, %18
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store volatile i32 %9, i32* %21
ret void
}

LLVM IR (-O2):
define void @BME_BFI_W(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = ptrtoint i32* %0 to i64
%6 = trunc i64 %5 to i32
%7 = shl i32 %2, 23
%8 = shl i32 %3, 19
%9 = add i32 %8, -524288
%10 = or i32 %7, %6
%11 = or i32 %10, %9
%12 = or i32 %11, 268435456
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %1, i32* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitanoperand(int, char *, int);
int /*<<< orphan*/ printf(char *);
void emitoneoperandb(void) {
  printf(" ");
  emitanoperand(1, "ds:byte ptr", 1);
}


x86 assembly (clang, -O0):
<emitoneoperandb>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edx
lea    0xec6(%rip),%rsi
mov    %edx,%edi
call   1040 <emitanoperand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emitoneoperandb>:
push   %rax
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rax
jmp    1040 <emitanoperand@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [12 x i8] c"ds:byte ptr\00"
define void @emitoneoperandb() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitanoperand(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"ds:byte ptr\00"
define void @emitoneoperandb() {
%1 = tail call i32 @putchar(i32 32)
%2 = tail call i32 @emitanoperand(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
int _isatty(int file) {
  (void)file;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @_isatty(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_file_error(char *file) {
  printf("\x1B[31m"
         "file <%s> not found\n"
         "\x1B[0m",
         file);
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"\1B[31mfile <%s> not found\0A\1B[0m\00"
define void @print_file_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"\1B[31mfile <%s> not found\0A\1B[0m\00"
define void @print_file_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int syscall6(int n, int a0, int a1, int a2, int a3, int a4, int a5) {
  int ret;
  asm volatile("mov %5, %%r10\n"
               "mov %6, %%r8\n"
               "mov %7, %%r9\n"
               "syscall"
               : "=a"(ret)
               : "a"(n), "D"(a0), "S"(a1), "d"(a2), "g"(a3), "g"(a4), "g"(a5));
  return ret;
}


x86 assembly (clang, -O0):
<syscall6>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%r8d
mov    0x10(%rbp),%ecx
mov    %r9d,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %ecx,-0x28(%rbp)
mov    -0x20(%rbp),%r10
mov    -0x24(%rbp),%r8
mov    -0x28(%rbp),%r9
syscall
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @syscall6(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load i32, i32* %13
%22 = load i32, i32* %14
%23 = call i32 asm sideeffect "mov $5, %r10\0Amov $6, %r8\0Amov $7, %r9\0Asyscall", "={ax},{ax},{di},{si},{dx},imr,imr,imr,~{dirflag},~{fpsr},~{flags}"(i32 %16, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22)
store i32 %23, i32* %15
%24 = load i32, i32* %15
ret i32 %24
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ show_user(char *);
int main(int argc, char **argv) {
  if (argv[1])
    show_user(argv[1]);
  else
    show_user("/dev/tty1");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1157 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <show_user@plt>
jmp    1163 <main+0x43>
lea    0xea2(%rip),%rdi
call   1040 <show_user@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
jne    1131 <main+0x11>
lea    0xecf(%rip),%rdi
call   1040 <show_user@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/tty1\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @show_user(i8* %13)
br label %17
15: ; preds = %2
%16 = call i32 @show_user(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %10
%18 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/tty1\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @show_user(i8* %4)
br label %10
8: ; preds = %2
%9 = tail call i32 @show_user(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = tail call i32 @exit(i32 0)
unreachable
}