xunge/DecIR huggingface dataset:
double my_func(double x, double y) {
  if (x > y)
    return x;
  else
    return y;
}


x86 assembly (clang, -O0):
<my_func>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <my_func+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <my_func+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_func>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @my_func(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @my_func(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, unsigned int);
void mem_copy(void *dest, const void *source, unsigned size) {
  memcpy(dest, source, size);
}


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

x86 assembly (clang, -O2):
<mem_copy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @mem_copy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
int octave_f_setfl_wrapper(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @octave_f_setfl_wrapper() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @octave_f_setfl_wrapper() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int write_i2c_reg(int, int, int /*<<< orphan*/);
int piups_set_vaux2conv(int file_i2c, uint16_t vaux2conv) {
  return write_i2c_reg(file_i2c, 0x56, vaux2conv);
}


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

x86 assembly (clang, -O2):
<piups_set_vaux2conv>:
mov    %esi,%edx
mov    $0x56,%esi
jmp    1030 <write_i2c_reg@plt>

LLVM IR (-O0):
define i32 @piups_set_vaux2conv(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 @write_i2c_reg(i32 %5, i32 86, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @piups_set_vaux2conv(i32 %0, i32 %1) {
%3 = tail call i32 @write_i2c_reg(i32 %0, i32 86, i32 %1)
ret i32 %3
}
/* Variables and functions */
int ap_get_single_string_command(int, int, char *, int);
int ap_get_comment(int session, char *str) {
  return (ap_get_single_string_command(session, 0xcc20, str, 256));
}


x86 assembly (clang, -O0):
<ap_get_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xcc20,%esi
mov    $0x100,%ecx
call   1030 <ap_get_single_string_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_get_comment>:
mov    %rsi,%rdx
mov    $0xcc20,%esi
mov    $0x100,%ecx
jmp    1030 <ap_get_single_string_command@plt>

LLVM IR (-O0):
define i32 @ap_get_comment(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @ap_get_single_string_command(i32 %5, i32 52256, i8* %6, i32 256)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ap_get_comment(i32 %0, i8* %1) {
%3 = tail call i32 @ap_get_single_string_command(i32 %0, i32 52256, i8* %1, i32 256)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = (1, 2);
  printf("a : %d\n", a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"a : %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
int main(void) {
  return (!(
      ((((1) > (3)) ? (1) : (3)) == 3) && ((((9) > (7)) ? (9) : (7)) == 9) &&
      ((((0) > (0)) ? (0) : (0)) == 0) && ((((10) > (0)) ? (10) : (0)) == 10) &&
      ((((0) > (10)) ? (0) : (10)) == 10)));
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
extern void print_float(double a) { printf("%f", a); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @print_float(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, ...);
void ChildProcess() {
  int i;
  pid_t pid;
  pid = getpid();
  for (i = 1; i <= 200; i++)
    printf("    This line is from child, value =  %d, pid = %d\n", i, pid);
  printf("    ***Child process id done ***\n");
}


x86 assembly (clang, -O0):
<ChildProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0xc8,-0x4(%rbp)
jg     1168 <ChildProcess+0x48>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <ChildProcess+0x19>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChildProcess>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %eax,%ebx
mov    $0x1,%ebp
lea    0xeb7(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebp
cmp    $0xc9,%ebp
jne    1150 <ChildProcess+0x20>
lea    0xec4(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [52 x i8] c" This line is from child, value = %d, pid = %d\0A\00"
@.str.1 = [34 x i8] c" ***Child process id done ***\0A\00"
define void @ChildProcess() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getpid()
store i32 %3, i32* %2
store i32 1, i32* %1
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 200
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %11
11: ; preds = %7
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %4
14: ; preds = %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c" This line is from child, value = %d, pid = %d\0A\00"
@str = [33 x i8] c" ***Child process id done ***\00"
define void @ChildProcess() {
%1 = tail call i32 (...) @getpid()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %5, %2 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %1)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 201
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void pakman_free(void *b) {
  if (b)
    free(b);
}


x86 assembly (clang, -O0):
<pakman_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <pakman_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pakman_free>:
test   %rdi,%rdi
je     111a <pakman_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @pakman_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1();
int main(void) {
  int i;
  check_vect();
  main1();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 (...) @main1()
ret i32 0
}
/* Type definitions */
struct ttrie__iterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_frames(struct ttrie__iterator *);
int ttrie__close_iter(struct ttrie__iterator *iter) {
  free_frames(iter);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.ttrie__iterator = type { i32 }
define i32 @ttrie__close_iter(%struct.ttrie__iterator* %0) {
%2 = alloca %struct.ttrie__iterator*
store %struct.ttrie__iterator* %0, %struct.ttrie__iterator** %2
%3 = load %struct.ttrie__iterator*, %struct.ttrie__iterator** %2
%4 = call i32 @free_frames(%struct.ttrie__iterator* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.ttrie__iterator = type { i32 }
define i32 @ttrie__close_iter(%struct.ttrie__iterator* %0) {
%2 = tail call i32 @free_frames(%struct.ttrie__iterator* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_pybuild_pretty(void) {
  printf("  ____        _           _ _     _  \n"
         " |  _ \\ _   _| |__  _   _(_) | __| | \n"
         " | |_) | | | | '_ \\| | | | | |/ _` | \n"
         " |  __/| |_| | |_) | |_| | | | (_| | \n"
         " |_|    \\__, |_.__/ \\__,_|_|_|\\__,_| \n"
         "        |___/                        \n");
}


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

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

LLVM IR (-O0):
@.str = [229 x i8] c" ____ _ _ _ _ \0A | _ \\ _ _| |__ _ _(_) | __| | \0A | |_) | | | | '_ \\| | | | | |/ _` | \0A | __/| |_| | |_) | |_| | | | (_| | \0A |_| \\__, |_.__/ \\__,_|_|_|\\__,_| \0A |___/ \0A\00"
define void @print_pybuild_pretty() {
%1 = call i32 @printf(i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [228 x i8] c" ____ _ _ _ _ \0A | _ \\ _ _| |__ _ _(_) | __| | \0A | |_) | | | | '_ \\| | | | | |/ _` | \0A | __/| |_| | |_) | |_| | | | (_| | \0A |_| \\__, |_.__/ \\__,_|_|_|\\__,_| \0A |___/ \00"
define void @print_pybuild_pretty() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([228 x i8], [228 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("\n Hello from - High Performance Scalable Smoothed Particle "
         "Hydrodynamics(HPSSPH)!\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [83 x i8] c"\0A Hello from - High Performance Scalable Smoothed Particle Hydrodynamics(HPSSPH)!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [82 x i8] c"\0A Hello from - High Performance Scalable Smoothed Particle Hydrodynamics(HPSSPH)!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ bar(int /*<<< orphan*/, char, char, char);
char foo(float, char, char);
int main(void) {
  char d;
  d = foo('f', 'o', 'o');
  d += bar(0, 'B', 'a', 'r');
  return d == 'd' ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
mov    $0x6f,%esi
mov    %esi,%edi
call   1040 <foo@plt>
mov    %al,-0x5(%rbp)
xor    %edi,%edi
mov    $0x42,%esi
mov    $0x61,%edx
mov    $0x72,%ecx
call   1030 <bar@plt>
mov    %rax,%rcx
movsbq -0x5(%rbp),%rax
add    %rcx,%rax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x64,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movss  0xed7(%rip),%xmm0
mov    $0x6f,%edi
mov    $0x6f,%esi
call   1040 <foo@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    $0x42,%esi
mov    $0x61,%edx
mov    $0x72,%ecx
call   1030 <bar@plt>
add    %bl,%al
xor    %ecx,%ecx
cmp    $0x64,%al
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 @foo(float 1.020000e+02, i8 signext 111, i8 signext 111)
store i8 %3, i8* %2
%4 = call i64 @bar(i32 0, i8 signext 66, i8 signext 97, i8 signext 114)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i64
%7 = add nsw i64 %6, %4
%8 = trunc i64 %7 to i8
store i8 %8, i8* %2
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 100
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 @foo(float 1.020000e+02, i8 signext 111, i8 signext 111)
%2 = tail call i64 @bar(i32 0, i8 signext 66, i8 signext 97, i8 signext 114)
%3 = trunc i64 %2 to i8
%4 = add i8 %1, %3
%5 = icmp ne i8 %4, 100
%6 = zext i1 %5 to i32
ret i32 %6
}
void init_tree_owl_attackpat(void) {}


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

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

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

LLVM IR (-O2):
define void @init_tree_owl_attackpat() {
ret void
}
/* Variables and functions */
int htonl(int);
int check_endianess() {
  if (htonl(42) == 42)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<check_endianess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2a,%edi
call   1030 <htonl@plt>
cmp    $0x2a,%eax
jne    1137 <check_endianess+0x27>
movl   $0x0,-0x4(%rbp)
jmp    113e <check_endianess+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_endianess>:
push   %rax
mov    $0x2a,%edi
call   1030 <htonl@plt>
xor    %ecx,%ecx
cmp    $0x2a,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @check_endianess() {
%1 = alloca i32
%2 = call i32 @htonl(i32 42)
%3 = icmp eq i32 %2, 42
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @check_endianess() {
%1 = tail call i32 @htonl(i32 42)
%2 = icmp ne i32 %1, 42
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
unsigned long long strtoull(char const *, char **, int);
unsigned long long c_strtoull(const char *nptr, char **endptr, int base) {
  return strtoull(nptr, endptr, base);
}


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

x86 assembly (clang, -O2):
<c_strtoull>:
jmp    1030 <strtoull@plt>

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

LLVM IR (-O2):
define i64 @c_strtoull(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoull(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ cPrintf(char *);
void help03(void) {
  cPrintf("  u                 unassemble 16 instrs starting at PC\n");
  cPrintf("  u  <addr>         unassemble 16 instrs starting at <addr>\n");
  cPrintf("  u  <addr> <cnt>   unassemble <cnt> instrs starting at <addr>\n");
}


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

x86 assembly (clang, -O2):
<help03>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf15(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xf46(%rip),%rdi
pop    %rax
jmp    1030 <cPrintf@plt>

LLVM IR (-O0):
@.str = [57 x i8] c" u unassemble 16 instrs starting at PC\0A\00"
@.str.1 = [61 x i8] c" u <addr> unassemble 16 instrs starting at <addr>\0A\00"
@.str.2 = [64 x i8] c" u <addr> <cnt> unassemble <cnt> instrs starting at <addr>\0A\00"
define void @help03() {
%1 = call i32 @cPrintf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cPrintf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @cPrintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c" u unassemble 16 instrs starting at PC\0A\00"
@.str.1 = [61 x i8] c" u <addr> unassemble 16 instrs starting at <addr>\0A\00"
@.str.2 = [64 x i8] c" u <addr> <cnt> unassemble <cnt> instrs starting at <addr>\0A\00"
define void @help03() {
%1 = tail call i32 @cPrintf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cPrintf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @cPrintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WaitCo(long);
void Seppuku() { (void)WaitCo((123456L)); }


x86 assembly (clang, -O0):
<Seppuku>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e240,%edi
call   1030 <WaitCo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Seppuku>:
mov    $0x1e240,%edi
jmp    1030 <WaitCo@plt>

LLVM IR (-O0):
define void @Seppuku() {
%1 = call i32 @WaitCo(i64 123456)
ret void
}

LLVM IR (-O2):
define void @Seppuku() {
%1 = tail call i32 @WaitCo(i64 123456)
ret void
}
int startup_DESCRIPTION(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @startup_DESCRIPTION() {
ret i32 0
}
/* Variables and functions */
void ds9_mecube(void *p, void *fits, size_t len) {}


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

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

LLVM IR (-O0):
define void @ds9_mecube(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
ret void
}

LLVM IR (-O2):
define void @ds9_mecube(i8* nocapture %0, i8* nocapture %1, i64 %2) {
ret void
}
/* Variables and functions */
int link(char const *, char const *);
int linkfile(const char *src, const char *dest) { return link(src, dest); }


x86 assembly (clang, -O0):
<linkfile>:
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 <link@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linkfile>:
jmp    1030 <link@plt>

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

LLVM IR (-O2):
define i32 @linkfile(i8* %0, i8* %1) {
%3 = tail call i32 @link(i8* %0, i8* %1)
ret i32 %3
}
void Rename_REV_NSEQ(ii, jj) int ii, jj;
{
  int i, j;
  i = ii;
  j = jj;
  while (i < j) {
    Rename_SWP_NSEQ(i, j);
    i = i + 1;
    j = j - 1;
  };
}


x86 assembly (clang, -O0):
<Rename_REV_NSEQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    115a <Rename_REV_NSEQ+0x4a>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1030 <Rename_SWP_NSEQ@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <Rename_REV_NSEQ+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rename_REV_NSEQ>:
push   %rbp
push   %rbx
push   %rax
cmp    %esi,%edi
jge    1135 <Rename_REV_NSEQ+0x25>
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <Rename_SWP_NSEQ@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    %ebx,%ebp
jl     1120 <Rename_REV_NSEQ+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Rename_REV_NSEQ(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %1, %2 ]
%6 = phi i32 [ %8, %4 ], [ %0, %2 ]
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @Rename_SWP_NSEQ to i32 (i32, i32, ...)*)(i32 %6, i32 %5)
%8 = add nsw i32 %6, 1
%9 = add nsw i32 %5, -1
%10 = icmp slt i32 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %2
ret void
}
int RequiredAlignment(void) { return 16; }


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

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

LLVM IR (-O0):
define i32 @RequiredAlignment() {
ret i32 16
}

LLVM IR (-O2):
define i32 @RequiredAlignment() {
ret i32 16
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ kbd_lights(int /*<<< orphan*/);
void sig_handler(int signum) {
  kbd_lights(0);
  cleanup();
  exit(0);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <kbd_lights@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
xor    %edi,%edi
call   1030 <kbd_lights@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @kbd_lights(i32 0)
%4 = call i32 (...) @cleanup()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sig_handler(i32 %0) {
%2 = tail call i32 @kbd_lights(i32 0)
%3 = tail call i32 (...) @cleanup()
%4 = tail call i32 @exit(i32 0)
unreachable
}
int dd_gt(const double *a, double *b) {
  return (a[0] > b[0] || (a[0] == b[0] && a[1] > b[1])) ? 1 : 0;
}


x86 assembly (clang, -O0):
<dd_gt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
ucomisd (%rcx),%xmm0
mov    %al,-0x11(%rbp)
ja     1166 <dd_gt+0x66>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
ucomisd (%rcx),%xmm0
mov    %al,-0x12(%rbp)
jne    1160 <dd_gt+0x60>
jp     1160 <dd_gt+0x60>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd 0x8(%rax),%xmm0
seta   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_gt>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
ja     112a <dd_gt+0x2a>
ucomisd %xmm1,%xmm0
jne    112b <dd_gt+0x2b>
jp     112b <dd_gt+0x2b>
movsd  0x8(%rdi),%xmm0
xor    %eax,%eax
ucomisd 0x8(%rsi),%xmm0
seta   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dd_gt(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fcmp ogt double %7, %10
br i1 %11, label %30, label %12
12: ; preds = %2
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = fcmp oeq double %15, %18
br i1 %19, label %20, label %28
20: ; preds = %12
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 1
%23 = load double, double* %22
%24 = load double*, double** %4
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = fcmp ogt double %23, %26
br label %28
28: ; preds = %20, %12
%29 = phi i1 [ false, %12 ], [ %27, %20 ]
br label %30
30: ; preds = %28, %2
%31 = phi i1 [ true, %2 ], [ %29, %28 ]
%32 = zext i1 %31 to i64
%33 = select i1 %31, i32 1, i32 0
ret i32 %33
}

LLVM IR (-O2):
define i32 @dd_gt(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ogt double %3, %4
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = fcmp oeq double %3, %4
br i1 %7, label %8, label %15
8: ; preds = %6
%9 = getelementptr inbounds double, double* %0, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %1, i64 1
%12 = load double, double* %11
%13 = fcmp ogt double %10, %12
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %6, %8, %2
%16 = phi i32 [ 1, %2 ], [ 0, %6 ], [ %14, %8 ]
ret i32 %16
}
long __fixsfdi(float a) { return (long)((int)a); }


x86 assembly (clang, -O0):
<__fixsfdi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fixsfdi>:
cvttss2si %xmm0,%eax
cltq
ret

LLVM IR (-O0):
define i64 @__fixsfdi(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @__fixsfdi(float %0) {
%2 = fptosi float %0 to i32
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ cs_restart_oscam();
void monitor_restart_server(void) { cs_restart_oscam(); }


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

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

LLVM IR (-O0):
define void @monitor_restart_server() {
%1 = call i32 (...) @cs_restart_oscam()
ret void
}

LLVM IR (-O2):
define void @monitor_restart_server() {
%1 = tail call i32 (...) @cs_restart_oscam()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ menu();
int /*<<< orphan*/ required();
int main(void) {
  required();
  menu();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <required@plt>
mov    $0x0,%al
call   1030 <menu@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @required()
%2 = call i32 (...) @menu()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @required()
%2 = tail call i32 (...) @menu()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int vfork();
void *f(void *arg) {
  int res = vfork();
  if (res == -1) {
    perror("vfork");
    return NULL;
  } else if (res == 0) {
    _exit(0);
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
call   1050 <vfork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1167 <f+0x37>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
movq   $0x0,-0x8(%rbp)
jmp    1180 <f+0x50>
cmpl   $0x0,-0x14(%rbp)
jne    1178 <f+0x48>
xor    %edi,%edi
call   1030 <_exit@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
call   1050 <vfork@plt>
cmp    $0xffffffff,%eax
je     1143 <f+0x13>
test   %eax,%eax
je     1151 <f+0x21>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <perror@plt>
jmp    113f <f+0xf>
xor    %edi,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"vfork\00"
define noalias i8* @f(i8* nocapture readnone %0) {
%2 = call i32 @vfork()
switch i32 %2, label %7 [
i32 -1, label %3
i32 0, label %5
]
3: ; preds = %1
%4 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = call i32 @_exit(i32 0)
unreachable
7: ; preds = %1, %3
ret i8* null
}
/* Variables and functions */
int strlen(char *);
int countCharactersWithSpace(char inputString[]) {
  int characters = (strlen(inputString) - 1);
  return characters;
}


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

x86 assembly (clang, -O2):
<countCharactersWithSpace>:
push   %rax
call   1030 <strlen@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @countCharactersWithSpace(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @countCharactersWithSpace(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
ret i32 %3
}
void uniphier_board_init(void) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<uniphier_board_init>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <uniphier_board_init+0x9>
jmp    110e <uniphier_board_init+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @uniphier_board_init() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @uniphier_board_init() {
ret void
}
int test_imm_38uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x38 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_38uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 240518168576
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ check(int /*<<< orphan*/, char *);
int /*<<< orphan*/ make_cloexec(int);
int /*<<< orphan*/ socketpair(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int *);
void get_socketpair(int sv[]) {
  check(socketpair(AF_UNIX, SOCK_STREAM, 0, sv), "socketpair");
  make_cloexec(sv[0]);
  make_cloexec(sv[1]);
}


x86 assembly (clang, -O0):
<get_socketpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
xor    %edx,%edx
call   1030 <socketpair@plt>
mov    %eax,%edi
lea    0xe9e(%rip),%rsi
call   1040 <check@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1050 <make_cloexec@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1050 <make_cloexec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_socketpair>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
mov    %rbx,%rcx
call   1030 <socketpair@plt>
lea    0xea9(%rip),%rsi
mov    %eax,%edi
call   1040 <check@plt>
mov    (%rbx),%edi
call   1050 <make_cloexec@plt>
mov    0x4(%rbx),%edi
pop    %rbx
jmp    1050 <make_cloexec@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [11 x i8] c"socketpair\00"
define void @get_socketpair(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @AF_UNIX
%4 = load i32, i32* @SOCK_STREAM
%5 = load i32*, i32** %2
%6 = call i32 @socketpair(i32 %3, i32 %4, i32 0, i32* %5)
%7 = call i32 @check(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = call i32 @make_cloexec(i32 %10)
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = call i32 @make_cloexec(i32 %14)
ret void
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [11 x i8] c"socketpair\00"
define void @get_socketpair(i32* %0) {
%2 = load i32, i32* @AF_UNIX
%3 = load i32, i32* @SOCK_STREAM
%4 = tail call i32 @socketpair(i32 %2, i32 %3, i32 0, i32* %0)
%5 = tail call i32 @check(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %0
%7 = tail call i32 @make_cloexec(i32 %6)
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = tail call i32 @make_cloexec(i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ subunit_send_event(char *, char const *const,
                                      char const *const);
void subunit_test_skip(char const *const name, char const *const reason) {
  subunit_send_event("skip", name, reason);
}


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

x86 assembly (clang, -O2):
<subunit_test_skip>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <subunit_send_event@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"skip\00"
define void @subunit_test_skip(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 @subunit_send_event(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"skip\00"
define void @subunit_test_skip(i8* %0, i8* %1) {
%3 = tail call i32 @subunit_send_event(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
double minf(const double a, const double b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<minf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <minf+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <minf+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<minf>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @minf(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @minf(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int recursiveChdir(char *path) {}


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

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

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

LLVM IR (-O2):
define i32 @recursiveChdir(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Ok!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@str = [4 x i8] c"Ok!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_dobldobl_random_coefficient_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(460, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_dobldobl_random_coefficient_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1cc,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_dobldobl_random_coefficient_system>:
mov    $0x1cc,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @celcon_dobldobl_random_coefficient_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 460, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_dobldobl_random_coefficient_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 460, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int mem_get_le24_as_int(unsigned char const *);
signed int mem_get_sle24_as_int(const void *vmem) {
  const unsigned char *mem = (const unsigned char *)vmem;
  signed int val = mem_get_le24_as_int(mem);
  return (val << ((sizeof(int) << 3) - 24)) >> ((sizeof(int) << 3) - 24);
}


x86 assembly (clang, -O0):
<mem_get_sle24_as_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <mem_get_le24_as_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
sar    $0x8,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_get_sle24_as_int>:
push   %rax
call   1030 <mem_get_le24_as_int@plt>
shl    $0x8,%eax
sar    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mem_get_sle24_as_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @mem_get_le24_as_int(i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 8
%10 = ashr i32 %9, 8
ret i32 %10
}

LLVM IR (-O2):
define i32 @mem_get_sle24_as_int(i8* %0) {
%2 = tail call i32 @mem_get_le24_as_int(i8* %0)
%3 = shl i32 %2, 8
%4 = ashr exact i32 %3, 8
ret i32 %4
}
int pow3(int x) { return x * x * x; }


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

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

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

LLVM IR (-O2):
define i32 @pow3(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
ret i32 %3
}
/* Type definitions */
struct passwd {
  int pw_uid;
};

/* Variables and functions */
int posix___Passwd_uid___impl(struct passwd *recv) { return recv->pw_uid; }


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

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

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

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