xunge/DecIR huggingface dataset:
__attribute__((always_)) void
ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) {}


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

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

LLVM IR (-O0):
define void @ftrace_special(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @ftrace_special(i64 %0, i64 %1, i64 %2) {
ret void
}
int resource_new_uid(void) {
  static int resource_counter = 0;
  return resource_counter++;
}


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

x86 assembly (clang, -O2):
<resource_new_uid>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

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

LLVM IR (-O2):
@resource_new_uid.resource_counter = internal unnamed_addr global i32 0
define i32 @resource_new_uid() {
%1 = load i32, i32* @resource_new_uid.resource_counter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @resource_new_uid.resource_counter
ret i32 %1
}
/* Variables and functions */
int get_stnodep_value();
__attribute__((visibility("default"))) int get_shstdep_value(void) {
  return get_stnodep_value();
}


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

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

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

LLVM IR (-O2):
define i32 @get_shstdep_value() {
%1 = tail call i32 (...) @get_stnodep_value()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
long sum(int *, int);
int main(void) {
  int marbless[10] = {20, 10, 5, 39, 4, 16, 19, 26, 31, 20};
  long answer;
  answer = sum(marbless, 10);
  printf("The total number of marbless is %ld.\n", answer);
  printf("The size of marbless is %u bytes.\n", sizeof marbless);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <sum@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <sum@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.marbless = [10 x i32] [i32 20, i32 10, i32 5, i32 39, i32 4, i32 16, i32 19, i32 26, i32 31, i32 20]
@.str = [38 x i8] c"The total number of marbless is %ld.\0A\00"
@.str.1 = [35 x i8] c"The size of marbless is %u bytes.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i64
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i64 @sum(i32* %5, i32 10)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 40)
ret i32 0
}

LLVM IR (-O2):
@__const.main.marbless = [10 x i32] [i32 20, i32 10, i32 5, i32 39, i32 4, i32 16, i32 19, i32 26, i32 31, i32 20]
@.str = [38 x i8] c"The total number of marbless is %ld.\0A\00"
@.str.1 = [35 x i8] c"The size of marbless is %u bytes.\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i64 @sum(i32* %3, i32 10)
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 40)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ marker_A();
int /*<<< orphan*/ mutual_test_2(int);
void mutual_test_1(int flag) {
  marker_A();
  if (flag)
    mutual_test_2(flag);
}


