xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void get2(int *value1_ptr, int *value2_ptr) {
  printf("\tValue of the resistor (R1) in Ohms: ");
  scanf("%d", value1_ptr);
  printf("\tValue of the capacitor (C1) in Farads: ");
  scanf("%d", value2_ptr);
}


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

x86 assembly (clang, -O2):
<get2>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"\09Value of the resistor (R1) in Ohms: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [41 x i8] c"\09Value of the capacitor (C1) in Farads: \00"
define void @get2(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %3
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"\09Value of the resistor (R1) in Ohms: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [41 x i8] c"\09Value of the capacitor (C1) in Farads: \00"
define void @get2(i32* %0, i32* %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret void
}
/* Variables and functions */
unsigned int rand();
int /*<<< orphan*/ srand(unsigned int);
unsigned int rnd(unsigned int seed) {
  srand(seed);
  return rand();
}


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

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

LLVM IR (-O0):
define i32 @rnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
ret i32 %5
}

LLVM IR (-O2):
define i32 @rnd(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
%3 = tail call i32 (...) @rand()
ret i32 %3
}
void i2d_PrivateKey(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_PrivateKey() {
ret void
}
int sb_has_quota_suspended(struct super_block *sb, int type) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @sb_has_quota_suspended(%struct.super_block* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
void print_string(char *buf, char *c) { sprintf(buf, "%s", c); }


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

x86 assembly (clang, -O2):
<print_string>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @print_string(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret void
}
int chown(char *name, short uid, int gid) { return 0; }


x86 assembly (clang, -O0):
<chown>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @chown(i8* %0, i16 signext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @chown(i8* nocapture readnone %0, i16 signext %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
char *strdup(char *);
char *strsep(char **, char *);
void changedir(char *s) {
  char *copy = strdup(s);
  char *junk = strsep(&s, " ");
  chdir(s);
}


x86 assembly (clang, -O0):
<changedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strsep@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changedir>:
push   %rax
mov    %rdi,(%rsp)
lea    0xed4(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strsep@plt>
mov    (%rsp),%rdi
call   1030 <chdir@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @changedir(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strdup(i8* %5)
store i8* %6, i8** %3
%7 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %4
%8 = load i8*, i8** %2
%9 = call i32 @chdir(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @changedir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @chdir(i8* %4)
ret void
}
/* Variables and functions */
int divides_l(long, long);
bool is_factor_l(long n, long m) { return divides_l(n, m); }


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

x86 assembly (clang, -O2):
<is_factor_l>:
jmp    1030 <divides_l@plt>

LLVM IR (-O0):
define i32 @is_factor_l(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 = call i32 @divides_l(i64 %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_factor_l(i64 %0, i64 %1) {
%3 = tail call i32 @divides_l(i64 %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *progname) {
  printf("Usage: %s [-f configuration_file][-l listen_address][-d]\n",
         progname);
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"Usage: %s [-f configuration_file][-l listen_address][-d]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"Usage: %s [-f configuration_file][-l listen_address][-d]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void pathconN_nm9_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathconN_nm9_decref() {
ret void
}
/* Variables and functions */
int checker_read_int(int, char const *, int, int *);
int checker_read_team_int(const char *name, int eof_error_flag, int *p_val) {
  return checker_read_int(1, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_team_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
call   1030 <checker_read_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_team_int>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <checker_read_int@plt>

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

LLVM IR (-O2):
define i32 @checker_read_team_int(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @checker_read_int(i32 1, i8* %0, i32 %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
char lower_case(char);
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char c = 'A', lower_c;
  lower_c = lower_case(c);
  printf("Lower case of %c is: %c\n", c, lower_c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <lower_case@plt>
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
lea    0xeb7(%rip),%rdi
movsbl %al,%esi
movsbl -0x6(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x41,%edi
call   1040 <lower_case@plt>
movsbl %al,%edx
lea    0xecb(%rip),%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Lower case of %c is: %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 65, i8* %2
%4 = load i8, i8* %2
%5 = call signext i8 @lower_case(i8 signext %4)
store i8 %5, i8* %3
%6 = load i8, i8* %2
%7 = load i8, i8* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 signext %6, i8 signext %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Lower case of %c is: %c\0A\00"
define i32 @main() {
%1 = tail call signext i8 @lower_case(i8 signext 65)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 signext 65, i8 signext %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hd44780_extif_wait_1ms(int);
int /*<<< orphan*/ hd44780_extif_wait_1us(int);
int /*<<< orphan*/ hd44780_ll_register_write_ifs(int);
void hd44780_ll_init_function_set(void) {
  hd44780_extif_wait_1ms(100);
  hd44780_ll_register_write_ifs(0x30);
  hd44780_extif_wait_1ms(5);
  hd44780_ll_register_write_ifs(0x30);
  hd44780_extif_wait_1us(100);
  hd44780_ll_register_write_ifs(0x30);
  hd44780_extif_wait_1us(100);
}


x86 assembly (clang, -O0):
<hd44780_ll_init_function_set>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <hd44780_extif_wait_1ms@plt>
mov    $0x30,%edi
call   1050 <hd44780_ll_register_write_ifs@plt>
mov    $0x5,%edi
call   1030 <hd44780_extif_wait_1ms@plt>
mov    $0x30,%edi
call   1050 <hd44780_ll_register_write_ifs@plt>
mov    $0x64,%edi
call   1040 <hd44780_extif_wait_1us@plt>
mov    $0x30,%edi
call   1050 <hd44780_ll_register_write_ifs@plt>
mov    $0x64,%edi
call   1040 <hd44780_extif_wait_1us@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd44780_ll_init_function_set>:
push   %rax
mov    $0x64,%edi
call   1030 <hd44780_extif_wait_1ms@plt>
mov    $0x30,%edi
call   1050 <hd44780_ll_register_write_ifs@plt>
mov    $0x5,%edi
call   1030 <hd44780_extif_wait_1ms@plt>
mov    $0x30,%edi
call   1050 <hd44780_ll_register_write_ifs@plt>
mov    $0x64,%edi
call   1040 <hd44780_extif_wait_1us@plt>
mov    $0x30,%edi
call   1050 <hd44780_ll_register_write_ifs@plt>
mov    $0x64,%edi
pop    %rax
jmp    1040 <hd44780_extif_wait_1us@plt>

LLVM IR (-O0):
define void @hd44780_ll_init_function_set() {
%1 = call i32 @hd44780_extif_wait_1ms(i32 100)
%2 = call i32 @hd44780_ll_register_write_ifs(i32 48)
%3 = call i32 @hd44780_extif_wait_1ms(i32 5)
%4 = call i32 @hd44780_ll_register_write_ifs(i32 48)
%5 = call i32 @hd44780_extif_wait_1us(i32 100)
%6 = call i32 @hd44780_ll_register_write_ifs(i32 48)
%7 = call i32 @hd44780_extif_wait_1us(i32 100)
ret void
}

LLVM IR (-O2):
define void @hd44780_ll_init_function_set() {
%1 = tail call i32 @hd44780_extif_wait_1ms(i32 100)
%2 = tail call i32 @hd44780_ll_register_write_ifs(i32 48)
%3 = tail call i32 @hd44780_extif_wait_1ms(i32 5)
%4 = tail call i32 @hd44780_ll_register_write_ifs(i32 48)
%5 = tail call i32 @hd44780_extif_wait_1us(i32 100)
%6 = tail call i32 @hd44780_ll_register_write_ifs(i32 48)
%7 = tail call i32 @hd44780_extif_wait_1us(i32 100)
ret void
}
int highscore_import_precedence(int a, int b) { return a < b; }


x86 assembly (clang, -O0):
<highscore_import_precedence>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<highscore_import_precedence>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @highscore_import_precedence(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 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @highscore_import_precedence(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
cbuf7(f, n) int f, n;
{ cbuf(f, n, 7); }


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

x86 assembly (clang, -O2):
<cbuf7>:
mov    $0x7,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf7(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf7(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 7)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
unsigned long long byteSwap64(unsigned long long);
int /*<<< orphan*/ mustReadFd(int, unsigned long long *, int);
unsigned long long fdReadBits64(int fd, int isSwapped) {
  unsigned long long val;
  mustReadFd((fd), &(val), sizeof(val));
  if (isSwapped)
    val = byteSwap64(val);
  return val;
}


x86 assembly (clang, -O0):
<fdReadBits64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <mustReadFd@plt>
cmpl   $0x0,-0x8(%rbp)
je     1156 <fdReadBits64+0x36>
mov    -0x10(%rbp),%rdi
call   1030 <byteSwap64@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdReadBits64>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1040 <mustReadFd@plt>
mov    0x8(%rsp),%rax
test   %ebx,%ebx
je     1147 <fdReadBits64+0x27>
mov    %rax,%rdi
call   1030 <byteSwap64@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @fdReadBits64(i32 %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @mustReadFd(i32 %0, i64* %3, i32 8)
%6 = icmp eq i32 %1, 0
%7 = load i64, i64* %3
br i1 %6, label %10, label %8
8: ; preds = %2
%9 = call i64 @byteSwap64(i64 %7)
br label %10
10: ; preds = %2, %8
%11 = phi i64 [ %9, %8 ], [ %7, %2 ]
ret i64 %11
}
void CNFGFlushRender() {}


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

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

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

LLVM IR (-O2):
define void @CNFGFlushRender() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void err(const char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
define void @err(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void dec_dl_migration(struct sched_dl_entity *dl_se, struct dl_rq *dl_rq) {}


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

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

LLVM IR (-O0):
%struct.sched_dl_entity = type opaque
%struct.dl_rq = type opaque
define void @dec_dl_migration(%struct.sched_dl_entity* %0, %struct.dl_rq* %1) {
%3 = alloca %struct.sched_dl_entity*
%4 = alloca %struct.dl_rq*
store %struct.sched_dl_entity* %0, %struct.sched_dl_entity** %3
store %struct.dl_rq* %1, %struct.dl_rq** %4
ret void
}

LLVM IR (-O2):
%struct.sched_dl_entity = type opaque
%struct.dl_rq = type opaque
define void @dec_dl_migration(%struct.sched_dl_entity* nocapture %0, %struct.dl_rq* nocapture %1) {
ret void
}
/* Variables and functions */
unsigned char *ripemd128_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_ripemd128(unsigned char *out,
                                     const unsigned char *in, size_t in_len) {
  return ripemd128_buffer(out, in, in_len);
}


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

x86 assembly (clang, -O2):
<hash_buffer_ripemd128>:
jmp    1030 <ripemd128_buffer@plt>

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

LLVM IR (-O2):
define i8* @hash_buffer_ripemd128(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @ripemd128_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int Next_Stream_Token_Obtained();
int Next_Text_Token_Obtained(void) { return Next_Stream_Token_Obtained(); }


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

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

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

LLVM IR (-O2):
define i32 @Next_Text_Token_Obtained() {
%1 = tail call i32 (...) @Next_Stream_Token_Obtained()
ret i32 %1
}
char rotN(char c, int min, int max, int mod, int N) {
  char temp = c + N;
  if ((int)c + N > max) {
    temp = (char)(min + ((int)c + N - 1 - max));
  }
  return temp;
}


x86 assembly (clang, -O0):
<rotN>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
movsbl -0x1(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %al,-0x15(%rbp)
movsbl -0x1(%rbp),%eax
add    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1146 <rotN+0x46>
mov    -0x8(%rbp),%eax
movsbl -0x1(%rbp),%ecx
add    -0x14(%rbp),%ecx
sub    $0x1,%ecx
sub    -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotN>:
lea    (%rdi,%r8,1),%ecx
mov    %edx,%edi
not    %edi
add    %esi,%edi
xor    %eax,%eax
cmp    %edx,%ecx
cmovg  %edi,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @rotN(i8 signext %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i8 %0 to i32
%7 = add nsw i32 %6, %4
%8 = icmp sgt i32 %7, %2
%9 = xor i32 %2, -1
%10 = add i32 %9, %1
%11 = select i1 %8, i32 %10, i32 0
%12 = add i32 %7, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ perror_msg_and_die(char *, char const *);
FILE *xfopen(const char *path, const char *mode) {
  FILE *fp;
  if ((fp = fopen(path, mode)) == NULL)
    perror_msg_and_die("%s", path);
  return fp;
}


x86 assembly (clang, -O0):
<xfopen>:
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   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115b <xfopen+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <perror_msg_and_die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfopen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xfopen+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <perror_msg_and_die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define noalias i32* @xfopen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror_msg_and_die(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret i32* %3
}
unsigned int _Z9API_CALL0i(unsigned int llvm_cbe_i) {
  unsigned int llvm_cbe_retval;
  unsigned int llvm_cbe_i_2e_addr;
  unsigned int llvm_cbe_tmp;
  unsigned int llvm_cbe_tmp__1;
  *(&llvm_cbe_i_2e_addr) = llvm_cbe_i;
  llvm_cbe_tmp = *(&llvm_cbe_i_2e_addr);
  *(&llvm_cbe_retval) = llvm_cbe_tmp;
  llvm_cbe_tmp__1 = *(&llvm_cbe_retval);
  return llvm_cbe_tmp__1;
}


x86 assembly (clang, -O0):
<_Z9API_CALL0i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_Z9API_CALL0i(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_prof(int sig) { printf("PROF\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"PROF\00"
define void @catch_prof(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double log(double);
double ucpy_func(double u, double hc, double d0m, double z0m, double K,
                 double ustar) {
  double ucanopy;
  ucanopy = u * ((log((hc - d0m) / z0m) / (u * K / ustar)));
  return (ucanopy);
}


x86 assembly (clang, -O0):
<ucpy_func>:
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)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  -0x28(%rbp),%xmm2
divsd  -0x30(%rbp),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucpy_func>:
sub    $0x18,%rsp
movsd  %xmm5,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm0,(%rsp)
subsd  %xmm2,%xmm1
divsd  %xmm3,%xmm1
movapd %xmm1,%xmm0
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
mulsd  %xmm2,%xmm1
divsd  0x10(%rsp),%xmm1
divsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ucpy_func(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%14 = load double, double* %7
%15 = load double, double* %8
%16 = load double, double* %9
%17 = fsub double %15, %16
%18 = load double, double* %10
%19 = fdiv double %17, %18
%20 = call double @log(double %19)
%21 = load double, double* %7
%22 = load double, double* %11
%23 = fmul double %21, %22
%24 = load double, double* %12
%25 = fdiv double %23, %24
%26 = fdiv double %20, %25
%27 = fmul double %14, %26
store double %27, double* %13
%28 = load double, double* %13
ret double %28
}

LLVM IR (-O2):
define double @ucpy_func(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %1, %2
%8 = fdiv double %7, %3
%9 = tail call double @log(double %8)
%10 = fmul double %0, %4
%11 = fdiv double %10, %5
%12 = fdiv double %9, %11
%13 = fmul double %12, %0
ret double %13
}
void XSyncQueryCounter() {}


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

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

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

LLVM IR (-O2):
define void @XSyncQueryCounter() {
ret void
}
/* Variables and functions */
int __syscall(int, int);
int errno;
int _close(int fd) {
  int err;
  err = __syscall(6, fd);
  if (err < 0) {
    errno = -err;
    return -1;
  }
  return err;
}


x86 assembly (clang, -O0):
<_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x6,%edi
call   1030 <__syscall@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114f <_close+0x3f>
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
mov    0x2e9f(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <_close+0x45>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_close>:
push   %rax
mov    %edi,%esi
mov    $0x6,%edi
call   1030 <__syscall@plt>
test   %eax,%eax
js     1123 <_close+0x13>
pop    %rcx
ret
neg    %eax
mov    0x2eb4(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @__syscall(i32 6, i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = sub nsw i32 0, %10
store i32 %11, i32* @errno
store i32 -1, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @_close(i32 %0) {
%2 = tail call i32 @__syscall(i32 6, i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = sub nsw i32 0, %2
store i32 %5, i32* @errno
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ %2, %1 ]
ret i32 %7
}
/* Type definitions */
typedef void const uint8_t;

/* Variables and functions */
scalar_t__ cmp8(void const *, void const *);
bool cmp16(const void *a, const void *b) {
  return cmp8(a, b) && cmp8((uint8_t *)a + 8, (uint8_t *)b + 8);
}


x86 assembly (clang, -O0):
<cmp16>:
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   1030 <cmp8@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     115e <cmp16+0x4e>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <cmp8@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp16>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <cmp8@plt>
test   %rax,%rax
je     1144 <cmp16+0x34>
add    $0x8,%rbx
add    $0x8,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <cmp8@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1146 <cmp16+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @cmp16(i8* %0, i8* %1) {
%3 = tail call i64 @cmp8(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = getelementptr i8, i8* %0, i64 8
%7 = getelementptr i8, i8* %1, i64 8
%8 = tail call i64 @cmp8(i8* %6, i8* %7)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %5, %2
%12 = phi i32 [ 0, %2 ], [ %10, %5 ]
ret i32 %12
}
/* Variables and functions */
char *strrchr(char *, char);
void remove_linebreak(char *str) {
  char *linebreak;
  linebreak = strrchr(str, '\n');
  if (linebreak)
    *linebreak = '\0';
  linebreak = strrchr(str, '\r');
  if (linebreak)
    *linebreak = '\0';
}


x86 assembly (clang, -O0):
<remove_linebreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <remove_linebreak+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1164 <remove_linebreak+0x54>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_linebreak>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1126 <remove_linebreak+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     113b <remove_linebreak+0x2b>
movb   $0x0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @remove_linebreak(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 10)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %2
%12 = call i8* @strrchr(i8* %11, i8 signext 13)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i8*, i8** %3
store i8 0, i8* %16
br label %17
17: ; preds = %15, %10
ret void
}

LLVM IR (-O2):
define void @remove_linebreak(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
%6 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 13)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %5
store i8 0, i8* %6
br label %9
9: ; preds = %8, %5
ret void
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int osascriptPresent() {
  static int lOsascriptPresent = -1;
  if (lOsascriptPresent < 0) {
    lOsascriptPresent = detectPresence("osascript");
  }
  return lOsascriptPresent && graphicMode();
}


x86 assembly (clang, -O0):
<osascriptPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <osascriptPresent+0x27>
lea    0xec4(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2ee9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ee0(%rip)
mov    %al,-0x1(%rbp)
je     116a <osascriptPresent+0x4a>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osascriptPresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <osascriptPresent+0x23>
test   %eax,%eax
je     1159 <osascriptPresent+0x39>
xor    %eax,%eax
call   1030 <graphicMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2edb(%rip)
test   %eax,%eax
jne    112f <osascriptPresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@osascriptPresent.lOsascriptPresent = internal global i32 -1
@.str = [10 x i8] c"osascript\00"
define i32 @osascriptPresent() {
%1 = load i32, i32* @osascriptPresent.lOsascriptPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @osascriptPresent.lOsascriptPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @osascriptPresent.lOsascriptPresent
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@osascriptPresent.lOsascriptPresent = internal unnamed_addr global i32 -1
@.str = [10 x i8] c"osascript\00"
define i32 @osascriptPresent() {
%1 = load i32, i32* @osascriptPresent.lOsascriptPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @osascriptPresent.lOsascriptPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
int sparse_target(int g, int *p1, int *p2) {
  while (p1 < p2) {
    if (*p1 == g)
      return *(p1 + 1);
    p1 += 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sparse_target>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114c <sparse_target+0x4c>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    113b <sparse_target+0x3b>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <sparse_target+0x53>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <sparse_target+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sparse_target>:
xor    %eax,%eax
cmp    %rdx,%rsi
jae    111d <sparse_target+0x1d>
nopw   0x0(%rax,%rax,1)
cmp    %edi,(%rsi)
je     111e <sparse_target+0x1e>
add    $0x8,%rsi
cmp    %rdx,%rsi
jb     1110 <sparse_target+0x10>
ret
mov    0x4(%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @sparse_target(i32 %0, i32* %1, i32* readnone %2) {
%4 = icmp ult i32* %1, %2
br i1 %4, label %5, label %15
5: ; preds = %3, %12
%6 = phi i32* [ %13, %12 ], [ %1, %3 ]
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = load i32, i32* %10
br label %15
12: ; preds = %5
%13 = getelementptr inbounds i32, i32* %6, i64 2
%14 = icmp ult i32* %13, %2
br i1 %14, label %5, label %15
15: ; preds = %12, %3, %9
%16 = phi i32 [ %11, %9 ], [ 0, %3 ], [ 0, %12 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int init(char *buff) {
  if (buff) {
    char tmp[] = {0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
                  0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};
    memcpy(buff, tmp, 16);
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <init+0x4b>
mov    0xed2(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
jmp    1162 <init+0x52>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
test   %rdi,%rdi
je     1138 <init+0x28>
sub    $0x18,%rsp
movaps 0xee0(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@__const.init.tmp = [16 x i8] c"\02\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F"
define i32 @init(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [16 x i8]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = bitcast [16 x i8]* %4 to i8*
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%11 = call i32 @memcpy(i8* %9, i8* %10, i32 16)
store i32 0, i32* %2
br label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@__const.init.tmp = [16 x i8] c"\02\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F"
define i32 @init(i8* %0) {
%2 = alloca [16 x i8]
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = call i32 @memcpy(i8* %0, i8* %5, i32 16)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %8
}
void _vDisp(unsigned int uiLine, const unsigned char *puszTxt) {}


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

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

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

LLVM IR (-O2):
define void @_vDisp(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ task_h_runTests();
int main(int argc, char *argv[]) {
  task_h_runTests();
  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 <task_h_runTests@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <task_h_runTests@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 (...) @task_h_runTests()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @task_h_runTests()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  foo(123);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7b,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 123)
ret i32 0
}
const char *zlibVersion() { return "1.2.7"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"1.2.7\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int isinff(float);
int /*<<< orphan*/ printf(char *, int);
main() {
  float x = 1.0 / 0.0;
  int i = isinff(x);
  if (i == 0)
    abort();
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <isinff@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    116a <main+0x3a>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0xc(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xec7(%rip),%xmm0
call   1050 <isinff@plt>
test   %eax,%eax
je     1154 <main+0x24>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @isinff(float 0x7FF0000000000000)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}