xunge/DecIR huggingface dataset:
double integer(x)
double x;
{ return (double)(long)x; }


x86 assembly (clang, -O0):
<integer>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<integer>:
cvttsd2si %xmm0,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @integer(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i64
%5 = sitofp i64 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @integer(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
ret double %3
}
int test_imm_01uint16_reg(unsigned short val) {
  return ((val) & (0x01 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_01uint16_reg>:
test   $0x1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_01uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 1
%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_01uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 1
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__attribute__((always_)) void file_take_write(struct file *filp) {}


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define void @file_take_write(%struct.file* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpioSet(int, int /*<<< orphan*/);
int /*<<< orphan*/ output(int, char *);
void shutdownChip() {
  output(1, "Setting all low ... ");
  gpioSet(81, 0);
  gpioSet(3, 0);
  gpioSet(53, 0);
  gpioSet(71, 0);
  gpioSet(124, 0);
  gpioSet(114, 0);
}


x86 assembly (clang, -O0):
<shutdownChip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xed0(%rip),%rsi
call   1030 <output@plt>
mov    $0x51,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x35,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x47,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x7c,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x72,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shutdownChip>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
call   1030 <output@plt>
mov    $0x51,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x35,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x47,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x7c,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x72,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <gpioSet@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Setting all low ... \00"
define void @shutdownChip() {
%1 = call i32 @output(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gpioSet(i32 81, i32 0)
%3 = call i32 @gpioSet(i32 3, i32 0)
%4 = call i32 @gpioSet(i32 53, i32 0)
%5 = call i32 @gpioSet(i32 71, i32 0)
%6 = call i32 @gpioSet(i32 124, i32 0)
%7 = call i32 @gpioSet(i32 114, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Setting all low ... \00"
define void @shutdownChip() {
%1 = tail call i32 @output(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gpioSet(i32 81, i32 0)
%3 = tail call i32 @gpioSet(i32 3, i32 0)
%4 = tail call i32 @gpioSet(i32 53, i32 0)
%5 = tail call i32 @gpioSet(i32 71, i32 0)
%6 = tail call i32 @gpioSet(i32 124, i32 0)
%7 = tail call i32 @gpioSet(i32 114, i32 0)
ret void
}
/* Variables and functions */
double fabs(double);
int fuscmp(double val, double thrshd) {
  int temp;
  if (fabs(val) <= thrshd)
    temp = 0;
  else
    temp = 1;
  return temp;
}


x86 assembly (clang, -O0):
<fuscmp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movaps 0xee6(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1139 <fuscmp+0x39>
movl   $0x0,-0x14(%rbp)
jmp    1140 <fuscmp+0x40>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuscmp>:
andpd  0xef8(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setb   %al
ret

LLVM IR (-O0):
define i32 @fuscmp(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = call double @llvm.fabs.f64(double %6)
%8 = load double, double* %4
%9 = fcmp ole double %7, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %5
br label %12
11: ; preds = %2
store i32 1, i32* %5
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @fuscmp(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %0)
%4 = fcmp ugt double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
unsigned int xstrtoull_sfx(char const *, int, struct suffix_mult const *);
unsigned int xstrtou_sfx(const char *str, int b,
                         const struct suffix_mult *sfx) {
  return xstrtoull_sfx(str, b, sfx);
}


x86 assembly (clang, -O0):
<xstrtou_sfx>:
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   1030 <xstrtoull_sfx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrtou_sfx>:
jmp    1030 <xstrtoull_sfx@plt>

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

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i32 @xstrtou_sfx(i8* %0, i32 %1, %struct.suffix_mult* %2) {
%4 = tail call i32 @xstrtoull_sfx(i8* %0, i32 %1, %struct.suffix_mult* %2)
ret i32 %4
}
/* Variables and functions */
int M_PI;
float sin(float);
float pure_sine(float freq, float amp, float t) {
  float theta = 2 * M_PI * freq * t;
  return amp * sin(theta);
}


x86 assembly (clang, -O0):
<pure_sine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pure_sine>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2ss %eax,%xmm3
movss  %xmm1,0x4(%rsp)
mulss  %xmm3,%xmm0
mulss  %xmm2,%xmm0
call   1030 <sin@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @pure_sine(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load i32, i32* @M_PI
%9 = mul nsw i32 2, %8
%10 = sitofp i32 %9 to float
%11 = load float, float* %4
%12 = fmul float %10, %11
%13 = load float, float* %6
%14 = fmul float %12, %13
store float %14, float* %7
%15 = load float, float* %5
%16 = load float, float* %7
%17 = call float @sin(float %16)
%18 = fmul float %15, %17
ret float %18
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @pure_sine(float %0, float %1, float %2) {
%4 = load i32, i32* @M_PI
%5 = shl nsw i32 %4, 1
%6 = sitofp i32 %5 to float
%7 = fmul float %6, %0
%8 = fmul float %7, %2
%9 = tail call float @sin(float %8)
%10 = fmul float %9, %1
ret float %10
}
/* Variables and functions */
bool nrf53_errata_42(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_42() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TransformAlarmC__0__AlarmFrom__fired();
void Msp430AlarmC__0__Alarm__fired(void) {
  TransformAlarmC__0__AlarmFrom__fired();
}


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

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

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

LLVM IR (-O2):
define void @Msp430AlarmC__0__Alarm__fired() {
%1 = tail call i32 (...) @TransformAlarmC__0__AlarmFrom__fired()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t lfs2_aligndown(uint32_t a, uint32_t alignment) {
  return a - (a % alignment);
}


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

x86 assembly (clang, -O2):
<lfs2_aligndown>:
mov    %edi,%eax
cltd
idiv   %esi
sub    %edx,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @lfs2_aligndown(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* %3
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
%9 = sub nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @lfs2_aligndown(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = sub nsw i32 %0, %3
ret i32 %4
}
unsigned long htab_int_hash(const void *buf) {
  const unsigned int *v = buf;
  return *v;
}


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

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

LLVM IR (-O0):
define i64 @htab_int_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = zext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @htab_int_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
ret i64 %4
}
int intel_msic_check_battery_status(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @intel_msic_check_battery_status() {
ret i32 0
}
call0d(l, c, s, i) long l;
char c;
short s;
int i;
{
  l = 7;
  c = 'z';
  s = 8;
  i = 9;
}


x86 assembly (clang, -O0):
<call0d>:
push   %rbp
mov    %rsp,%rbp
mov    %edx,%eax
mov    %sil,%dl
mov    %rdi,-0x10(%rbp)
mov    %dl,-0x11(%rbp)
mov    %ax,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movq   $0x7,-0x10(%rbp)
movb   $0x7a,-0x11(%rbp)
movw   $0x8,-0x14(%rbp)
movl   $0x9,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call0d(i64 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i8
%8 = alloca i16
%9 = alloca i32
%10 = trunc i32 %1 to i8
%11 = trunc i32 %2 to i16
store i64 %0, i64* %6
store i8 %10, i8* %7
store i16 %11, i16* %8
store i32 %3, i32* %9
store i64 7, i64* %6
store i8 122, i8* %7
store i16 8, i16* %8
store i32 9, i32* %9
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @call0d(i64 %0, i32 %1, i32 %2, i32 %3) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free_devices();
int /*<<< orphan*/ free_memory();
void free_vm() {
  free_memory();
  free_devices();
}


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

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

LLVM IR (-O0):
define void @free_vm() {
%1 = call i32 (...) @free_memory()
%2 = call i32 (...) @free_devices()
ret void
}

LLVM IR (-O2):
define void @free_vm() {
%1 = tail call i32 (...) @free_memory()
%2 = tail call i32 (...) @free_devices()
ret void
}
/* Variables and functions */
char *lp_internal_sconfig(int /*<<< orphan*/, char const *);
char *lp_sconfig(const char *name) { return lp_internal_sconfig(0, name); }


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

x86 assembly (clang, -O2):
<lp_sconfig>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <lp_internal_sconfig@plt>

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

LLVM IR (-O2):
define i8* @lp_sconfig(i8* %0) {
%2 = tail call i8* @lp_internal_sconfig(i32 0, i8* %0)
ret i8* %2
}
void *rt_texture_copy_standard(void *sc, void *oldtex) {
  struct anon$25 *newtex;
  newtex = new_standard_texture();
  memcpy((void *)newtex, oldtex, 232ul);
  return (void *)newtex;
}


x86 assembly (clang, -O0):
<rt_texture_copy_standard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <new_standard_texture@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xe8,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_texture_copy_standard>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <new_standard_texture@plt>
movslq %eax,%rdi
mov    $0xe8,%edx
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
%"struct.anon$25" = type opaque
define i8* @rt_texture_copy_standard(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %"struct.anon$25"*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i32 (...) @new_standard_texture()
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %"struct.anon$25"*
store %"struct.anon$25"* %8, %"struct.anon$25"** %5
%9 = load %"struct.anon$25"*, %"struct.anon$25"** %5
%10 = bitcast %"struct.anon$25"* %9 to i8*
%11 = load i8*, i8** %4
%12 = load %"struct.anon$25"*, %"struct.anon$25"** %5
%13 = bitcast %"struct.anon$25"* %12 to i8*
ret i8* %13
}

LLVM IR (-O2):
define i8* @rt_texture_copy_standard(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 (...) @new_standard_texture()
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(232) %5, i8* align 1 dereferenceable(232) %1, i64 232, i1 false)
ret i8* %5
}
/* Type definitions */
struct RNAdistance_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct RNAdistance_args_info *);
int /*<<< orphan*/ clear_given(struct RNAdistance_args_info *);
int /*<<< orphan*/ init_args_info(struct RNAdistance_args_info *);
void RNAdistance_cmdline_parser_init(struct RNAdistance_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<RNAdistance_cmdline_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAdistance_cmdline_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.RNAdistance_args_info = type { i32 }
define void @RNAdistance_cmdline_parser_init(%struct.RNAdistance_args_info* %0) {
%2 = alloca %struct.RNAdistance_args_info*
store %struct.RNAdistance_args_info* %0, %struct.RNAdistance_args_info** %2
%3 = load %struct.RNAdistance_args_info*, %struct.RNAdistance_args_info** %2
%4 = call i32 @clear_given(%struct.RNAdistance_args_info* %3)
%5 = load %struct.RNAdistance_args_info*, %struct.RNAdistance_args_info** %2
%6 = call i32 @clear_args(%struct.RNAdistance_args_info* %5)
%7 = load %struct.RNAdistance_args_info*, %struct.RNAdistance_args_info** %2
%8 = call i32 @init_args_info(%struct.RNAdistance_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.RNAdistance_args_info = type { i32 }
define void @RNAdistance_cmdline_parser_init(%struct.RNAdistance_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.RNAdistance_args_info* %0)
%3 = tail call i32 @clear_args(%struct.RNAdistance_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.RNAdistance_args_info* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void output_sum(int sum) { printf("%i\n", sum); }


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

x86 assembly (clang, -O2):
<output_sum>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define void @output_sum(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int twist_f_on_cornerperm(cperm)
int cperm;
{
  int temp_arr[8];
  cornerperm_unpack(cperm, temp_arr);
  four_cycle(temp_arr, 5, 4, 0, 3);
  return cornerperm_pack(temp_arr);
}


x86 assembly (clang, -O0):
<twist_f_on_cornerperm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <cornerperm_unpack@plt>
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
mov    $0x0,%al
call   1030 <four_cycle@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1050 <cornerperm_pack@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twist_f_on_cornerperm>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <cornerperm_unpack@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
xor    %eax,%eax
call   1030 <four_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <cornerperm_pack@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @twist_f_on_cornerperm(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @cornerperm_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 5, i32 4, i32 0, i32 3)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @cornerperm_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @twist_f_on_cornerperm(i32 %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @cornerperm_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 5, i32 4, i32 0, i32 3)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @cornerperm_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
void hugo_strcpy(char *dest, const char *source) {
  size_t sourceLen = strlen(source);
  memcpy(dest, source, sourceLen);
  *(dest + sourceLen) = '\0';
}


x86 assembly (clang, -O0):
<hugo_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hugo_strcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%r14,%rbx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @hugo_strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i64, i64* %5
%11 = call i32 @memcpy(i8* %8, i8* %9, i64 %10)
%12 = load i8*, i8** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8 0, i8* %14
ret void
}

LLVM IR (-O2):
define void @hugo_strcpy(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %3)
%5 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %5
ret void
}
/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ scanf(char *, char *);
float scan2float() {
  char sss[200];
  float xx = 0;
  scanf("%s", sss);
  xx = atof(sss);
  return (xx);
}


x86 assembly (clang, -O0):
<scan2float>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0xd4(%rbp)
ff
lea    -0xd0(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0xd4(%rbp)
ff
movss  -0xd4(%rbp),%xmm0
ff
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan2float>:
push   %rbx
sub    $0xd0,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define float @scan2float() {
%1 = alloca [200 x i8]
%2 = alloca float
store float 0.000000e+00, float* %2
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%6 = call float @atof(i8* %5)
store float %6, float* %2
%7 = load float, float* %2
ret float %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define float @scan2float() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call float @atof(i8* %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = -1, b = 6;
  printf("%i\n", (((a) >= 0) ? (a) : (-(a))));
  printf("%i\n", (((a + b) >= 0) ? (a + b) : (-(a + b))));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1142 <main+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114a <main+0x3a>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x0,%eax
jl     1176 <main+0x66>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1183 <main+0x73>
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int getParentCountryOf(int);
int getCountryOrParentCountry(int tc) {
  if (tc > 0 && tc < 533) {
    int tp = getParentCountryOf(tc);
    if (tp > 0)
      return tp;
    return tc;
  }
  return -1;
}


x86 assembly (clang, -O0):
<getCountryOrParentCountry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115d <getCountryOrParentCountry+0x4d>
cmpl   $0x215,-0x8(%rbp)
jge    115d <getCountryOrParentCountry+0x4d>
mov    -0x8(%rbp),%edi
call   1030 <getParentCountryOf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1152 <getCountryOrParentCountry+0x42>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <getCountryOrParentCountry+0x54>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <getCountryOrParentCountry+0x54>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCountryOrParentCountry>:
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%ecx
mov    $0xffffffff,%eax
cmp    $0x213,%ecx
ja     1131 <getCountryOrParentCountry+0x21>
mov    %ebx,%edi
call   1030 <getParentCountryOf@plt>
test   %eax,%eax
cmovg  %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getCountryOrParentCountry(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 533
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 @getParentCountryOf(i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %20
17: ; preds = %10
%18 = load i32, i32* %3
store i32 %18, i32* %2
br label %20
19: ; preds = %7, %1
store i32 -1, i32* %2
br label %20
20: ; preds = %19, %17, %15
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @getCountryOrParentCountry(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 532
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @getParentCountryOf(i32 %0)
%6 = icmp sgt i32 %5, 0
%7 = select i1 %6, i32 %5, i32 %0
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
unsigned int sleep(unsigned int ms) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sleep(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ __NR_security;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, void *);
void netfree(void *ptr) { syscall(__NR_security, ptr); }


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

x86 assembly (clang, -O2):
<netfree>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_security = global i32 0
define void @netfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @__NR_security
%4 = load i8*, i8** %2
%5 = call i32 @syscall(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@__NR_security = global i32 0
define void @netfree(i8* %0) {
%2 = load i32, i32* @__NR_security
%3 = tail call i32 @syscall(i32 %2, i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
double *getVecSpace(int size) {
  double *vec = (double *)malloc(sizeof(double) * size);
  for (int i = 0; i < size; i++) {
    vec[i] = 0;
  }
  return vec;
}


x86 assembly (clang, -O0):
<getVecSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115f <getVecSpace+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <getVecSpace+0x25>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getVecSpace>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,8),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1149 <getVecSpace+0x29>
mov    %ebx,%edx
shl    $0x3,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double* @getVecSpace(i32 %0) {
%2 = alloca i32
%3 = alloca double*
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 8, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to double*
store double* %10, double** %3
store i32 0, i32* %4
br label %11
11: ; preds = %20, %1
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load double*, double** %3
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
store double 0.000000e+00, double* %19
br label %20
20: ; preds = %15
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %11
23: ; preds = %11
%24 = load double*, double** %3
ret double* %24
}

LLVM IR (-O2):
define double* @getVecSpace(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = inttoptr i64 %3 to i8*
%7 = zext i32 %0 to i64
%8 = shl nuw nsw i64 %7, 3
br label %9
9: ; preds = %5, %1
%10 = inttoptr i64 %3 to double*
ret double* %10
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int check_error(int ret_val, char type[]) {
  if (ret_val < 0)
    perror(type);
  return ret_val;
}


x86 assembly (clang, -O0):
<check_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1132 <check_error+0x22>
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_error>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
js     111b <check_error+0xb>
mov    %ebx,%eax
pop    %rbx
ret
mov    %rsi,%rdi
call   1030 <perror@plt>
jmp    1117 <check_error+0x7>

LLVM IR (-O0):
define i32 @check_error(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @perror(i8* %8)
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @check_error(i32 returned %0, i8* nocapture %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @perror(i8* %1)
br label %6
6: ; preds = %4, %2
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ destroy_main();
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  char str[16];
  alarm(10);
  write(1, "Example2:\n", 10);
  read(0, str, 256);
  destroy_main();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <alarm@plt>
mov    $0x1,%edi
lea    0xe9b(%rip),%rsi
mov    $0xa,%edx
call   1030 <write@plt>
lea    -0x20(%rbp),%rsi
xor    %edi,%edi
mov    $0x100,%edx
call   1050 <read@plt>
mov    $0x0,%al
call   1060 <destroy_main@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    $0xa,%edi
call   1040 <alarm@plt>
lea    0xeab(%rip),%rsi
mov    $0x1,%edi
mov    $0xa,%edx
call   1030 <write@plt>
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x100,%edx
call   1050 <read@plt>
xor    %eax,%eax
call   1060 <destroy_main@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Example2:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
store i32 0, i32* %1
%3 = call i32 @alarm(i32 10)
%4 = call i32 @write(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = call i32 @read(i32 0, i8* %5, i32 256)
%7 = call i32 (...) @destroy_main()
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Example2:\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @alarm(i32 10)
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = call i32 @read(i32 0, i8* %2, i32 256)
%6 = tail call i32 (...) @destroy_main()
ret i32 0
}
int clamp(int x, int min, int max) {
  return (x >= max) ? (max - 1) : ((x < min) ? min : x);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1127 <clamp+0x27>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <clamp+0x4a>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113e <clamp+0x3e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <clamp+0x44>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
cmp    %esi,%edi
cmovge %edi,%esi
lea    -0x1(%rdx),%eax
cmp    %edx,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %2
%5 = add nsw i32 %2, -1
%6 = icmp slt i32 %0, %1
%7 = select i1 %6, i32 %1, i32 %0
%8 = select i1 %4, i32 %7, i32 %5
ret i32 %8
}
/* Type definitions */
struct file_tags {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ tags_copy(struct file_tags *, struct file_tags const *);
struct file_tags *tags_new();
struct file_tags *tags_dup(const struct file_tags *tags) {
  struct file_tags *dtags;
  assert(tags != NULL);
  dtags = tags_new();
  tags_copy(dtags, tags);
  return dtags;
}


x86 assembly (clang, -O0):
<tags_dup>:
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   1040 <assert@plt>
mov    $0x0,%al
call   1030 <tags_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <tags_copy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tags_dup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1030 <tags_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <tags_copy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.file_tags = type { i32 }
define %struct.file_tags* @tags_dup(%struct.file_tags* %0) {
%2 = alloca %struct.file_tags*
%3 = alloca %struct.file_tags*
store %struct.file_tags* %0, %struct.file_tags** %2
%4 = load %struct.file_tags*, %struct.file_tags** %2
%5 = icmp ne %struct.file_tags* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call %struct.file_tags* (...) @tags_new()
store %struct.file_tags* %8, %struct.file_tags** %3
%9 = load %struct.file_tags*, %struct.file_tags** %3
%10 = load %struct.file_tags*, %struct.file_tags** %2
%11 = call i32 @tags_copy(%struct.file_tags* %9, %struct.file_tags* %10)
%12 = load %struct.file_tags*, %struct.file_tags** %3
ret %struct.file_tags* %12
}

LLVM IR (-O2):
%struct.file_tags = type { i32 }
define %struct.file_tags* @tags_dup(%struct.file_tags* %0) {
%2 = icmp ne %struct.file_tags* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call %struct.file_tags* (...) @tags_new()
%6 = tail call i32 @tags_copy(%struct.file_tags* %5, %struct.file_tags* %0)
ret %struct.file_tags* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ putst_uart(int /*<<< orphan*/ *);
int /*<<< orphan*/ sw_reset_vlsi();
void clear_vlsi_fifo(void) {
  putst_uart((uint8_t *)"clear_vlsi_fifo"
                        "\n\r");
  sw_reset_vlsi();
}


x86 assembly (clang, -O0):
<clear_vlsi_fifo>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <putst_uart@plt>
mov    $0x0,%al
call   1040 <sw_reset_vlsi@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_vlsi_fifo>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <putst_uart@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sw_reset_vlsi@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"clear_vlsi_fifo\0A\0D\00"
define void @clear_vlsi_fifo() {
%1 = call i32 @putst_uart(i32* bitcast ([18 x i8]* @.str to i32*))
%2 = call i32 (...) @sw_reset_vlsi()
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"clear_vlsi_fifo\0A\0D\00"
define void @clear_vlsi_fifo() {
%1 = tail call i32 @putst_uart(i32* bitcast ([18 x i8]* @.str to i32*))
%2 = tail call i32 (...) @sw_reset_vlsi()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA14_DriverIRQHandler();
__attribute__((weak)) void DMA14_IRQHandler(void) { DMA14_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @DMA14_IRQHandler() {
%1 = call i32 (...) @DMA14_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA14_IRQHandler() {
%1 = tail call i32 (...) @DMA14_DriverIRQHandler()
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(int);
void libc_rand_init(void) {
  struct timeval now;
  gettimeofday(&now, NULL);
  srand(now.tv_usec ^ now.tv_sec);
}


x86 assembly (clang, -O0):
<libc_rand_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%edi
xor    -0x4(%rbp),%edi
call   1040 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libc_rand_init>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x4(%rsp),%edi
xor    (%rsp),%edi
pop    %rax
jmp    1040 <srand@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @libc_rand_init() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = xor i32 %4, %6
%8 = call i32 @srand(i32 %7)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @libc_rand_init() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = xor i32 %7, %5
%9 = tail call i32 @srand(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_unsigned_less_or_equal(void) {
  gen_pop();
  gen_call("_ule");
}


x86 assembly (clang, -O0):
<gen_unsigned_less_or_equal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_unsigned_less_or_equal>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"_ule\00"
define void @gen_unsigned_less_or_equal() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"_ule\00"
define void @gen_unsigned_less_or_equal() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
char *mastrcpy(char *dest, const char *src) {
  while (*src) {
    *(dest++) = *(src++);
  }
  *dest = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<mastrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <mastrcpy+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <mastrcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mastrcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <mastrcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <mastrcpy+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @mastrcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  extern int a;
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

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