xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ initArray();
int /*<<< orphan*/ printArray();
int main(int argc, char const *argv[]) {
  initArray();
  printArray();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initArray()
%4 = tail call i32 (...) @printArray()
ret i32 0
}
/* Variables and functions */
intptr_t syscall(int);
intptr_t mm_syscall_0(int n) { return syscall(n); }


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

x86 assembly (clang, -O2):
<mm_syscall_0>:
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i64 @mm_syscall_0(i32 %0) {
%2 = tail call i64 @syscall(i32 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ outstr(char *);
col() { outstr(":\n"); }


x86 assembly (clang, -O0):
<col>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <outstr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c":\0A\00"
define i32 @col() {
%1 = alloca i32
%2 = call i32 @outstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [3 x i8] c":\0A\00"
define i32 @col() {
%1 = tail call i32 @outstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void gtk_file_chooser_add_shortcut_folder() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_add_shortcut_folder() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t getDatacenterId(int datacenter_id) {
  return (uint64_t)datacenter_id % (2 << (24));
}


x86 assembly (clang, -O0):
<getDatacenterId>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2000000,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDatacenterId>:
mov    %edi,%eax
lea    0x1ffffff(%rax),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0xfe000000,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getDatacenterId(i32 %0) {
%2 = srem i32 %0, 33554432
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ cond_incl();
int /*<<< orphan*/ const_expr();
int /*<<< orphan*/ defined();
int /*<<< orphan*/ empty();
int /*<<< orphan*/ funclike();
int /*<<< orphan*/ ifdef();
int /*<<< orphan*/ loop();
int /*<<< orphan*/ noarg();
int /*<<< orphan*/ null();
int /*<<< orphan*/ simple();
int /*<<< orphan*/ undef();
int main() {
  simple();
  loop();
  undef();
  cond_incl();
  const_expr();
  defined();
  ifdef();
  funclike();
  empty();
  noarg();
  null();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <simple@plt>
mov    $0x0,%al
call   1050 <loop@plt>
mov    $0x0,%al
call   1060 <undef@plt>
mov    $0x0,%al
call   1040 <cond_incl@plt>
mov    $0x0,%al
call   1070 <const_expr@plt>
mov    $0x0,%al
call   10d0 <defined@plt>
mov    $0x0,%al
call   10c0 <ifdef@plt>
mov    $0x0,%al
call   10b0 <funclike@plt>
mov    $0x0,%al
call   1080 <empty@plt>
mov    $0x0,%al
call   1030 <noarg@plt>
mov    $0x0,%al
call   10a0 <null@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <simple@plt>
xor    %eax,%eax
call   1050 <loop@plt>
xor    %eax,%eax
call   1060 <undef@plt>
xor    %eax,%eax
call   1040 <cond_incl@plt>
xor    %eax,%eax
call   1070 <const_expr@plt>
xor    %eax,%eax
call   10d0 <defined@plt>
xor    %eax,%eax
call   10c0 <ifdef@plt>
xor    %eax,%eax
call   10b0 <funclike@plt>
xor    %eax,%eax
call   1080 <empty@plt>
xor    %eax,%eax
call   1030 <noarg@plt>
xor    %eax,%eax
call   10a0 <null@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @simple()
%3 = call i32 (...) @loop()
%4 = call i32 (...) @undef()
%5 = call i32 (...) @cond_incl()
%6 = call i32 (...) @const_expr()
%7 = call i32 (...) @defined()
%8 = call i32 (...) @ifdef()
%9 = call i32 (...) @funclike()
%10 = call i32 (...) @empty()
%11 = call i32 (...) @noarg()
%12 = call i32 (...) @null()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @simple()
%2 = tail call i32 (...) @loop()
%3 = tail call i32 (...) @undef()
%4 = tail call i32 (...) @cond_incl()
%5 = tail call i32 (...) @const_expr()
%6 = tail call i32 (...) @defined()
%7 = tail call i32 (...) @ifdef()
%8 = tail call i32 (...) @funclike()
%9 = tail call i32 (...) @empty()
%10 = tail call i32 (...) @noarg()
%11 = tail call i32 (...) @null()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/ *);
int CPAtEndOfFile(FILE *fileRef) {
  if (feof(fileRef))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<CPAtEndOfFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <feof@plt>
cmp    $0x0,%rax
je     113b <CPAtEndOfFile+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <CPAtEndOfFile+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPAtEndOfFile>:
push   %rax
call   1030 <feof@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @CPAtEndOfFile(i32* nocapture %0) {
%2 = tail call i64 @feof(i32* %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int HelpItem68(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem68() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem68() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(short const, short const, int /*<<< orphan*/,
                                 int);
void glWindowPos2sv(const short v[2]) { glWindowPos4f(v[0], v[1], 0, 1); }


x86 assembly (clang, -O0):
<glWindowPos2sv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%si
mov    -0x8(%rbp),%rax
xor    %edx,%edx
mov    $0x1,%ecx
movswl %si,%edi
movswl 0x2(%rax),%esi
call   1030 <glWindowPos4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos2sv>:
movswl (%rdi),%eax
movswl 0x2(%rdi),%esi
mov    %eax,%edi
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos2sv(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = getelementptr inbounds i16, i16* %3, i64 0
%5 = load i16, i16* %4
%6 = load i16*, i16** %2
%7 = getelementptr inbounds i16, i16* %6, i64 1
%8 = load i16, i16* %7
%9 = call i32 @glWindowPos4f(i16 signext %5, i16 signext %8, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @glWindowPos2sv(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %3
%5 = tail call i32 @glWindowPos4f(i16 signext %2, i16 signext %4, i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_close(int /*<<< orphan*/);
void PIC16F1939_stop(void) {
  serial_close(0);
  ;
}


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

x86 assembly (clang, -O2):
<PIC16F1939_stop>:
xor    %edi,%edi
jmp    1030 <serial_close@plt>

LLVM IR (-O0):
define void @PIC16F1939_stop() {
%1 = call i32 @serial_close(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC16F1939_stop() {
%1 = tail call i32 @serial_close(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void idt_int7(void) { print("!! Coprocessor not available "); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"!! Coprocessor not available \00"
define void @idt_int7() {
%1 = call i32 @print(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"!! Coprocessor not available \00"
define void @idt_int7() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_NonAssignableExpressionUsedForOutContext(long p_position) {
  _Error(p_position, "Non-container expression used for out context");
}


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

x86 assembly (clang, -O2):
<Error_NonAssignableExpressionUsedForOutContext>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Non-container expression used for out context\00"
define void @Error_NonAssignableExpressionUsedForOutContext(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Non-container expression used for out context\00"
define void @Error_NonAssignableExpressionUsedForOutContext(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(long *);
scalar_t__ malloc(int);
int read(int, long *, int);
int /*<<< orphan*/ syserr(char *, int);
long readLong(int readDescriptor) {
  long *value = (long *)malloc(sizeof(long));
  if (read(readDescriptor, value, sizeof(long)) != sizeof(long)) {
    syserr("read from %d\n", readDescriptor);
  }
  long ret = *value;
  free(value);
  return ret;
}


x86 assembly (clang, -O0):
<readLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1050 <read@plt>
cltq
cmp    $0x8,%rax
je     1185 <readLong+0x45>
mov    -0x4(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1040 <syserr@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readLong>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
mov    $0x8,%edx
call   1050 <read@plt>
cmp    $0x8,%eax
je     1174 <readLong+0x34>
lea    0xe93(%rip),%rdi
mov    %ebp,%esi
call   1040 <syserr@plt>
mov    (%rbx),%rbp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"read from %d\0A\00"
define i64 @readLong(i32 %0) {
%2 = alloca i32
%3 = alloca i64*
%4 = alloca i64
store i32 %0, i32* %2
%5 = call i64 @malloc(i32 8)
%6 = inttoptr i64 %5 to i64*
store i64* %6, i64** %3
%7 = load i32, i32* %2
%8 = load i64*, i64** %3
%9 = call i32 @read(i32 %7, i64* %8, i32 8)
%10 = sext i32 %9 to i64
%11 = icmp ne i64 %10, 8
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* %2
%14 = call i32 @syserr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %1
%16 = load i64*, i64** %3
%17 = load i64, i64* %16
store i64 %17, i64* %4
%18 = load i64*, i64** %3
%19 = call i32 @free(i64* %18)
%20 = load i64, i64* %4
ret i64 %20
}

LLVM IR (-O2):
@.str = [14 x i8] c"read from %d\0A\00"
define i64 @readLong(i32 %0) {
%2 = tail call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to i64*
%4 = tail call i32 @read(i32 %0, i64* %3, i32 8)
%5 = icmp eq i32 %4, 8
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @syserr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %3
%10 = tail call i32 @free(i64* %3)
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ nomem();
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t s) {
  void *n;
  if ((n = realloc(p, s)) == NULL) {
    free(p);
    nomem();
  }
  p = n;
  return (p);
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    116b <xrealloc+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1040 <nomem@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1153 <xrealloc+0x23>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1040 <nomem@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @free(i8* %0)
%7 = tail call i32 (...) @nomem()
br label %8
8: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ test11();
int main(int argc, char **argv) {
  if (!test11())
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test11@plt>
cmp    $0x0,%eax
jne    114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test11@plt>
test   %eax,%eax
je     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test11()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 0
}
int Sum(int a, int b) { return a + b; }


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

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

LLVM IR (-O0):
define i32 @Sum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @Sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int fun(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, sum;
  sum = fun(i);
  printf("1*2*3*4*5=%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fun@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"1*2*3*4*5=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fun(i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
char *find_slashr(const char *path) {
  char *result = strrchr(path, '/');
  return result;
}


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

x86 assembly (clang, -O2):
<find_slashr>:
mov    $0x2f,%esi
jmp    1030 <strrchr@plt>

LLVM IR (-O0):
define i8* @find_slashr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @find_slashr(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
ret i8* %2
}
void ED_LogNone(const char *string, ...) {}


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

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

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

LLVM IR (-O2):
define void @ED_LogNone(i8* nocapture %0, ...) {
ret void
}
int testLibCycleB3(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @testLibCycleB3() {
ret i32 0
}

LLVM IR (-O2):
define i32 @testLibCycleB3() {
ret i32 0
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 "
         "REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 "
         "CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Tue "
         "Aug 20 00:43:19 WIT 2013 BUILD=DEBUG CPU=ux500 USING_UMP=1 "
         "USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 "
         "USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= "
         "MALI_PLATFORM_FILE=platform/ux500/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


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

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

LLVM IR (-O0):
@.str = [471 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Tue Aug 20 00:43:19 WIT 2013 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [471 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Tue Aug 20 00:43:19 WIT 2013 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}
int tdefault_stopped_by_watchpoint(struct target_ops *self) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.target_ops = type opaque
define i32 @tdefault_stopped_by_watchpoint(%struct.target_ops* nocapture readnone %0) {
ret i32 0
}
char *mezery(char *s, char len) {
  int i;
  for (i = 0; i < len; i++) {
    s[i] = ' ';
  }
  s[(int)len] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<mezery>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jge    113e <mezery+0x3e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <mezery+0x15>
mov    -0x8(%rbp),%rax
movsbl -0x9(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mezery>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   %bpl,%bpl
jle    112e <mezery+0x1e>
movzbl %bpl,%edx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <memset@plt>
movsbq %bpl,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @mezery(i8* returned writeonly %0, i8 signext %1) {
%3 = icmp sgt i8 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i8 %1 to i64
br label %6
6: ; preds = %4, %2
%7 = sext i8 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret i8* %0
}
void *_set_copy(void *p) { return p; }


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

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

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

LLVM IR (-O2):
define i8* @_set_copy(i8* readnone returned %0) {
ret i8* %0
}
void vector_copy(short *VD, short *VS) {
  register int i;
  for (i = 0; i < 8; i++)
    VD[i] = VS[i];
  return;
}


x86 assembly (clang, -O0):
<vector_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1143 <vector_copy+0x43>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,2),%dx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <vector_copy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_copy>:
movzwl (%rsi),%eax
mov    %ax,(%rdi)
movzwl 0x2(%rsi),%eax
mov    %ax,0x2(%rdi)
movzwl 0x4(%rsi),%eax
mov    %ax,0x4(%rdi)
movzwl 0x6(%rsi),%eax
mov    %ax,0x6(%rdi)
movzwl 0x8(%rsi),%eax
mov    %ax,0x8(%rdi)
movzwl 0xa(%rsi),%eax
mov    %ax,0xa(%rdi)
movzwl 0xc(%rsi),%eax
mov    %ax,0xc(%rdi)
movzwl 0xe(%rsi),%eax
mov    %ax,0xe(%rdi)
ret

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

LLVM IR (-O2):
define void @vector_copy(i16* nocapture writeonly %0, i16* nocapture %1) {
%3 = load i16, i16* %1
store i16 %3, i16* %0
%4 = getelementptr inbounds i16, i16* %1, i64 1
%5 = load i16, i16* %4
%6 = getelementptr inbounds i16, i16* %0, i64 1
store i16 %5, i16* %6
%7 = getelementptr inbounds i16, i16* %1, i64 2
%8 = load i16, i16* %7
%9 = getelementptr inbounds i16, i16* %0, i64 2
store i16 %8, i16* %9
%10 = getelementptr inbounds i16, i16* %1, i64 3
%11 = load i16, i16* %10
%12 = getelementptr inbounds i16, i16* %0, i64 3
store i16 %11, i16* %12
%13 = getelementptr inbounds i16, i16* %1, i64 4
%14 = load i16, i16* %13
%15 = getelementptr inbounds i16, i16* %0, i64 4
store i16 %14, i16* %15
%16 = getelementptr inbounds i16, i16* %1, i64 5
%17 = load i16, i16* %16
%18 = getelementptr inbounds i16, i16* %0, i64 5
store i16 %17, i16* %18
%19 = getelementptr inbounds i16, i16* %1, i64 6
%20 = load i16, i16* %19
%21 = getelementptr inbounds i16, i16* %0, i64 6
store i16 %20, i16* %21
%22 = getelementptr inbounds i16, i16* %1, i64 7
%23 = load i16, i16* %22
%24 = getelementptr inbounds i16, i16* %0, i64 7
store i16 %23, i16* %24
ret void
}
int test_imm_2Cint64_highword_reg(long long val) {
  return ((val >> 32) & (0x2C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Cint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x2c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Cint64_highword_reg>:
movabs $0x2c00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Cint64_highword_reg(i64 %0) {
%2 = and i64 %0, 188978561024
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_55uint8_mem(unsigned char *val) {
  return ((*val) & (-0x55 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_55uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -85
%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_55uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -85
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void CacheDataInvalidateBuff(unsigned int startAddr, unsigned int numBytes) {}


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

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

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

LLVM IR (-O2):
define void @CacheDataInvalidateBuff(i32 %0, i32 %1) {
ret void
}
int fun1398() { return 1398; }


x86 assembly (clang, -O0):
<fun1398>:
push   %rbp
mov    %rsp,%rbp
mov    $0x576,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun1398() {
ret i32 1398
}

LLVM IR (-O2):
define i32 @fun1398() {
ret i32 1398
}
int hasDuplicates(unsigned int *targets, unsigned int latestTarget) {
  for (unsigned int i = 0; i < latestTarget; i++) {
    if (targets[i] == targets[latestTarget])
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<hasDuplicates>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1157 <hasDuplicates+0x57>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
cmp    (%rcx,%rdx,4),%eax
jne    1144 <hasDuplicates+0x44>
movl   $0x1,-0x4(%rbp)
jmp    115e <hasDuplicates+0x5e>
jmp    1149 <hasDuplicates+0x49>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <hasDuplicates+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasDuplicates>:
test   %esi,%esi
je     113a <hasDuplicates+0x3a>
mov    %esi,%ecx
mov    (%rdi,%rcx,4),%edx
mov    $0x1,%eax
cmp    %edx,(%rdi)
je     1139 <hasDuplicates+0x39>
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rsi
cmp    %rax,%rcx
je     1131 <hasDuplicates+0x31>
lea    0x1(%rsi),%rax
cmp    %edx,(%rdi,%rsi,4)
jne    1120 <hasDuplicates+0x20>
xor    %eax,%eax
cmp    %rcx,%rsi
setb   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hasDuplicates(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %21, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = load i32, i32* %0
%9 = icmp eq i32 %8, %7
br i1 %9, label %21, label %10
10: ; preds = %4, %13
%11 = phi i64 [ %17, %13 ], [ 1, %4 ]
%12 = icmp eq i64 %11, %5
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = getelementptr inbounds i32, i32* %0, i64 %11
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, %7
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %18, label %10
18: ; preds = %10, %13
%19 = icmp ult i64 %11, %5
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %18, %4, %2
%22 = phi i32 [ 0, %2 ], [ 1, %4 ], [ %20, %18 ]
ret i32 %22
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ ENGINE_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ENGINE_new();
int /*<<< orphan*/ jksengine_bind(int /*<<< orphan*/ *);
ENGINE *engine_jksengine(void) {
  ENGINE *e;
  ;
  e = ENGINE_new();
  if (!e)
    return (NULL);
  if (!jksengine_bind(e)) {
    ENGINE_free(e);
    return (NULL);
  }
  return (e);
}


x86 assembly (clang, -O0):
<engine_jksengine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ENGINE_new@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <engine_jksengine+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    118b <engine_jksengine+0x5b>
mov    -0x10(%rbp),%rdi
call   1050 <jksengine_bind@plt>
cmp    $0x0,%eax
jne    1183 <engine_jksengine+0x53>
mov    -0x10(%rbp),%rdi
call   1030 <ENGINE_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    118b <engine_jksengine+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<engine_jksengine>:
push   %rbx
xor    %eax,%eax
call   1040 <ENGINE_new@plt>
test   %rax,%rax
je     1154 <engine_jksengine+0x24>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <jksengine_bind@plt>
test   %eax,%eax
jne    1156 <engine_jksengine+0x26>
mov    %rbx,%rdi
call   1030 <ENGINE_free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @engine_jksengine() {
%1 = tail call i32* (...) @ENGINE_new()
%2 = icmp eq i32* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @jksengine_bind(i32* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @ENGINE_free(i32* %1)
br label %8
8: ; preds = %3, %0, %6
%9 = phi i32* [ null, %6 ], [ null, %0 ], [ %1, %3 ]
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern char *__progname;
  fprintf(
      stderr,
      "usage: %s [-46adKLnSTv] [-c config-file] [-D class=level] [-f fifo]\n"
      "          [-i pid-file] [-l packetlog-file] [-N udpencap-port]\n"
      "          [-p listen-port] [-R report-file]\n",
      __progname);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [176 x i8] c"usage: %s [-46adKLnSTv] [-c config-file] [-D class=level] [-f fifo]\0A [-i pid-file] [-l packetlog-file] [-N udpencap-port]\0A [-p listen-port] [-R report-file]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [176 x i8] c"usage: %s [-46adKLnSTv] [-c config-file] [-D class=level] [-f fifo]\0A [-i pid-file] [-l packetlog-file] [-N udpencap-port]\0A [-p listen-port] [-R report-file]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
size_t sysconf(int /*<<< orphan*/);
size_t numThreads() { return sysconf(_SC_NPROCESSORS_ONLN); }


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

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

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

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i64 @numThreads() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x30() {
  Assert_real((isspace(48) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              245, ("isspace should be 0 for 0"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for 0\00"
define void @t_isspace_0x30() {
%1 = tail call i64 @isspace(i32 48)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 245, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(void *);
void mutexCleanupHandler(void *arg) {
  ;
  pthread_mutex_unlock(arg);
}


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

x86 assembly (clang, -O2):
<mutexCleanupHandler>:
jmp    1030 <pthread_mutex_unlock@plt>

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

LLVM IR (-O2):
define void @mutexCleanupHandler(i8* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ inotify_map_isempty();
int /*<<< orphan*/ inotify_unmap_all();
void teardown() {
  inotify_unmap_all();
  assert(inotify_map_isempty());
}


x86 assembly (clang, -O0):
<teardown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <inotify_unmap_all@plt>
mov    $0x0,%al
call   1050 <inotify_map_isempty@plt>
mov    %eax,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<teardown>:
push   %rax
xor    %eax,%eax
call   1040 <inotify_unmap_all@plt>
xor    %eax,%eax
call   1050 <inotify_map_isempty@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @teardown() {
%1 = call i32 (...) @inotify_unmap_all()
%2 = call i32 (...) @inotify_map_isempty()
%3 = call i32 @assert(i32 %2)
ret void
}

LLVM IR (-O2):
define void @teardown() {
%1 = tail call i32 (...) @inotify_unmap_all()
%2 = tail call i32 (...) @inotify_map_isempty()
%3 = tail call i32 @assert(i32 %2)
ret void
}
void troca(int *v, int i, int j) {
  int temp = v[i];
  v[i] = v[j];
  v[j] = temp;
}


x86 assembly (clang, -O0):
<troca>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<troca>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @troca(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @troca(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned char *data;
};
typedef TYPE_1__ ASN1_STRING;

/* Variables and functions */
unsigned char *ASN1_STRING_data(ASN1_STRING *x) { return x->data; }


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

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i8* }
define i8* @ASN1_STRING_data(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i8* }
define i8* @ASN1_STRING_data(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i8*, i8** %2
ret i8* %3
}
void dummy_void(void) {}


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

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

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

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