xunge/DecIR huggingface dataset:
/* Variables and functions */
long double log1p(double);
__attribute__((weak)) long double log1pl(long double x) {
  return log1p((double)x);
}


x86 assembly (clang, -O0):
<log1pl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <log1p@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log1pl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <log1p@plt>

LLVM IR (-O0):
define weak x86_fp80 @log1pl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @log1p(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @log1pl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @log1p(double %2)
ret x86_fp80 %3
}
void view_foo_and_bar(void *f, void *b) {}


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

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

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

LLVM IR (-O2):
define void @view_foo_and_bar(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toggle_light(int);
void toggle_caps_lock_light(void) { toggle_light(0x2); }


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

x86 assembly (clang, -O2):
<toggle_caps_lock_light>:
mov    $0x2,%edi
jmp    1030 <toggle_light@plt>

LLVM IR (-O0):
define void @toggle_caps_lock_light() {
%1 = call i32 @toggle_light(i32 2)
ret void
}

LLVM IR (-O2):
define void @toggle_caps_lock_light() {
%1 = tail call i32 @toggle_light(i32 2)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint64_t makeUINT64(uint32_t upper, uint32_t lower) {
  return ((uint64_t)upper) << 32 | ((uint64_t)lower);
}


x86 assembly (clang, -O0):
<makeUINT64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x20,%ecx
shl    %cl,%eax
mov    -0x10(%rbp),%rcx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @makeUINT64(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 = trunc i64 %5 to i32
%7 = shl i32 %6, 32
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = or i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @makeUINT64(i64 %0, i64 %1) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("asd");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"asd\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int dbg_is_chk_lprops(const struct ubifs_info *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define i32 @dbg_is_chk_lprops(%struct.ubifs_info* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *);
void usage(char *prog_name) {
  fatal("Usage: %s output_directory cache_size pid component_tag < file.sec",
        prog_name);
}


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 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [67 x i8] c"Usage: %s output_directory cache_size pid component_tag < file.sec\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fatal(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [67 x i8] c"Usage: %s output_directory cache_size pid component_tag < file.sec\00"
define void @usage(i8* %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Greetings");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Greetings\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ compare_uint64_t(int, int);
int8_t compare_variantkey_chrom_pos(uint64_t vka, uint64_t vkb) {
  return compare_uint64_t((vka >> 31), (vkb >> 31));
}


x86 assembly (clang, -O0):
<compare_variantkey_chrom_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x1f,%edi
mov    -0x8(%rbp),%esi
sar    $0x1f,%esi
call   1030 <compare_uint64_t@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_variantkey_chrom_pos>:
sar    $0x1f,%edi
sar    $0x1f,%esi
jmp    1030 <compare_uint64_t@plt>

LLVM IR (-O0):
define i32 @compare_variantkey_chrom_pos(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 = ashr i32 %5, 31
%7 = load i32, i32* %4
%8 = ashr i32 %7, 31
%9 = call i32 @compare_uint64_t(i32 %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @compare_variantkey_chrom_pos(i32 %0, i32 %1) {
%3 = ashr i32 %0, 31
%4 = ashr i32 %1, 31
%5 = tail call i32 @compare_uint64_t(i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
double randlc_(double *, double *);
double randlc(double *x, double *a) { return randlc_(x, a); }


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

x86 assembly (clang, -O2):
<randlc>:
jmp    1030 <randlc_@plt>

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

LLVM IR (-O2):
define double @randlc(double* %0, double* %1) {
%3 = tail call double @randlc_(double* %0, double* %1)
ret double %3
}
/* Variables and functions */
int gprc_get_sensors(int, int);
int gprcm_get_sensors(int ADF_module, int sensors) {
  return gprc_get_sensors(ADF_module, sensors);
}


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

x86 assembly (clang, -O2):
<gprcm_get_sensors>:
jmp    1030 <gprc_get_sensors@plt>

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

LLVM IR (-O2):
define i32 @gprcm_get_sensors(i32 %0, i32 %1) {
%3 = tail call i32 @gprc_get_sensors(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ delay_until();
int /*<<< orphan*/ set_compare(unsigned int);
void delay_until_periodic(unsigned int *time, unsigned int period) {
  *time += period;
  set_compare(*time);
  delay_until();
}


x86 assembly (clang, -O0):
<delay_until_periodic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <set_compare@plt>
mov    $0x0,%al
call   1030 <delay_until@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_until_periodic>:
push   %rax
add    (%rdi),%esi
mov    %esi,(%rdi)
mov    %esi,%edi
call   1040 <set_compare@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <delay_until@plt>

LLVM IR (-O0):
define void @delay_until_periodic(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = add i32 %7, %5
store i32 %8, i32* %6
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 @set_compare(i32 %10)
%12 = call i32 (...) @delay_until()
ret void
}

LLVM IR (-O2):
define void @delay_until_periodic(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, %1
store i32 %4, i32* %0
%5 = tail call i32 @set_compare(i32 %4)
%6 = tail call i32 (...) @delay_until()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ exit_program(int);
int /*<<< orphan*/ sm_log(int /*<<< orphan*/, char *, int);
void signal_handler(int sig) {
  sm_log(LOG_DEBUG, "got signal %d, closing...\n", sig);
  exit_program(sig);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <sm_log@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit_program@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
mov    %ebx,%edx
call   1030 <sm_log@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <exit_program@plt>

LLVM IR (-O0):
@LOG_DEBUG = global i32 0
@.str = [27 x i8] c"got signal %d, closing...\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_DEBUG
%4 = load i32, i32* %2
%5 = call i32 @sm_log(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @exit_program(i32 %6)
ret void
}

LLVM IR (-O2):
@LOG_DEBUG = global i32 0
@.str = [27 x i8] c"got signal %d, closing...\0A\00"
define void @signal_handler(i32 %0) {
%2 = load i32, i32* @LOG_DEBUG
%3 = tail call i32 @sm_log(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit_program(i32 %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y_root;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
int get_XButtonEvent_y_root(void *_p) {
  return (int)((XButtonEvent *)_p)->y_root;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XButtonEvent_y_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XButtonEvent_y_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ func_type_specifier();
void func_declaration() { func_type_specifier(); }


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

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

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

LLVM IR (-O2):
define void @func_declaration() {
%1 = tail call i32 (...) @func_type_specifier()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, int);
void write_u16_to_buffer(uint16_t h_u16, char *write) {
  uint16_t n_u16 = htons(h_u16);
  memcpy(write, &n_u16, sizeof(uint16_t));
}


x86 assembly (clang, -O0):
<write_u16_to_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_u16_to_buffer>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @write_u16_to_buffer(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htons(i32 %0)
store i32 %5, i32* %3
%6 = call i32 @memcpy(i8* %1, i32* %3, i32 4)
ret void
}
/* Variables and functions */
double floor(double);
double rint(double x) { return floor(x + 0.5); }


x86 assembly (clang, -O0):
<rint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rint>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @rint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call double @llvm.floor.f64(double %4)
ret double %5
}

LLVM IR (-O2):
define double @rint(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void fini(void) { write(STDOUT_FILENO, "fini\n", 5); }


x86 assembly (clang, -O0):
<fini>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x5,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [6 x i8] c"fini\0A\00"
define void @fini() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [6 x i8] c"fini\0A\00"
define void @fini() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++) {
    printf("%d: %s\n", i, argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
int compare_char(const void *a, const void *b) {
  return *(char *)a - *(char *)b;
}


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

x86 assembly (clang, -O2):
<compare_char>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_char(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t bitfn_swap64(uint64_t a) {
  asm("bswap %0" : "=r"(a) : "0"(a));
  return a;
}


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

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

LLVM IR (-O0):
define i8* @bitfn_swap64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @bitfn_swap64(i8* readnone %0) {
%2 = tail call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ get_line_equation_test();
int /*<<< orphan*/ point_line_cmp_test();
int /*<<< orphan*/ printf(char *);
int main(void) {
  point_line_cmp_test();
  get_line_equation_test();
  printf("All geometry tests passed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <point_line_cmp_test@plt>
mov    $0x0,%al
call   1050 <get_line_equation_test@plt>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"All geometry tests passed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @point_line_cmp_test()
%3 = call i32 (...) @get_line_equation_test()
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"All geometry tests passed\00"
define i32 @main() {
%1 = tail call i32 (...) @point_line_cmp_test()
%2 = tail call i32 (...) @get_line_equation_test()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
void Pthread_mutex_unlock(pthread_mutex_t *mutex) {
  int retval;
  assert(mutex != NULL);
  retval = pthread_mutex_unlock(mutex);
  if (retval != 0)
    Sys_failure("pthread_mutex_unlock");
}


x86 assembly (clang, -O0):
<Pthread_mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1170 <Pthread_mutex_unlock+0x40>
lea    0xe95(%rip),%rdi
call   1050 <Sys_failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pthread_mutex_unlock>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <pthread_mutex_unlock@plt>
test   %eax,%eax
je     115b <Pthread_mutex_unlock+0x2b>
lea    0xeab(%rip),%rdi
pop    %rbx
jmp    1050 <Sys_failure@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"pthread_mutex_unlock\00"
define void @Pthread_mutex_unlock(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @pthread_mutex_unlock(i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __setresuid(uid_t ruid, uid_t euid, uid_t suid) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__setresuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setresuid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__setresuid(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__setresuid(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
double coq_fsub(double x, double y) { return x - y; }


x86 assembly (clang, -O0):
<coq_fsub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<coq_fsub>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @coq_fsub(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 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @coq_fsub(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ g5_open();
void(g5_open_)() { g5_open(); }


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

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

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

LLVM IR (-O2):
define void @g5_open_() {
%1 = tail call i32 (...) @g5_open()
ret void
}
unsigned short bit16conversion(unsigned short num) {
  return (num >> 8) | (num << 8);
}


x86 assembly (clang, -O0):
<bit16conversion>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit16conversion>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @bit16conversion(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @bit16conversion(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
int countbits(unsigned int bitmap) {
  int count;
  for (count = 0; bitmap; bitmap >>= 1)
    count += bitmap & 1;
  return count;
}


x86 assembly (clang, -O0):
<countbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <countbits+0x32>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <countbits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countbits>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <countbits+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <countbits+0x10>
ret

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

LLVM IR (-O2):
define i32 @countbits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printspaces(int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<printspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <printspaces+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printspaces+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printspaces>:
push   %rbx
test   %edi,%edi
jle    112f <printspaces+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printspaces+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printspaces(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool pes_has_pts(const uint8_t *p_pes) { return !!(p_pes[7] & 0x80); }


x86 assembly (clang, -O0):
<pes_has_pts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pes_has_pts>:
mov    0x1c(%rdi),%eax
shr    $0x7,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @pes_has_pts(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @pes_has_pts(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = lshr i32 %3, 7
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
scalar_t__ strlen(char const *);
int fp_isabs(const char *path) {
  if (strlen(path) == 0 || path[0] != '/') {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<fp_isabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     113f <fp_isabs+0x2f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     114b <fp_isabs+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1152 <fp_isabs+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_isabs>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @fp_isabs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_get_linear_product_solution(int n, int i, int *m, double *sol) {
  int fail, a[2];
  a[0] = n, a[1] = i;
  fail = _ada_use_c2phc(144, a, m, sol);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_get_linear_product_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    -0x24(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x90,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_get_linear_product_solution>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x90,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_get_linear_product_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32
%10 = alloca [2 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double* %3, double** %8
%11 = load i32, i32* %5
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %6
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%16 = load i32*, i32** %7
%17 = load double*, double** %8
%18 = call i32 @_ada_use_c2phc(i32 144, i32* %15, i32* %16, double* %17)
store i32 %18, i32* %9
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
define i32 @solcon_get_linear_product_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca [2 x i32]
%6 = bitcast [2 x i32]* %5 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %0, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %1, i32* %8
%9 = call i32 @_ada_use_c2phc(i32 144, i32* %7, i32* %2, double* %3)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void tick(void) { glutPostRedisplay(); }


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

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

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

LLVM IR (-O2):
define void @tick() {
%1 = tail call i32 (...) @glutPostRedisplay()
ret void
}
void mpp_send_int(const int *data, int size, int to_pe) {}


x86 assembly (clang, -O0):
<mpp_send_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mpp_send_int(i32* nocapture %0, i32 %1, i32 %2) {
ret void
}
int min_int(int a, int b) {
  if (a >= b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<min_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1121 <min_int+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min_int+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_int>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @min_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int fstatat(int, char const *, struct stat *, int);
int __fxstatat(int ver, int fd, const char *path, struct stat *buf, int flag) {
  return fstatat(fd, path, buf, flag);
}


x86 assembly (clang, -O0):
<__fxstatat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <fstatat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fxstatat>:
mov    %esi,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8d,%ecx
jmp    1030 <fstatat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @__fxstatat(i32 %0, i32 %1, i8* %2, %struct.stat* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca %struct.stat*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store %struct.stat* %3, %struct.stat** %9
store i32 %4, i32* %10
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = load %struct.stat*, %struct.stat** %9
%14 = load i32, i32* %10
%15 = call i32 @fstatat(i32 %11, i8* %12, %struct.stat* %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @__fxstatat(i32 %0, i32 %1, i8* %2, %struct.stat* %3, i32 %4) {
%6 = tail call i32 @fstatat(i32 %1, i8* %2, %struct.stat* %3, i32 %4)
ret i32 %6
}
int main(void) { *(char *)10; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = load i8, i8* inttoptr (i64 10 to i8*)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/ *);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ log_error(int, char *);
int pthread_cond_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void conditionInit(pthread_cond_t *cond, pthread_condattr_t *attrs) {
  ASSERT(cond);
  int r = pthread_cond_init(cond, attrs);
  if (r != 0) {
    log_error(r, "Error pthread_cond_init()");
    abort();
  }
}


x86 assembly (clang, -O0):
<conditionInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <ASSERT@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <pthread_cond_init@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1189 <conditionInit+0x49>
mov    -0x14(%rbp),%edi
lea    0xe83(%rip),%rsi
call   1040 <log_error@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conditionInit>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1060 <ASSERT@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <pthread_cond_init@plt>
test   %eax,%eax
jne    1166 <conditionInit+0x26>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe93(%rip),%rsi
mov    %eax,%edi
call   1040 <log_error@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Error pthread_cond_init()\00"
define void @conditionInit(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = call i32 @ASSERT(i32* %6)
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @pthread_cond_init(i32* %8, i32* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32, i32* %5
%15 = call i32 @log_error(i32 %14, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Error pthread_cond_init()\00"
define void @conditionInit(i32* %0, i32* %1) {
%3 = tail call i32 @ASSERT(i32* %0)
%4 = tail call i32 @pthread_cond_init(i32* %0, i32* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @log_error(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
double DistancePolar(double const, double const, double const);
double const sin(double const);
double InvDistanceD1dphi(const double r0, const double r1, const double dphi) {
  double d = DistancePolar(r0, r1, dphi);
  return -r0 * r1 * sin(dphi) / (d * d * d);
}


x86 assembly (clang, -O0):
<InvDistanceD1dphi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <DistancePolar@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InvDistanceD1dphi>:
sub    $0x28,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1040 <DistancePolar@plt>
movsd  %xmm0,0x20(%rsp)
movapd (%rsp),%xmm0
xorpd  0xeb4(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
movapd %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
movsd  0x20(%rsp),%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @InvDistanceD1dphi(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call double @DistancePolar(double %8, double %9, double %10)
store double %11, double* %7
%12 = load double, double* %4
%13 = fneg double %12
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = load double, double* %6
%17 = call double @sin(double %16)
%18 = fmul double %15, %17
%19 = load double, double* %7
%20 = load double, double* %7
%21 = fmul double %19, %20
%22 = load double, double* %7
%23 = fmul double %21, %22
%24 = fdiv double %18, %23
ret double %24
}

LLVM IR (-O2):
define double @InvDistanceD1dphi(double %0, double %1, double %2) {
%4 = tail call double @DistancePolar(double %0, double %1, double %2)
%5 = fneg double %0
%6 = fmul double %5, %1
%7 = tail call double @sin(double %2)
%8 = fmul double %6, %7
%9 = fmul double %4, %4
%10 = fmul double %4, %9
%11 = fdiv double %8, %10
ret double %11
}
/* Type definitions */
struct fd_info {
  int dummy;
};

/* Variables and functions */
int AF_INET;
int AF_INET6;
int real_socket(int, int, int);
int tncc_socket(struct fd_info *info, int domain, int type, int protocol) {
  if (domain != AF_INET && domain != AF_INET6)
    return -5555;
  do {
  } while (0);
  return real_socket(domain, type, protocol);
}


x86 assembly (clang, -O0):
<tncc_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <tncc_socket+0x45>
mov    -0x14(%rbp),%eax
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <tncc_socket+0x45>
movl   $0xffffea4d,-0x4(%rbp)
jmp    1170 <tncc_socket+0x60>
jmp    115a <tncc_socket+0x4a>
jmp    115f <tncc_socket+0x4f>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <real_socket@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tncc_socket>:
mov    0x2ed1(%rip),%rax
cmp    %esi,(%rax)
je     112c <tncc_socket+0x1c>
mov    0x2ebe(%rip),%rax
cmp    %esi,(%rax)
je     112c <tncc_socket+0x1c>
mov    $0xffffea4d,%eax
ret
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
jmp    1030 <real_socket@plt>

LLVM IR (-O0):
%struct.fd_info = type { i32 }
@AF_INET = global i32 0
@AF_INET6 = global i32 0
define i32 @tncc_socket(%struct.fd_info* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.fd_info*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.fd_info* %0, %struct.fd_info** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %7
%11 = load i32, i32* @AF_INET
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %4
%14 = load i32, i32* %7
%15 = load i32, i32* @AF_INET6
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 -5555, i32* %5
br label %25
18: ; preds = %13, %4
br label %19
19: ; preds = %18
br label %20
20: ; preds = %19
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = load i32, i32* %9
%24 = call i32 @real_socket(i32 %21, i32 %22, i32 %23)
store i32 %24, i32* %5
br label %25
25: ; preds = %20, %17
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
%struct.fd_info = type { i32 }
@AF_INET = global i32 0
@AF_INET6 = global i32 0
define i32 @tncc_socket(%struct.fd_info* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @AF_INET
%6 = icmp eq i32 %5, %1
%7 = load i32, i32* @AF_INET6
%8 = icmp eq i32 %7, %1
%9 = select i1 %6, i1 true, i1 %8
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = tail call i32 @real_socket(i32 %1, i32 %2, i32 %3)
br label %12
12: ; preds = %4, %10
%13 = phi i32 [ %11, %10 ], [ -5555, %4 ]
ret i32 %13
}