xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ end_of_time();
int /*<<< orphan*/ puts(char *);
void ship_destroyed(void) {
  puts("The Enterprise has been destroyed. "
       "The Federation will be conquered.\n");
  end_of_time();
}


x86 assembly (clang, -O0):
<ship_destroyed>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <end_of_time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ship_destroyed>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <end_of_time@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"The Enterprise has been destroyed. The Federation will be conquered.\0A\00"
define void @ship_destroyed() {
%1 = call i32 @puts(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @end_of_time()
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"The Enterprise has been destroyed. The Federation will be conquered.\0A\00"
define void @ship_destroyed() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @end_of_time()
ret void
}
char *logger_file_name(void) { return "file"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"file\00"
define i8* @logger_file_name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"file\00"
define i8* @logger_file_name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
int main(void) {
  int *i = (int *)0xfffffff0;
  return *i;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0xfffffff0,%eax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = load i32, i32* inttoptr (i64 4294967280 to i32*)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int ft_putchar(char c) { write(1, &c, 1); }


x86 assembly (clang, -O0):
<ft_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ft_putchar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32 @write(i32 1, i8* %3, i32 1)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @ft_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 undef
}
void mymodule_(void) {}


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

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

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

LLVM IR (-O2):
define void @mymodule_() {
ret void
}
const char *f_engine_year() { return "2008-2013"; }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"2008-2013\00"
define i8* @f_engine_year() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"2008-2013\00"
define i8* @f_engine_year() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char *);
int main(int argc, char **argv) {
  ft_putstr(argv[argc * 0]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x0,-0x8(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <ft_putstr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 0
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %6, i64 %9
%11 = load i8*, i8** %10
%12 = call i32 @ft_putstr(i8* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @ft_putstr(i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int get_plugin_info(int opcode, char *buf, int buflen) {
  switch (opcode) {
  case 0:
    strncpy(buf, "A/D-in plugin for Julius", buflen);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_plugin_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    1145 <get_plugin_info+0x35>
jmp    1132 <get_plugin_info+0x22>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xec0(%rip),%rsi
call   1030 <strncpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_plugin_info>:
test   %edi,%edi
je     1117 <get_plugin_info+0x7>
xor    %eax,%eax
ret
push   %rax
lea    0xee1(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strncpy@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"A/D-in plugin for Julius\00"
define i32 @get_plugin_info(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %12 [
i32 0, label %8
]
8: ; preds = %3
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %3, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"A/D-in plugin for Julius\00"
define i32 @get_plugin_info(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %3, %5
ret i32 0
}
void lsmIoerrBkpt() {
  static int nErr = 0;
  nErr++;
}


x86 assembly (clang, -O0):
<lsmIoerrBkpt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsmIoerrBkpt>:
addl   $0x1,0x2f1d(%rip)
ret

LLVM IR (-O0):
@lsmIoerrBkpt.nErr = internal global i32 0
define void @lsmIoerrBkpt() {
%1 = load i32, i32* @lsmIoerrBkpt.nErr
%2 = add nsw i32 %1, 1
store i32 %2, i32* @lsmIoerrBkpt.nErr
ret void
}

LLVM IR (-O2):
@lsmIoerrBkpt.nErr = internal unnamed_addr global i32 0
define void @lsmIoerrBkpt() {
%1 = load i32, i32* @lsmIoerrBkpt.nErr
%2 = add nsw i32 %1, 1
store i32 %2, i32* @lsmIoerrBkpt.nErr
ret void
}
__attribute__((always_)) int module_kallsyms_on_each_symbol(
    int (*fn)(void *, const char *, struct module *, unsigned long),
    void *data) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.module = type opaque
define i32 @module_kallsyms_on_each_symbol(i32 (i8*, i8*, %struct.module*, i64)* %0, i8* %1) {
%3 = alloca i32 (i8*, i8*, %struct.module*, i64)*
%4 = alloca i8*
store i32 (i8*, i8*, %struct.module*, i64)* %0, i32 (i8*, i8*, %struct.module*, i64)** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.module = type opaque
define i32 @module_kallsyms_on_each_symbol(i32 (i8*, i8*, %struct.module*, i64)* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int val(char *sym, char c) {
  int i;
  for (i = 0; sym[i] != '\0'; i++)
    if (c == sym[i])
      return i;
  return 0;
}


x86 assembly (clang, -O0):
<val>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <val+0x60>
movsbl -0x11(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114d <val+0x4d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <val+0x67>
jmp    1152 <val+0x52>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <val+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1124 <val+0x24>
nopl   0x0(%rax,%rax,1)
cmp    %sil,%cl
je     1124 <val+0x24>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <val+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @val(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = phi i8 [ %12, %9 ], [ %3, %2 ]
%8 = icmp eq i8 %7, %1
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %16, label %5
14: ; preds = %5
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %9, %14, %2
%17 = phi i32 [ 0, %2 ], [ %15, %14 ], [ 0, %9 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char const *, int /*<<< orphan*/);
unsigned int file_exist(const char *path) { return access(path, F_OK) != -1; }


x86 assembly (clang, -O0):
<file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exist>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @file_exist(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @file_exist(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void foo4(void) { exit(0); }


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @foo4() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @foo4() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *strclone(const char *p_old) {
  size_t length = strlen(p_old);
  char *p_str = (char *)malloc(length + 1);
  memcpy(p_str, p_old, length);
  p_str[length] = '\0';
  return p_str;
}


x86 assembly (clang, -O0):
<strclone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strclone>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strclone(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
%16 = load i64, i64* %3
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
define i8* @strclone(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %2)
%7 = getelementptr inbounds i8, i8* %5, i64 %2
store i8 0, i8* %7
ret i8* %5
}
int tmult_ok(int x, int y) {
  int p = x * y;
  return !x || p / x == y;
}


x86 assembly (clang, -O0):
<tmult_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
je     1133 <tmult_ok+0x33>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x4(%rbp)
cmp    -0x8(%rbp),%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tmult_ok(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* %4
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = sdiv i32 %12, %13
%15 = load i32, i32* %4
%16 = icmp eq i32 %14, %15
br label %17
17: ; preds = %11, %2
%18 = phi i1 [ true, %2 ], [ %16, %11 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @tmult_ok(i32 %0, i32 %1) {
ret i32 1
}
void gtk_window_set_keep_below() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_keep_below() {
ret void
}
int i_cmp(const void *a, const void *b) { return (*(int *)a) - (*(int *)b); }


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

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

LLVM IR (-O0):
define i32 @i_cmp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @i_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void RTMemDupExTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemDupExTag() {
ret void
}
void g_signal_handler_find() {}


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

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

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

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

/* Variables and functions */
unsigned char *whirlpool_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_whirlpool(unsigned char *out, FILE *fp) {
  return whirlpool_file(out, fp);
}


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

x86 assembly (clang, -O2):
<hash_file_whirlpool>:
jmp    1030 <whirlpool_file@plt>

LLVM IR (-O0):
define i8* @hash_file_whirlpool(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 i8* @whirlpool_file(i8* %5, i32* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @hash_file_whirlpool(i8* %0, i32* %1) {
%3 = tail call i8* @whirlpool_file(i8* %0, i32* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ NewColormap(int);
void change_cmap_com(int i) { NewColormap(i); }


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

x86 assembly (clang, -O2):
<change_cmap_com>:
jmp    1030 <NewColormap@plt>

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

LLVM IR (-O2):
define void @change_cmap_com(i32 %0) {
%2 = tail call i32 @NewColormap(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
int /*<<< orphan*/ stderr;
void Fatal(char *pchMsg, unsigned u) {
  fprintf(stderr, pchMsg, u);
  exit(1);
}


x86 assembly (clang, -O0):
<Fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Fatal>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
define void @Fatal(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* %0, i32 %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
double copysign(double x, double y) { return __builtin_copysign(x, y); }


x86 assembly (clang, -O0):
<copysign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysign>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @copysign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.copysign.f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @copysign(double %0, double %1) {
%3 = tail call double @llvm.copysign.f64(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_parenthesized_op(void) {
  test("25", "main(){int i=2; int j=(i+3)*5; printf(\"%d\", j);}");
}


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

x86 assembly (clang, -O2):
<TEST_parenthesized_op>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"25\00"
@.str.1 = [49 x i8] c"main(){int i=2; int j=(i+3)*5; printf(\22%d\22, j);}\00"
define void @TEST_parenthesized_op() {
%1 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"25\00"
@.str.1 = [49 x i8] c"main(){int i=2; int j=(i+3)*5; printf(\22%d\22, j);}\00"
define void @TEST_parenthesized_op() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dump_addr(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ fun2(int /*<<< orphan*/ *);
void fun1(FILE *p) {
  int f1;
  dump_addr(p, "&f1", &f1);
  fun2(p);
}


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

x86 assembly (clang, -O2):
<fun1>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xed1(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1040 <dump_addr@plt>
mov    %rbx,%rdi
call   1030 <fun2@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"&f1\00"
define void @fun1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @dump_addr(i32* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32*, i32** %2
%7 = call i32 @fun2(i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"&f1\00"
define void @fun1(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @dump_addr(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = call i32 @fun2(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_putchar(char);
void uart_puthexchar(unsigned char c) {
  char n[] = {'0', '1', '2', '3', '4', '5', '6', '7',
              '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
  uart_putchar(n[c >> 4]);
  uart_putchar(n[c & 15]);
}


x86 assembly (clang, -O0):
<uart_puthexchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x18(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
cltq
movsbl -0x20(%rbp,%rax,1),%edi
call   1030 <uart_putchar@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
cltq
movsbl -0x20(%rbp,%rax,1),%edi
call   1030 <uart_putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_puthexchar>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rbx,%rax
shr    $0x4,%rax
lea    0xedc(%rip),%r14
movsbl (%rax,%r14,1),%edi
call   1030 <uart_putchar@plt>
and    $0xf,%ebx
movsbl (%rbx,%r14,1),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <uart_putchar@plt>

LLVM IR (-O0):
@__const.uart_puthexchar.n = [16 x i8] c"0123456789abcdef"
define void @uart_puthexchar(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca [16 x i8]
store i8 %0, i8* %2
%4 = bitcast [16 x i8]* %3 to i8*
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = ashr i32 %6, 4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = call i32 @uart_putchar(i8 signext %10)
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = and i32 %13, 15
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @uart_putchar(i8 signext %17)
ret void
}

LLVM IR (-O2):
@__const.uart_puthexchar.n = [16 x i8] c"0123456789abcdef"
define void @uart_puthexchar(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = lshr i32 %2, 4
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [16 x i8], [16 x i8]* @__const.uart_puthexchar.n, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @uart_putchar(i8 signext %6)
%8 = and i32 %2, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [16 x i8], [16 x i8]* @__const.uart_puthexchar.n, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @uart_putchar(i8 signext %11)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t aout_segbase(int32_t segment) { return segment; }


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

x86 assembly (clang, -O2):
<aout_segbase>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @aout_segbase(i32 returned %0) {
ret i32 %0
}
int f11(int x, int y) {
  if (x >= -0x7fffffff)
    return x % -y;
  return 34;
}


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x80000001,-0x8(%rbp)
jl     112a <f11+0x2a>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    1131 <f11+0x31>
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f11>:
mov    $0x22,%eax
cmp    $0x80000000,%edi
je     1116 <f11+0x16>
neg    %esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f11(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 = icmp sge i32 %6, -2147483647
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = sub nsw i32 0, %10
%12 = srem i32 %9, %11
store i32 %12, i32* %3
br label %14
13: ; preds = %2
store i32 34, i32* %3
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @f11(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, -2147483648
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sub nsw i32 0, %1
%6 = srem i32 %0, %5
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 34, %2 ]
ret i32 %8
}
const char *fieldEnd(const char *s, int sep) {
  int c;
  while ((c = *s) && c != sep)
    s++;
  return s;
}


x86 assembly (clang, -O0):
<fieldEnd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     112f <fieldEnd+0x2f>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113f <fieldEnd+0x3f>
jmp    1150 <fieldEnd+0x50>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <fieldEnd+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fieldEnd>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <fieldEnd+0x20>
cmp    %esi,%ecx
jne    1110 <fieldEnd+0x10>
ret

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

LLVM IR (-O2):
define i8* @fieldEnd(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i8 %5, 0
%8 = icmp ne i32 %6, %1
%9 = and i1 %7, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %3, label %11
11: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ EDFUnpackString(char const *, int);
int atoi(int /*<<< orphan*/);
int EDFUnpackInt(const char *inp, int fieldLen) {
  return atoi(EDFUnpackString(inp, fieldLen));
}


x86 assembly (clang, -O0):
<EDFUnpackInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <EDFUnpackString@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EDFUnpackInt>:
push   %rax
call   1030 <EDFUnpackString@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <atoi@plt>

LLVM IR (-O0):
define i32 @EDFUnpackInt(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 @EDFUnpackString(i8* %5, i32 %6)
%8 = call i32 @atoi(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @EDFUnpackInt(i8* %0, i32 %1) {
%3 = tail call i32 @EDFUnpackString(i8* %0, i32 %1)
%4 = tail call i32 @atoi(i32 %3)
ret i32 %4
}
void pixel_invert_linear(float *p0, float *p1) {
  int ic;
  for (ic = 0; ic < 3; ic++)
    p1[ic] = 1. - p0[ic];
  p1[3] = p0[3];
}


x86 assembly (clang, -O0):
<pixel_invert_linear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1159 <pixel_invert_linear+0x59>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <pixel_invert_linear+0x13>
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_invert_linear>:
movss  0xef8(%rip),%xmm0
movaps %xmm0,%xmm1
subss  (%rdi),%xmm1
movss  %xmm1,(%rsi)
movaps %xmm0,%xmm1
subss  0x4(%rdi),%xmm1
movss  %xmm1,0x4(%rsi)
subss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rsi)
movss  0xc(%rdi),%xmm0
movss  %xmm0,0xc(%rsi)
ret

LLVM IR (-O0):
define void @pixel_invert_linear(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i32
store float* %0, float** %3
store float* %1, float** %4
store i32 0, i32* %5
br label %6
6: ; preds = %22, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %25
9: ; preds = %6
%10 = load float*, float** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds float, float* %10, i64 %12
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = fsub double 1.000000e+00, %15
%17 = fptrunc double %16 to float
%18 = load float*, float** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %18, i64 %20
store float %17, float* %21
br label %22
22: ; preds = %9
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %6
25: ; preds = %6
%26 = load float*, float** %3
%27 = getelementptr inbounds float, float* %26, i64 3
%28 = load float, float* %27
%29 = load float*, float** %4
%30 = getelementptr inbounds float, float* %29, i64 3
store float %28, float* %30
ret void
}

LLVM IR (-O2):
define void @pixel_invert_linear(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = fsub float 1.000000e+00, %3
store float %4, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fsub float 1.000000e+00, %6
%8 = getelementptr inbounds float, float* %1, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %0, i64 2
%10 = load float, float* %9
%11 = fsub float 1.000000e+00, %10
%12 = getelementptr inbounds float, float* %1, i64 2
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 3
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 3
store float %14, float* %15
ret void
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
int load_s8(char const *, int, scalar_t__);
scalar_t__ load_u8(char const *, int, int);
int16_t load_u1f15(const char *icc, int length, int offset) {
  return load_u8(icc, length, offset + 1) +
         (load_s8(icc, length, offset + 0) << 8);
}


x86 assembly (clang, -O0):
<load_u1f15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
call   1030 <load_u8@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
add    $0x0,%eax
movslq %eax,%rdx
call   1040 <load_s8@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
shl    $0x8,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_u1f15>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
lea    0x1(%rbx),%edx
call   1030 <load_u8@plt>
mov    %rax,%r15
movslq %ebx,%rdx
mov    %rbp,%rdi
mov    %r14d,%esi
call   1040 <load_s8@plt>
shl    $0x8,%eax
cltq
add    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @load_u1f15(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
%11 = call i64 @load_u8(i8* %7, i32 %8, i32 %10)
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 0
%16 = sext i32 %15 to i64
%17 = call i32 @load_s8(i8* %12, i32 %13, i64 %16)
%18 = shl i32 %17, 8
%19 = sext i32 %18 to i64
%20 = add nsw i64 %11, %19
ret i64 %20
}

LLVM IR (-O2):
define i64 @load_u1f15(i8* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i64 @load_u8(i8* %0, i32 %1, i32 %4)
%6 = sext i32 %2 to i64
%7 = tail call i32 @load_s8(i8* %0, i32 %1, i64 %6)
%8 = shl i32 %7, 8
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
ret i64 %10
}
/* Variables and functions */
int vip_chip_id_read();
int test(void) { return vip_chip_id_read(); }


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

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

LLVM IR (-O0):
define i32 @test() {
%1 = call i32 (...) @vip_chip_id_read()
ret i32 %1
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 (...) @vip_chip_id_read()
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
double Scale(scalar_t__, double);
double Percent(uint16_t a, uint16_t b) { return Scale(a, 100.0) / ((double)b); }


x86 assembly (clang, -O0):
<Percent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xed4(%rip),%xmm0
call   1030 <Scale@plt>
cvtsi2sdq -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Percent>:
push   %rbx
mov    %rsi,%rbx
movsd  0xee4(%rip),%xmm0
call   1030 <Scale@plt>
cvtsi2sd %rbx,%xmm1
divsd  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @Percent(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call double @Scale(i64 %5, double 1.000000e+02)
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to double
%9 = fdiv double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @Percent(i64 %0, i64 %1) {
%3 = tail call double @Scale(i64 %0, double 1.000000e+02)
%4 = sitofp i64 %1 to double
%5 = fdiv double %3, %4
ret double %5
}
void nstrcpy(char *dst, const char *src) {
  while ((*dst++ = *src++))
    ;
}


x86 assembly (clang, -O0):
<nstrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <nstrcpy+0x3b>
jmp    110c <nstrcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nstrcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <nstrcpy+0x10>
ret

LLVM IR (-O0):
define void @nstrcpy(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 = %12, %2
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %4
%8 = load i8, i8* %6
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 %8, i8* %9
%11 = icmp ne i8 %8, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @nstrcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: addpattern [-i trxfile] [-o binfile] [-p pattern] "
                  "[-g] [-b] [-v v#.#.#] [-r #.#] [-{0|1|2|4}] -h\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [105 x i8] c"Usage: addpattern [-i trxfile] [-o binfile] [-p pattern] [-g] [-b] [-v v#.#.#] [-r #.#] [-{0|1|2|4}] -h\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [105 x i8] c"Usage: addpattern [-i trxfile] [-o binfile] [-p pattern] [-g] [-b] [-v v#.#.#] [-r #.#] [-{0|1|2|4}] -h\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
unsigned int byteSwap32(unsigned int);
int /*<<< orphan*/ memcpy(unsigned int *, char *, int);
unsigned memReadBits32(char **pPt, int isSwapped) {
  unsigned val;
  memcpy(&val, *pPt, sizeof(val));
  if (isSwapped)
    val = byteSwap32(val);
  *pPt += sizeof(val);
  return val;
}


x86 assembly (clang, -O0):
<memReadBits32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
cmpl   $0x0,-0xc(%rbp)
je     1159 <memReadBits32+0x39>
mov    -0x10(%rbp),%edi
call   1030 <byteSwap32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memReadBits32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0x4(%rsp),%eax
test   %ebp,%ebp
je     1149 <memReadBits32+0x29>
mov    %eax,%edi
call   1030 <byteSwap32@plt>
addq   $0x4,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @memReadBits32(i8** nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i8*, i8** %0
%6 = call i32 @memcpy(i32* %3, i8* %5, i32 4)
%7 = icmp eq i32 %1, 0
%8 = load i32, i32* %3
br i1 %7, label %11, label %9
9: ; preds = %2
%10 = call i32 @byteSwap32(i32 %8)
br label %11
11: ; preds = %2, %9
%12 = phi i32 [ %10, %9 ], [ %8, %2 ]
%13 = load i8*, i8** %0
%14 = getelementptr inbounds i8, i8* %13, i64 4
store i8* %14, i8** %0
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ dologout(int /*<<< orphan*/);
int /*<<< orphan*/ reply(int, char *, ...);
void fatal(const char *s) {
  reply(451, "Error in server: %s\n", s);
  reply(221, "Closing connection due to server error.");
  dologout(0);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1c3,%edi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1040 <reply@plt>
mov    $0xdd,%edi
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1040 <reply@plt>
xor    %edi,%edi
call   1030 <dologout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rdx
lea    0xed5(%rip),%rsi
mov    $0x1c3,%edi
xor    %eax,%eax
call   1040 <reply@plt>
lea    0xed7(%rip),%rsi
mov    $0xdd,%edi
xor    %eax,%eax
call   1040 <reply@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <dologout@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Error in server: %s\0A\00"
@.str.1 = [40 x i8] c"Closing connection due to server error.\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i32, i8*, ...) @reply(i32 451, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i32, i8*, ...) @reply(i32 221, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @dologout(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Error in server: %s\0A\00"
@.str.1 = [40 x i8] c"Closing connection due to server error.\00"
define void @fatal(i8* %0) {
%2 = tail call i32 (i32, i8*, ...) @reply(i32 451, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i32, i8*, ...) @reply(i32 221, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @dologout(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void test_sorting(int arr[], int size) {
  int i;
  for (i = 1; i < size; i++) {
    assert(arr[i - 1] < arr[i]);
  }
}


x86 assembly (clang, -O0):
<test_sorting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1168 <test_sorting+0x58>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <test_sorting+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sorting>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     114d <test_sorting+0x3d>
mov    %rdi,%r15
mov    %esi,%r14d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    -0x4(%r15,%rbx,4),%eax
xor    %edi,%edi
cmp    (%r15,%rbx,4),%eax
setl   %dil
call   1030 <assert@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <test_sorting+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @test_sorting(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %25, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %28
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = icmp slt i32 %16, %21
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
br label %25
25: ; preds = %10
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @test_sorting(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %16, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %0, i64 %7
%12 = load i32, i32* %11
%13 = icmp slt i32 %10, %12
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = add nuw nsw i64 %7, 1
%17 = icmp eq i64 %16, %5
br i1 %17, label %18, label %6
18: ; preds = %6, %2
ret void
}