xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long);
void do_stdio_log_long(void *context, long val) {
  FILE *stdio = context;
  fprintf(stdio, "%ld", val);
}


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

x86 assembly (clang, -O2):
<do_stdio_log_long>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define void @do_stdio_log_long(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i64, i64* %4
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %9)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @do_stdio_log_long(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigint_handler(int sig) {
  printf("\nBye ~\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [8 x i8] c"\0ABye ~\0A\00"
@EXIT_SUCCESS = global i32 0
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [7 x i8] c"\0ABye ~\00"
define void @sigint_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_POT_POWER_INPUT() { clear_io_bit(0x72, 7); }


x86 assembly (clang, -O0):
<TOSH_MAKE_POT_POWER_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x72,%edi
mov    $0x7,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_POT_POWER_INPUT>:
mov    $0x72,%edi
mov    $0x7,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_POT_POWER_INPUT() {
%1 = call i32 @clear_io_bit(i32 114, i32 7)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_POT_POWER_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 114, i32 7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
struct constant_map {
  int dummy;
};

/* Variables and functions */
char *field_debug_ign(u_int8_t *buf, size_t len, struct constant_map **maps) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.constant_map = type { i32 }
define i8* @field_debug_ign(i32* %0, i64 %1, %struct.constant_map** %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca %struct.constant_map**
store i32* %0, i32** %4
store i64 %1, i64* %5
store %struct.constant_map** %2, %struct.constant_map*** %6
ret i8* null
}

LLVM IR (-O2):
%struct.constant_map = type { i32 }
define noalias i8* @field_debug_ign(i32* nocapture readnone %0, i64 %1, %struct.constant_map** nocapture readnone %2) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ _src_iter_eof(char const *, char const *);
int /*<<< orphan*/ _src_iter_step(char const **);
int _src_iter_next(const char **current, const char *end) {
  _src_iter_step(current);
  return !_src_iter_eof(*current, end);
}


x86 assembly (clang, -O0):
<_src_iter_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_src_iter_step@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <_src_iter_eof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_src_iter_next>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <_src_iter_step@plt>
mov    (%rbx),%rdi
mov    %r14,%rsi
call   1040 <_src_iter_eof@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_src_iter_next(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 = call i32 @_src_iter_step(i8** %5)
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = load i8*, i8** %4
%10 = call i32 @_src_iter_eof(i8* %8, i8* %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @_src_iter_next(i8** %0, i8* %1) {
%3 = tail call i32 @_src_iter_step(i8** %0)
%4 = load i8*, i8** %0
%5 = tail call i32 @_src_iter_eof(i8* %4, i8* %1)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int test_imm_E5uint8_mem(unsigned char *val) {
  return ((*val) & (0xE5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E5uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -27
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *lib_malloc(int);
void *allocate(int bytes) { return lib_malloc(bytes); }


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

x86 assembly (clang, -O2):
<allocate>:
jmp    1030 <lib_malloc@plt>

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

LLVM IR (-O2):
define i8* @allocate(i32 %0) {
%2 = tail call i8* @lib_malloc(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int S_IFIFO;
int mknod(char const *, int, int /*<<< orphan*/);
int mkfifo(const char *fn, mode_t mode) {
  return mknod(fn, (mode_t)(mode | S_IFIFO), 0);
}


x86 assembly (clang, -O0):
<mkfifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2eb3(%rip),%rax
or     (%rax),%esi
xor    %edx,%edx
call   1030 <mknod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkfifo>:
mov    0x2ec9(%rip),%rax
or     (%rax),%esi
xor    %edx,%edx
jmp    1030 <mknod@plt>

LLVM IR (-O0):
@S_IFIFO = global i32 0
define i32 @mkfifo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @S_IFIFO
%8 = or i32 %6, %7
%9 = call i32 @mknod(i8* %5, i32 %8, i32 0)
ret i32 %9
}

LLVM IR (-O2):
@S_IFIFO = global i32 0
define i32 @mkfifo(i8* %0, i32 %1) {
%3 = load i32, i32* @S_IFIFO
%4 = or i32 %3, %1
%5 = tail call i32 @mknod(i8* %0, i32 %4, i32 0)
ret i32 %5
}
int n_plus_two(int n) { return n + 2; }


x86 assembly (clang, -O0):
<n_plus_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_plus_two>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @n_plus_two(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *mem_calloc(size_t count, size_t size) { return calloc(count, size); }


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

x86 assembly (clang, -O2):
<mem_calloc>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @mem_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i8* @calloc(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @mem_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
void plat_midi_input_init(void) {}


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

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

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

LLVM IR (-O2):
define void @plat_midi_input_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ comparisonTestdi(float, int);
int /*<<< orphan*/ printf(char *);
void comparisonOpsdi() {
  printf("double op int:\n");
  comparisonTestdi(1.0f, 2);
  comparisonTestdi(1.0f, 1);
  comparisonTestdi(2.0f, 1);
}


x86 assembly (clang, -O0):
<comparisonOpsdi>:
push   %rbp
mov    %rsp,%rbp
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
movss  0xecc(%rip),%xmm0
mov    $0x2,%edi
call   1040 <comparisonTestdi@plt>
movss  0xeba(%rip),%xmm0
mov    $0x1,%edi
call   1040 <comparisonTestdi@plt>
movss  0xea4(%rip),%xmm0
mov    $0x1,%edi
call   1040 <comparisonTestdi@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparisonOpsdi>:
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
movss  0xecb(%rip),%xmm0
mov    $0x2,%edi
call   1040 <comparisonTestdi@plt>
movss  0xeb9(%rip),%xmm0
mov    $0x1,%edi
call   1040 <comparisonTestdi@plt>
movss  0xeab(%rip),%xmm0
mov    $0x1,%edi
pop    %rax
jmp    1040 <comparisonTestdi@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"double op int:\0A\00"
define void @comparisonOpsdi() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @comparisonTestdi(float 1.000000e+00, i32 2)
%3 = call i32 @comparisonTestdi(float 1.000000e+00, i32 1)
%4 = call i32 @comparisonTestdi(float 2.000000e+00, i32 1)
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"double op int:\00"
define void @comparisonOpsdi() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @comparisonTestdi(float 1.000000e+00, i32 2)
%3 = tail call i32 @comparisonTestdi(float 1.000000e+00, i32 1)
%4 = tail call i32 @comparisonTestdi(float 2.000000e+00, i32 1)
ret void
}
unsigned int subtracao(unsigned int x, unsigned int y) { return x - y; }


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

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

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

LLVM IR (-O2):
define i32 @subtracao(i32 %0, i32 %1) {
%3 = sub i32 %0, %1
ret i32 %3
}
void genneg_d() {}


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

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

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

LLVM IR (-O2):
define void @genneg_d() {
ret void
}
int test_imm_E9uint16_mem(unsigned short *val) {
  return ((*val) & (-0xE9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E9uint16_mem>:
movzwl (%rdi),%eax
test   $0xff17,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E9uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -233
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double ibeta(double, double, double);
double pf(double q, double df1, double df2) {
  return (ibeta(q * df1 / (df2 + q * df1), df1 / 2, df2 / 2));
}


x86 assembly (clang, -O0):
<pf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xea7(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  0xe96(%rip),%xmm3
divsd  %xmm3,%xmm2
call   1030 <ibeta@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pf>:
mulsd  %xmm1,%xmm0
movapd %xmm0,%xmm3
addsd  %xmm2,%xmm3
divsd  %xmm3,%xmm0
movsd  0xed8(%rip),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm3,%xmm2
jmp    1030 <ibeta@plt>

LLVM IR (-O0):
define double @pf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fmul double %7, %8
%10 = load double, double* %6
%11 = load double, double* %4
%12 = load double, double* %5
%13 = call double @llvm.fmuladd.f64(double %11, double %12, double %10)
%14 = fdiv double %9, %13
%15 = load double, double* %5
%16 = fdiv double %15, 2.000000e+00
%17 = load double, double* %6
%18 = fdiv double %17, 2.000000e+00
%19 = call double @ibeta(double %14, double %16, double %18)
ret double %19
}

LLVM IR (-O2):
define double @pf(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %2)
%6 = fdiv double %4, %5
%7 = fmul double %1, 5.000000e-01
%8 = fmul double %2, 5.000000e-01
%9 = tail call double @ibeta(double %6, double %7, double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void show_help(void) {
  printf("Usage: %s OPTION\n   or: %s FILE1 FILE2\n\nOptions:\n    -h, "
         "--help\t\tdisplay this help\n    -V, --version\tdisplay version "
         "information\n\nReport bugs to <bulliver@gmail.com>\n",
         "link", "link");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0xf89(%rip),%rdx
mov    %rdx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [167 x i8] c"Usage: %s OPTION\0A or: %s FILE1 FILE2\0A\0AOptions:\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [5 x i8] c"link\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [167 x i8] c"Usage: %s OPTION\0A or: %s FILE1 FILE2\0A\0AOptions:\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [5 x i8] c"link\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float tone_map(float value, float white) {
  return value * (1 + value / (white * white)) / (1 + value);
}


x86 assembly (clang, -O0):
<tone_map>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm2
movss  0xed2(%rip),%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xec2(%rip),%xmm1
addss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tone_map>:
mulss  %xmm1,%xmm1
movaps %xmm0,%xmm2
divss  %xmm1,%xmm2
movss  0xeed(%rip),%xmm1
addss  %xmm1,%xmm2
mulss  %xmm0,%xmm2
addss  %xmm1,%xmm0
divss  %xmm0,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @tone_map(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = fdiv float %6, %9
%11 = fadd float 1.000000e+00, %10
%12 = fmul float %5, %11
%13 = load float, float* %3
%14 = fadd float 1.000000e+00, %13
%15 = fdiv float %12, %14
ret float %15
}

LLVM IR (-O2):
define float @tone_map(float %0, float %1) {
%3 = fmul float %1, %1
%4 = fdiv float %0, %3
%5 = fadd float %4, 1.000000e+00
%6 = fmul float %5, %0
%7 = fadd float %0, 1.000000e+00
%8 = fdiv float %6, %7
ret float %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int strlen(char *);
void fgetln(char *str, int len, FILE *fp) {
  int i;
  fgets(str, len, fp);
  i = strlen(str) - 1;
  if (str[i] == '\n')
    str[i] = '\0';
}


x86 assembly (clang, -O0):
<fgetln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <fgets@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1173 <fgetln+0x53>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetln>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    113f <fgetln+0x1f>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @fgetln(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @fgets(i8* %0, i32 %1, i32* %2)
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %12
11: ; preds = %3
store i8 0, i8* %8
br label %12
12: ; preds = %11, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_X(int, int, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
void tutorial_start(int type) {
  RCT2_CALLPROC_X(0x0066ECC1, type, 0, 0, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<tutorial_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x66ecc1,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <RCT2_CALLPROC_X@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tutorial_start>:
push   %rax
mov    %edi,%esi
mov    $0x66ecc1,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <RCT2_CALLPROC_X@plt>
add    $0x10,%rsp
pop    %rax
ret

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

LLVM IR (-O2):
define void @tutorial_start(i32 %0) {
%2 = tail call i32 @RCT2_CALLPROC_X(i32 6745281, i32 %0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
int payment_simulate_init() { return 0; }


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

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

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

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

/* Variables and functions */
int E0000(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *, float, float, float,
          float, float *, float *, float *, float *);
int geomg1(FILE *wmmdat, float alt, float glat, float glon, float t, float *dec,
           float *mdp, float *ti, float *gv) {
  return (E0000(wmmdat, 1, NULL, alt, glat, glon, t, dec, mdp, ti, gv));
}


x86 assembly (clang, -O0):
<geomg1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    -0x38(%rbp),%rax
mov    $0x1,%esi
xor    %edx,%edx
mov    %rax,(%rsp)
call   1030 <E0000@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geomg1>:
push   %rax
mov    %rcx,%r9
mov    %rdx,%rax
mov    %rsi,%rcx
mov    %r8,(%rsp)
mov    $0x1,%esi
xor    %edx,%edx
mov    %rax,%r8
call   1030 <E0000@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @geomg1(i32* %0, float %1, float %2, float %3, float %4, float* %5, float* %6, float* %7, float* %8) {
%10 = alloca i32*
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float*
%16 = alloca float*
%17 = alloca float*
%18 = alloca float*
store i32* %0, i32** %10
store float %1, float* %11
store float %2, float* %12
store float %3, float* %13
store float %4, float* %14
store float* %5, float** %15
store float* %6, float** %16
store float* %7, float** %17
store float* %8, float** %18
%19 = load i32*, i32** %10
%20 = load float, float* %11
%21 = load float, float* %12
%22 = load float, float* %13
%23 = load float, float* %14
%24 = load float*, float** %15
%25 = load float*, float** %16
%26 = load float*, float** %17
%27 = load float*, float** %18
%28 = call i32 @E0000(i32* %19, i32 1, i32* null, float %20, float %21, float %22, float %23, float* %24, float* %25, float* %26, float* %27)
ret i32 %28
}

LLVM IR (-O2):
define i32 @geomg1(i32* %0, float %1, float %2, float %3, float %4, float* %5, float* %6, float* %7, float* %8) {
%10 = tail call i32 @E0000(i32* %0, i32 1, i32* null, float %1, float %2, float %3, float %4, float* %5, float* %6, float* %7, float* %8)
ret i32 %10
}
/* Variables and functions */
long sqrt(long);
long int isPerfectSquare(long int n) {
  long int s = sqrt(n);
  if (s * s == n) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isPerfectSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sqrt@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1149 <isPerfectSquare+0x39>
movq   $0x1,-0x8(%rbp)
jmp    1151 <isPerfectSquare+0x41>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPerfectSquare>:
push   %rbx
mov    %rdi,%rbx
call   1030 <sqrt@plt>
imul   %rax,%rax
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @isPerfectSquare(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i64 @sqrt(i64 %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = load i64, i64* %4
%9 = mul nsw i64 %7, %8
%10 = load i64, i64* %3
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %1
store i64 1, i64* %2
br label %14
13: ; preds = %1
store i64 0, i64* %2
br label %14
14: ; preds = %13, %12
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @isPerfectSquare(i64 %0) {
%2 = tail call i64 @sqrt(i64 %0)
%3 = mul nsw i64 %2, %2
%4 = icmp eq i64 %3, %0
%5 = zext i1 %4 to i64
ret i64 %5
}
int test_imm_88uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x88 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_88uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 136
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void init_doc() {
  write("ganttproject.gan", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
        NULL);
  write("ganttproject.gan", "<project name=\"Exported GitPro Project\" >\n",
        NULL);
}


x86 assembly (clang, -O0):
<init_doc>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
lea    0xece(%rip),%rdi
lea    0xf00(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_doc>:
push   %rbx
lea    0xee8(%rip),%rbx
lea    0xef2(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <write@plt>
lea    0xf09(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [40 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A\00"
@.str.2 = [43 x i8] c"<project name=\22Exported GitPro Project\22 >\0A\00"
define void @init_doc() {
%1 = call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [40 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A\00"
@.str.2 = [43 x i8] c"<project name=\22Exported GitPro Project\22 >\0A\00"
define void @init_doc() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = tail call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void PrintCaseResult(int resultId) {
  fprintf(stdout, " :%d\n", resultId);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<PrintCaseResult>:
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 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintCaseResult>:
push   %rbx
mov    %edi,%edx
mov    0x2eb6(%rip),%rbx
mov    (%rbx),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c" :%d\0A\00"
define void @PrintCaseResult(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c" :%d\0A\00"
define void @PrintCaseResult(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compareNames(const void *a, const void *b) {
  return strcmp(*((const char **)a), *((const char **)b));
}


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

x86 assembly (clang, -O2):
<compareNames>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compareNames(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
double DBL_MAX;
double hugedbl_(double x) { return DBL_MAX; }


x86 assembly (clang, -O0):
<hugedbl_>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ed0(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hugedbl_>:
mov    0x2ed9(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@DBL_MAX = global double 0.000000e+00
define double @hugedbl_(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* @DBL_MAX
ret double %3
}

LLVM IR (-O2):
@DBL_MAX = global double 0.000000e+00
define double @hugedbl_(double %0) {
%2 = load double, double* @DBL_MAX
ret double %2
}
int min(int a, int b, int c) {
  if (a < b)
    if (a < c)
      return a;
    else
      return c;
  else if (b < c)
    return b;
  else
    return c;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <min+0x3b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1130 <min+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <min+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <min+0x58>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1152 <min+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <min+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp slt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void faad_free(void *b) { free(b); }


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

x86 assembly (clang, -O2):
<faad_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @faad_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
void ext_configuration_read(char **buffer, size_t *buffer_size,
                            bool *needs_deallocation) {}


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

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

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

LLVM IR (-O2):
define void @ext_configuration_read(i8** nocapture %0, i64* nocapture %1, i32* nocapture %2) {
ret void
}
H(e) { s(184, e); }


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

x86 assembly (clang, -O2):
<H>:
mov    %edi,%esi
mov    $0xb8,%edi
xor    %eax,%eax
jmp    1030 <s@plt>

LLVM IR (-O0):
define i32 @H(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @s to i32 (i32, i32, ...)*)(i32 184, i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @H(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @s to i32 (i32, i32, ...)*)(i32 184, i32 %0)
ret i32 undef
}
int test_imm_BEuint16_mem(unsigned short *val) {
  return ((*val) & (0xBE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BEuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 190
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int pathconN_nm4_f0(double const **, double **, int *, double *, int);
int pathconN_nm4(const double **arg, double **res, int *iw, double *w,
                 int mem) {
  return pathconN_nm4_f0(arg, res, iw, w, mem);
}


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

x86 assembly (clang, -O2):
<pathconN_nm4>:
jmp    1030 <pathconN_nm4_f0@plt>

LLVM IR (-O0):
define i32 @pathconN_nm4(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double**, double*** %6
%12 = load double**, double*** %7
%13 = load i32*, i32** %8
%14 = load double*, double** %9
%15 = load i32, i32* %10
%16 = call i32 @pathconN_nm4_f0(double** %11, double** %12, i32* %13, double* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @pathconN_nm4(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @pathconN_nm4_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
double nabs_df(double *p) {
  double d = *p;
  __asm__("# reg %x0" : "+v"(d));
  return -__builtin_fabs(d);
}


x86 assembly (clang, -O0):
<nabs_df>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xed5(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nabs_df>:
movsd  (%rdi),%xmm0
orps   0xef5(%rip),%xmm0
ret

LLVM IR (-O0):
define double @nabs_df(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = load double, double* %4
store double %5, double* %3
%6 = load double, double* %3
%7 = call double asm "# reg ${0:x}", "=v,0,~{dirflag},~{fpsr},~{flags}"(double %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = call double @llvm.fabs.f64(double %8)
%10 = fneg double %9
ret double %10
}

LLVM IR (-O2):
define double @nabs_df(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double asm "# reg ${0:x}", "=v,0,~{dirflag},~{fpsr},~{flags}"(double %2)
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = fneg double %4
ret double %5
}
int main(void) {
  int i = 1;
  int j;
  j = (i = 42, 99, i);
  return j;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
IR0I1(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (*p0) = 33; }


x86 assembly (clang, -O0):
<IR0I1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  0xec3(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0I1>:
movl   $0x42040000,(%rdx)
ret

LLVM IR (-O0):
define i32 @IR0I1(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float*, float** %12
store float 3.300000e+01, float* %16
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @IR0I1(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture readnone %5) {
store float 3.300000e+01, float* %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ smbhash(unsigned char *, unsigned char *, unsigned char *,
                           int);
void E_old_pw_hash(unsigned char *p14, unsigned char *in, unsigned char *out) {
  smbhash(out, in, p14, 1);
  smbhash(out + 8, in + 8, p14 + 7, 1);
}


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

x86 assembly (clang, -O2):
<E_old_pw_hash>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
mov    %r15,%rdx
mov    $0x1,%ecx
call   1030 <smbhash@plt>
add    $0x8,%rbx
add    $0x8,%r14
add    $0x7,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x1,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <smbhash@plt>

LLVM IR (-O0):
define void @E_old_pw_hash(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = call i32 @smbhash(i8* %7, i8* %8, i8* %9, i32 1)
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 8
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 7
%17 = call i32 @smbhash(i8* %12, i8* %14, i8* %16, i32 1)
ret void
}

LLVM IR (-O2):
define void @E_old_pw_hash(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @smbhash(i8* %2, i8* %1, i8* %0, i32 1)
%5 = getelementptr inbounds i8, i8* %2, i64 8
%6 = getelementptr inbounds i8, i8* %1, i64 8
%7 = getelementptr inbounds i8, i8* %0, i64 7
%8 = tail call i32 @smbhash(i8* %5, i8* %6, i8* %7, i32 1)
ret void
}
int test_imm_66int16_reg(short val) {
  return ((val) & (-0x66 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_66int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff9a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_66int16_reg>:
test   $0xff9a,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_66int16_reg(i16 signext %0) {
%2 = and i16 %0, -102
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ name();
int /*<<< orphan*/ school();
main() {
  school();
  name();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @school()
%2 = tail call i32 (...) @name()
ret i32 0
}
void Chomp(char *str) {
  char *p = str;
  while (*p) {
    if (*p == '\n') {
      *p = '\0';
      break;
    }
    p++;
  }
}


x86 assembly (clang, -O0):
<Chomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <Chomp+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1139 <Chomp+0x39>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    114a <Chomp+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <Chomp+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Chomp>:
movzbl (%rdi),%eax
test   %al,%al
je     1114 <Chomp+0x14>
cmp    $0xa,%al
je     1111 <Chomp+0x11>
add    $0x1,%rdi
jmp    1100 <Chomp>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @Chomp(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
]
5: ; preds = %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
ret void
}