x86 assembly (clang, -O0):
<mutual_test_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <marker_A@plt>
cmpl   $0x0,-0x4(%rbp)
je     1144 <mutual_test_1+0x24>
mov    -0x4(%rbp),%edi
call   1030 <mutual_test_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutual_test_1>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <marker_A@plt>
test   %ebx,%ebx
je     1136 <mutual_test_1+0x16>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <mutual_test_2@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @mutual_test_1(i32 %0) {
%2 = tail call i32 (...) @marker_A()
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @mutual_test_2(i32 %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void WarnAboutEnvVars() {
  static int warned_already = 0;
  if (!warned_already) {
    fprintf(stderr, "WARNING: use of 1.4 environment variables being\n");
    fprintf(stderr, "changed to use extended fields.\n");
    warned_already = 1;
  }
}


x86 assembly (clang, -O0):
<WarnAboutEnvVars>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1155 <WarnAboutEnvVars+0x45>
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeeb(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,0x2ed7(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WarnAboutEnvVars>:
push   %rbx
cmpb   $0x0,0x2f14(%rip)
jne    1144 <WarnAboutEnvVars+0x34>
mov    0x2ebf(%rip),%rbx
mov    (%rbx),%edi
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef9(%rip),%rsi
call   1030 <fprintf@plt>
movb   $0x1,0x2ee8(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@WarnAboutEnvVars.warned_already = internal global i32 0
@stderr = global i32 0
@.str = [49 x i8] c"WARNING: use of 1.4 environment variables being\0A\00"
@.str.1 = [33 x i8] c"changed to use extended fields.\0A\00"
define void @WarnAboutEnvVars() {
%1 = load i32, i32* @WarnAboutEnvVars.warned_already
%2 = icmp ne i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* @WarnAboutEnvVars.warned_already
br label %8
8: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@WarnAboutEnvVars.warned_already = internal unnamed_addr global i1 false
@stderr = global i32 0
@.str = [49 x i8] c"WARNING: use of 1.4 environment variables being\0A\00"
@.str.1 = [33 x i8] c"changed to use extended fields.\0A\00"
define void @WarnAboutEnvVars() {
%1 = load i1, i1* @WarnAboutEnvVars.warned_already
br i1 %1, label %7, label %2
2: ; preds = %0
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
store i1 true, i1* @WarnAboutEnvVars.warned_already
br label %7
7: ; preds = %2, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ bof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  FILE *badfile;
  badfile = fopen("badfile", "r");
  bof(badfile);
  printf("Returned Properly\n");
  fclose(badfile);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    0xea4(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <bof@plt>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <bof@plt>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"badfile\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [19 x i8] c"Returned Properly\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = call i32 @bof(i32* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32*, i32** %6
%12 = call i32 @fclose(i32* %11)
ret i32 1
}

LLVM IR (-O2):
@.str = [8 x i8] c"badfile\00"
@.str.1 = [2 x i8] c"r\00"
@str = [18 x i8] c"Returned Properly\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @bof(i32* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @fclose(i32* %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myfini() { printf("This is run after main()\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"This is run after main()\0A\00"
define void @myfini() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"This is run after main()\00"
define void @myfini() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ ipv4_to_str(char *, unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  unsigned int ip_addr = 356567252;
  char ip_v4_addr[256];
  ipv4_to_str(ip_v4_addr, ip_addr);
  printf("IPv4: %s.\n", ip_v4_addr);
  char a[12] = "14616";
  int b;
  b = atoi(a);
  printf("b == %d\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1540c8d4,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <ipv4_to_str@plt>
lea    -0x110(%rbp),%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xea0(%rip),%rax
mov    %rax,-0x11c(%rbp)
mov    0xe9b(%rip),%eax
mov    %eax,-0x114(%rbp)
lea    -0x11c(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x120(%rbp)
mov    -0x120(%rbp),%esi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1540c8d4,%esi
call   1040 <ipv4_to_str@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
mov    $0x3918,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"IPv4: %s.\0A\00"
@__const.main.a = [12 x i8] c"14616\00\00\00\00\00\00\00"
@.str.1 = [9 x i8] c"b == %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [256 x i8]
%4 = alloca [12 x i8]
%5 = alloca i32
store i32 0, i32* %1
store i32 356567252, i32* %2
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @ipv4_to_str(i8* %6, i32 %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = bitcast [12 x i8]* %4 to i8*
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"IPv4: %s.\0A\00"
@.str.1 = [9 x i8] c"b == %d\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @ipv4_to_str(i8* %2, i32 356567252)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 14616)
ret i32 0
}
void av_hwframe_transfer_get_formats() {}


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

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

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

LLVM IR (-O2):
define void @av_hwframe_transfer_get_formats() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef size_t uint16_t;

/* Variables and functions */
uint16_t mem_read16(uint8_t *mem, uint16_t addr) {
  return mem[addr] | mem[addr + 1] << 8;
}


x86 assembly (clang, -O0):
<mem_read16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
mov    0x4(%rcx,%rdx,4),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_read16>:
mov    0x4(%rdi,%rsi,4),%eax
shl    $0x8,%eax
or     (%rdi,%rsi,4),%eax
cltq
ret

LLVM IR (-O0):
define i64 @mem_read16(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = load i64, i64* %4
%11 = add i64 %10, 1
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = or i32 %8, %14
%16 = sext i32 %15 to i64
ret i64 %16
}

LLVM IR (-O2):
define i64 @mem_read16(i32* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 %1
%4 = load i32, i32* %3
%5 = add i64 %1, 1
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
%10 = sext i32 %9 to i64
ret i64 %10
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double log_time_absolute() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  double result = (double)tv.tv_sec;
  result += (double)tv.tv_usec * 0.000001;
  return result;
}


x86 assembly (clang, -O0):
<log_time_absolute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_time_absolute>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @log_time_absolute() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
store double %6, double* %2
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = load double, double* %2
%11 = call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %10)
store double %11, double* %2
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @log_time_absolute() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %10
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ selectionSort(int *, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int numbers[10000], i;
  srand(time(NULL));
  for (i = 0; i < 10000; i++)
    numbers[i] = rand();
  selectionSort(numbers, 10000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c60,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x9c54(%rbp)
cmpl   $0x2710,-0x9c54(%rbp)
jge    11a7 <main+0x67>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,%ecx
movslq -0x9c54(%rbp),%rax
mov    %ecx,-0x9c50(%rbp,%rax,4)
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    116c <main+0x2c>
lea    -0x9c50(%rbp),%rdi
mov    $0x2710,%esi
call   1030 <selectionSort@plt>
xor    %eax,%eax
add    $0x9c60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x9c40,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x2710,%rbx
jne    1160 <main+0x20>
mov    %rsp,%rdi
mov    $0x2710,%esi
call   1030 <selectionSort@plt>
xor    %eax,%eax
add    $0x9c40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10000 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
store i32 0, i32* %3
br label %6
6: ; preds = %14, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10000
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = call i32 (...) @rand()
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 %12
store i32 %10, i32* %13
br label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
%18 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 0
%19 = call i32 @selectionSort(i32* %18, i32 10000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10000 x i32]
%2 = bitcast [10000 x i32]* %1 to i8*
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 0, %0 ], [ %9, %5 ]
%7 = tail call i32 (...) @rand()
%8 = getelementptr inbounds [10000 x i32], [10000 x i32]* %1, i64 0, i64 %6
store i32 %7, i32* %8
%9 = add nuw nsw i64 %6, 1
%10 = icmp eq i64 %9, 10000
br i1 %10, label %11, label %5
11: ; preds = %5
%12 = getelementptr inbounds [10000 x i32], [10000 x i32]* %1, i64 0, i64 0
%13 = call i32 @selectionSort(i32* %12, i32 10000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_task(void *args) { printf("Hello world!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define void @my_task(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define void @my_task(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u_char;

/* Variables and functions */
int cbmarch_talk(int, int /*<<< orphan*/, int /*<<< orphan*/);
int cbm_talk(int HandleDevice, __u_char DeviceAddress,
             __u_char SecondaryAddress) {
  ;
  return cbmarch_talk(HandleDevice, DeviceAddress, SecondaryAddress);
}


x86 assembly (clang, -O0):
<cbm_talk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <cbmarch_talk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbm_talk>:
jmp    1030 <cbmarch_talk@plt>

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

LLVM IR (-O2):
define i32 @cbm_talk(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @cbmarch_talk(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a, b;
  a = getppid();
  printf("ppid is %d\n", a);
  b = getpid();
  printf("pid is %d\n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"ppid is %d\0A\00"
@.str.1 = [11 x i8] c"pid is %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getppid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 7, 14);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0xe,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0xe,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 14)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 14)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
void smb_readline_ca_char(char c) {}


x86 assembly (clang, -O0):
<smb_readline_ca_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @smb_readline_ca_char(i8 signext %0) {
ret void
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double sinhl(long double x) { return __infer_nondet_long_double(); }


x86 assembly (clang, -O0):
<sinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @sinhl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @sinhl(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
/* Variables and functions */
int any_bit_set(unsigned char *dbg_flag, size_t n_bytes) {
  while (n_bytes--)
    if (*dbg_flag++)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<any_bit_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     114e <any_bit_set+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     1149 <any_bit_set+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1155 <any_bit_set+0x55>
jmp    110c <any_bit_set+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_bit_set>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    %rcx,%rsi
je     1124 <any_bit_set+0x24>
cmpb   $0x0,(%rdi,%rcx,1)
lea    0x1(%rcx),%rcx
je     1110 <any_bit_set+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @any_bit_set(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %9, %7 ]
%5 = phi i64 [ %1, %2 ], [ %8, %7 ]
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = add i64 %5, -1
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = icmp eq i8 %10, 0
br i1 %11, label %3, label %12
12: ; preds = %3, %7
%13 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %13
}
/* Variables and functions */
size_t pn_max(size_t x, size_t y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<pn_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <pn_max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <pn_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pn_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @pn_max(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 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @pn_max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int getpid();
int tcgetpgrp(int fd) { return getpid(); }


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

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

LLVM IR (-O0):
define i32 @tcgetpgrp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
ret i32 %3
}

LLVM IR (-O2):
define i32 @tcgetpgrp(i32 %0) {
%2 = tail call i32 (...) @getpid()
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, int /*<<< orphan*/ *, int,
                           int /*<<< orphan*/ *, size_t, unsigned int);
ssize_t copy_file_range(int fd_in, off_t *off_in, int fd_out, off_t *off_out,
                        size_t len, unsigned flags) {
  return syscall(391, fd_in, off_in, fd_out, off_out, len, flags);
}


x86 assembly (clang, -O0):
<copy_file_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x2c(%rbp),%eax
mov    $0x187,%edi
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_file_range>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    %r9d,(%rsp)
mov    $0x187,%edi
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @copy_file_range(i32 %0, i32* %1, i32 %2, i32* %3, i64 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i64
%12 = alloca i32
store i32 %0, i32* %7
store i32* %1, i32** %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i64 %4, i64* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load i32*, i32** %8
%15 = load i32, i32* %9
%16 = load i32*, i32** %10
%17 = load i64, i64* %11
%18 = load i32, i32* %12
%19 = call i32 @syscall(i32 391, i32 %13, i32* %14, i32 %15, i32* %16, i64 %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @copy_file_range(i32 %0, i32* %1, i32 %2, i32* %3, i64 %4, i32 %5) {
%7 = tail call i32 @syscall(i32 391, i32 %0, i32* %1, i32 %2, i32* %3, i64 %4, i32 %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ gl_cleanup();
int /*<<< orphan*/ hist_dispose();
void gl_dispose(void) {
  gl_cleanup();
  hist_dispose();
}


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

x86 assembly (clang, -O2):
<gl_dispose>:
push   %rax
xor    %eax,%eax
call   1030 <gl_cleanup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <hist_dispose@plt>

LLVM IR (-O0):
define void @gl_dispose() {
%1 = call i32 (...) @gl_cleanup()
%2 = call i32 (...) @hist_dispose()
ret void
}

LLVM IR (-O2):
define void @gl_dispose() {
%1 = tail call i32 (...) @gl_cleanup()
%2 = tail call i32 (...) @hist_dispose()
ret void
}
int page_belong(struct page_allocator *allocator, void *page) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.page_allocator = type opaque
define i32 @page_belong(%struct.page_allocator* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
char *hash_plugin_summary(void) { return ("smf \t\tSMF plugin"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"smf \09\09SMF plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"smf \09\09SMF plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ vid_clear(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ vid_flip(int /*<<< orphan*/);
int /*<<< orphan*/ vid_set_mode(int, int);
void vid_init(int disp_mode, int pixel_mode) {
  vid_set_mode(disp_mode, pixel_mode);
  vid_clear(0, 0, 0);
  vid_flip(0);
}


x86 assembly (clang, -O0):
<vid_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <vid_set_mode@plt>
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1050 <vid_clear@plt>
xor    %edi,%edi
call   1030 <vid_flip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vid_init>:
push   %rax
call   1040 <vid_set_mode@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <vid_clear@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <vid_flip@plt>

LLVM IR (-O0):
define void @vid_init(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 = call i32 @vid_set_mode(i32 %5, i32 %6)
%8 = call i32 @vid_clear(i32 0, i32 0, i32 0)
%9 = call i32 @vid_flip(i32 0)
ret void
}

LLVM IR (-O2):
define void @vid_init(i32 %0, i32 %1) {
%3 = tail call i32 @vid_set_mode(i32 %0, i32 %1)
%4 = tail call i32 @vid_clear(i32 0, i32 0, i32 0)
%5 = tail call i32 @vid_flip(i32 0)
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *get_self_prog_name(char *argv0) {
  char *ptr = strrchr(argv0, '/');
  if (ptr)
    return ++ptr;
  return argv0;
}


x86 assembly (clang, -O0):
<get_self_prog_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114e <get_self_prog_name+0x3e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1156 <get_self_prog_name+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_self_prog_name>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @get_self_prog_name(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ runAllTests_dblexer();
int main(void) {
  runAllTests_dblexer();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @runAllTests_dblexer()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runAllTests_dblexer()
ret i32 0
}
/* Variables and functions */
char toupper(char);
char *strtoupper(char *str) {
  char *c = str;
  while ((*c = toupper(*c))) {
    c++;
  }
  return (str);
}


x86 assembly (clang, -O0):
<strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     114f <strtoupper+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strtoupper+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <strtoupper+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strtoupper(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call signext i8 @toupper(i8 signext %4)
store i8 %5, i8* %3
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void WasmSupport_trap() { exit(1); }


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

x86 assembly (clang, -O2):
<WasmSupport_trap>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @WasmSupport_trap() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ default_line_gwt();
int /*<<< orphan*/ set_line_gwt(double, double, int);
int /*<<< orphan*/ triangl1(double, double, double, double);
void triangl(double x1, double y1, double r1, double a1, double g, double w,
             int it) {
  set_line_gwt(g, w, it);
  triangl1(x1, y1, r1, a1);
  default_line_gwt();
  return;
}


x86 assembly (clang, -O0):
<triangl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
mov    %edi,-0x34(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x34(%rbp),%edi
call   1030 <set_line_gwt@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1050 <triangl1@plt>
mov    $0x0,%al
call   1040 <default_line_gwt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangl>:
sub    $0x28,%rsp
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movaps %xmm4,%xmm0
movaps %xmm5,%xmm1
call   1030 <set_line_gwt@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
call   1050 <triangl1@plt>
xor    %eax,%eax
add    $0x28,%rsp
jmp    1040 <default_line_gwt@plt>

LLVM IR (-O0):
define void @triangl(double %0, double %1, double %2, double %3, double %4, double %5, i32 %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i32
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store i32 %6, i32* %14
%15 = load double, double* %12
%16 = load double, double* %13
%17 = load i32, i32* %14
%18 = call i32 @set_line_gwt(double %15, double %16, i32 %17)
%19 = load double, double* %8
%20 = load double, double* %9
%21 = load double, double* %10
%22 = load double, double* %11
%23 = call i32 @triangl1(double %19, double %20, double %21, double %22)
%24 = call i32 (...) @default_line_gwt()
ret void
}

LLVM IR (-O2):
define void @triangl(double %0, double %1, double %2, double %3, double %4, double %5, i32 %6) {
%8 = tail call i32 @set_line_gwt(double %4, double %5, i32 %6)
%9 = tail call i32 @triangl1(double %0, double %1, double %2, double %3)
%10 = tail call i32 (...) @default_line_gwt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() { abort(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
float sin(float);
float func(float x) { return x * x * (x * x - 2.0) * sin(x); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xebf(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xedc(%rip),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
call   1030 <sin@plt>
cvtss2sd %xmm0,%xmm0
mulsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @func(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = load float, float* %2
%8 = load float, float* %2
%9 = fmul float %7, %8
%10 = fpext float %9 to double
%11 = fsub double %10, 2.000000e+00
%12 = fmul double %6, %11
%13 = load float, float* %2
%14 = call float @sin(float %13)
%15 = fpext float %14 to double
%16 = fmul double %12, %15
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
define float @func(float %0) {
%2 = fmul float %0, %0
%3 = fpext float %2 to double
%4 = fadd double %3, -2.000000e+00
%5 = fmul double %4, %3
%6 = tail call float @sin(float %0)
%7 = fpext float %6 to double
%8 = fmul double %5, %7
%9 = fptrunc double %8 to float
ret float %9
}