xunge/DecIR huggingface dataset:
/* Variables and functions */
int fab(int);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int k = 10;
  printf("fabonacci[%d]=%d\n", k, fab(k));
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"fabonacci[%d]=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fab(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 10, i32 %1)
ret i32 0
}
int swapI(int val) {
  int out;
  const char *i = (const char *)&val;
  char *o = (char *)&out;
  o[3] = i[0];
  o[2] = i[1];
  o[1] = i[2];
  o[0] = i[3];
  return out;
}


x86 assembly (clang, -O0):
<swapI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swapI(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %2
%6 = bitcast i32* %2 to i8*
store i8* %6, i8** %4
%7 = bitcast i32* %3 to i8*
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 3
store i8 %10, i8* %12
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 2
store i8 %15, i8* %17
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 3
%25 = load i8, i8* %24
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 0
store i8 %25, i8* %27
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @swapI(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void Hal_hook_rd_sgnfrec_reca(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_rd_sgnfrec_reca() {
ret void
}
int test_imm_9Fuint8_mem(unsigned char *val) {
  return ((*val) & (0x9F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Fuint8_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, 159
%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_9Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -97
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t bmin_int32(int32_t a, int32_t b) { return (a < b ? a : b); }


x86 assembly (clang, -O0):
<bmin_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <bmin_int32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <bmin_int32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmin_int32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @bmin_int32(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 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @bmin_int32(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int log(int);
int pow(double, int);
double sqrt(double);
double val_v(double r) {
  double r_sq = sqrt(r);
  return -2. / 3. * pow(r_sq, 3) + r - 2 * r_sq + 2 * log(1 + r_sq);
}


x86 assembly (clang, -O0):
<val_v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x3,%edi
call   1040 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xe9c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe72(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  -0x18(%rbp),%xmm0
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_v>:
sub    $0x18,%rsp
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
jb     114a <val_v+0x1a>
sqrtsd %xmm0,%xmm0
jmp    114f <val_v+0x1f>
call   1050 <sqrt@plt>
movsd  %xmm0,0x10(%rsp)
mov    $0x3,%edi
call   1040 <pow@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0xe92(%rip),%xmm1
addsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movapd %xmm2,%xmm0
addsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
addsd  0xe74(%rip),%xmm2
cvttsd2si %xmm2,%edi
call   1030 <log@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @val_v(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @sqrt(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call i32 @pow(double %6, i32 3)
%8 = sitofp i32 %7 to double
%9 = load double, double* %2
%10 = call double @llvm.fmuladd.f64(double 0xBFE5555555555555, double %8, double %9)
%11 = load double, double* %3
%12 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %11, double %10)
%13 = load double, double* %3
%14 = fadd double 1.000000e+00, %13
%15 = fptosi double %14 to i32
%16 = call i32 @log(i32 %15)
%17 = mul nsw i32 2, %16
%18 = sitofp i32 %17 to double
%19 = fadd double %12, %18
ret double %19
}

LLVM IR (-O2):
define double @val_v(double %0) {
%2 = tail call double @sqrt(double %0)
%3 = tail call i32 @pow(double %2, i32 3)
%4 = sitofp i32 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 0xBFE5555555555555, double %0)
%6 = tail call double @llvm.fmuladd.f64(double %2, double -2.000000e+00, double %5)
%7 = fadd double %2, 1.000000e+00
%8 = fptosi double %7 to i32
%9 = tail call i32 @log(i32 %8)
%10 = shl nsw i32 %9, 1
%11 = sitofp i32 %10 to double
%12 = fadd double %6, %11
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int rename(const char *oldpath, const char *newpath) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "rename");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
lea    0xee5(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rename>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"rename\00"
define i32 @rename(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @assert(i32 0)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"rename\00"
define i32 @rename(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led1Off();
void TestAppP__Leds__led1Off(void) { LedsP__Leds__led1Off(); }


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

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

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

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

/* Variables and functions */
bool errata_108(void) {
  if (*(uint32_t *)0x10000130ul == 0xEul) {
    if (*(uint32_t *)0x10000134ul == 0x0ul) {
      return true;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<errata_108>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0xe,%rax
jne    1139 <errata_108+0x39>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_108+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1140 <errata_108+0x40>
jmp    1139 <errata_108+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @errata_108() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 14
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %12
10: ; preds = %5
br label %11
11: ; preds = %10, %0
store i32 1, i32* %1
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @errata_108() {
ret i32 1
}
/* Variables and functions */
int fun_stub_base_8_stub(short, short);
int /*<<< orphan*/ printf(char *, int, ...);
int fun_stub_base_8_call(short a, short b) {
  printf("fun_stub_base_8_call:a = %d, b = %d\n", a, b);
  int x = fun_stub_base_8_stub(a, b);
  printf("fun_stub_base_8_stub return %d\n", x);
  return x;
}


x86 assembly (clang, -O0):
<fun_stub_base_8_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%esi
movswl -0x4(%rbp),%edx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2(%rbp),%ax
movswl %ax,%edi
movswl -0x4(%rbp),%esi
call   1040 <fun_stub_base_8_stub@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_8_call>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <fun_stub_base_8_stub@plt>
mov    %eax,%ebx
lea    0xeda(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"fun_stub_base_8_call:a = %d, b = %d\0A\00"
@.str.1 = [32 x i8] c"fun_stub_base_8_stub return %d\0A\00"
define i32 @fun_stub_base_8_call(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
%8 = load i16, i16* %4
%9 = sext i16 %8 to i32
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%11 = load i16, i16* %3
%12 = load i16, i16* %4
%13 = call i32 @fun_stub_base_8_stub(i16 signext %11, i16 signext %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [37 x i8] c"fun_stub_base_8_call:a = %d, b = %d\0A\00"
@.str.1 = [32 x i8] c"fun_stub_base_8_stub return %d\0A\00"
define i32 @fun_stub_base_8_call(i16 signext %0, i16 signext %1) {
%3 = sext i16 %0 to i32
%4 = sext i16 %1 to i32
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = tail call i32 @fun_stub_base_8_stub(i16 signext %0, i16 signext %1)
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  union {
    long l;
    char c[sizeof(long)];
  } u;
  u.l = 1;
  printf("%d", u.c[sizeof(long) - 1] == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i64 }
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
store i32 0, i32* %1
%3 = bitcast %union.anon* %2 to i64*
store i64 1, i64* %3
%4 = bitcast %union.anon* %2 to [8 x i8]*
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 7
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
void in_to_char(int num, char **string) {
  int len = floor(log10(abs(num))) + 1;
  int str_len = len + 1;
  *string = malloc(sizeof(char) * str_len);
  memset((*string), 0, (str_len) * sizeof(char));
  sprintf(*string, "%d", num);
}


x86 assembly (clang, -O0):
<in_to_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
cvtsi2sd %eax,%xmm0
call   1060 <log10@plt>
call   1080 <floor@plt>
movsd  0xe73(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movslq -0x18(%rbp),%rdi
shl    $0x0,%rdi
call   1050 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
movslq -0x18(%rbp),%rdx
shl    $0x0,%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x4(%rbp),%edx
lea    0xe29(%rip),%rsi
mov    $0x0,%al
call   1070 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_to_char>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
cvtsi2sd %eax,%xmm0
call   1040 <log10@plt>
call   1060 <floor@plt>
addsd  0xe9a(%rip),%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
movslq %eax,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,(%r14)
lea    0xe84(%rip),%rsi
mov    %rax,%rdi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <sprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @in_to_char(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i32, i32* %3
%8 = call i32 @abs(i32 %7)
%9 = sitofp i32 %8 to double
%10 = call double @log10(double %9)
%11 = call double @llvm.floor.f64(double %10)
%12 = fadd double %11, 1.000000e+00
%13 = fptosi double %12 to i32
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = mul i64 1, %17
%19 = call i8* @malloc(i64 %18)
%20 = load i8**, i8*** %4
store i8* %19, i8** %20
%21 = load i8**, i8*** %4
%22 = load i8*, i8** %21
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = mul i64 %24, 1
%26 = load i8**, i8*** %4
%27 = load i8*, i8** %26
%28 = load i32, i32* %3
%29 = call i32 (i8*, i8*, ...) @sprintf(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %28)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @in_to_char(i32 %0, i8** nocapture writeonly %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = sitofp i32 %3 to double
%5 = tail call double @log10(double %4)
%6 = tail call double @llvm.floor.f64(double %5)
%7 = fadd double %6, 1.000000e+00
%8 = fptosi double %7 to i32
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = call i8* @calloc(i64 1, i64 %10)
store i8* %11, i8** %1
%12 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %11, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void RTReqRelease(void) {}


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

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

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

LLVM IR (-O2):
define void @RTReqRelease() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_setschedprio(pthread_t a, int b) { assert(0); }


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

x86 assembly (clang, -O2):
<pthread_setschedprio>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @pthread_setschedprio(i32 %0, i32 %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ io_delay();
void udelay(int loops) {
  while (loops--) {
    io_delay();
  }
}


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113b <udelay+0x2b>
mov    $0x0,%al
call   1030 <io_delay@plt>
jmp    111b <udelay+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udelay>:
push   %rbx
test   %edi,%edi
je     112c <udelay+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <io_delay@plt>
add    $0xffffffff,%ebx
jne    1120 <udelay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @udelay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @io_delay()
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @udelay(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 (...) @io_delay()
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
unsigned char Rot2(unsigned char);
unsigned char S1(unsigned char X1, unsigned char X2) {
  return Rot2((X1 + X2 + 1) & 0xff);
}


x86 assembly (clang, -O0):
<S1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
add    $0x1,%eax
and    $0xff,%eax
movzbl %al,%edi
call   1030 <Rot2@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S1>:
add    %sil,%dil
add    $0x1,%dil
movzbl %dil,%edi
jmp    1030 <Rot2@plt>

LLVM IR (-O0):
define zeroext i8 @S1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = add nsw i32 %6, %8
%10 = add nsw i32 %9, 1
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i8
%13 = call zeroext i8 @Rot2(i8 zeroext %12)
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @S1(i8 zeroext %0, i8 zeroext %1) {
%3 = add i8 %0, 1
%4 = add i8 %3, %1
%5 = tail call zeroext i8 @Rot2(i8 zeroext %4)
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushreal32array_(void *x, unsigned int *n) {
  pushNarray((char *)x, (*n * 32));
}


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

x86 assembly (clang, -O2):
<pushreal32array_>:
mov    (%rsi),%esi
shl    $0x5,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushreal32array_(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* %6
%8 = mul i32 %7, 32
%9 = call i32 @pushNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushreal32array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 5
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int /*<<< orphan*/);
int /*<<< orphan*/ power(long, int);
void test(long x) {
  bar(power(x, 10));
  bar(power(x, 27));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <power@plt>
mov    %eax,%edi
call   1040 <bar@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1b,%esi
call   1030 <power@plt>
mov    %eax,%edi
call   1040 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1030 <power@plt>
mov    %eax,%edi
call   1040 <bar@plt>
mov    %rbx,%rdi
mov    $0x1b,%esi
call   1030 <power@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <bar@plt>

LLVM IR (-O0):
define void @test(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @power(i64 %3, i32 10)
%5 = call i32 @bar(i32 %4)
%6 = load i64, i64* %2
%7 = call i32 @power(i64 %6, i32 27)
%8 = call i32 @bar(i32 %7)
ret void
}

LLVM IR (-O2):
define void @test(i64 %0) {
%2 = tail call i32 @power(i64 %0, i32 10)
%3 = tail call i32 @bar(i32 %2)
%4 = tail call i32 @power(i64 %0, i32 27)
%5 = tail call i32 @bar(i32 %4)
ret void
}
/* Variables and functions */
char *strerror(int);
char *os_strerror(int errnum) { return strerror(errnum); }


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

x86 assembly (clang, -O2):
<os_strerror>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @os_strerror(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
double julian_decrement_day(double current) { return current - 1.0; }


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

x86 assembly (clang, -O2):
<julian_decrement_day>:
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @julian_decrement_day(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @julian_decrement_day(double %0) {
%2 = fadd double %0, -1.000000e+00
ret double %2
}
unsigned dwc2_max_packet_size(unsigned ep) {
  if (ep == 0)
    return 64;
  return 512;
}


x86 assembly (clang, -O0):
<dwc2_max_packet_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <dwc2_max_packet_size+0x1d>
movl   $0x40,-0x4(%rbp)
jmp    1124 <dwc2_max_packet_size+0x24>
movl   $0x200,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwc2_max_packet_size>:
test   %edi,%edi
mov    $0x40,%ecx
mov    $0x200,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dwc2_max_packet_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 64, i32* %2
br label %8
7: ; preds = %1
store i32 512, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @dwc2_max_packet_size(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 64, i32 512
ret i32 %3
}
int __aeabi_MB_CUR_MAX(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @__aeabi_MB_CUR_MAX() {
ret i32 1
}
/* Variables and functions */
int listen(int, int);
__attribute__((stdcall)) int listen_wrap(int fd, int n) {
  return listen(fd, n);
}


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

x86 assembly (clang, -O2):
<listen_wrap>:
jmp    1030 <listen@plt>

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

LLVM IR (-O2):
define i32 @listen_wrap(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ execve(char const *, char **, char **);
int main(int argc, char *argv[], char *env[]) {
  const char *iptables_path = "/sbin/iptables";
  argv[0] = (char *)iptables_path;
  execve(iptables_path, argv, env);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xecf(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"/sbin/iptables\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8*
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %8
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %6
%11 = getelementptr inbounds i8*, i8** %10, i64 0
store i8* %9, i8** %11
%12 = load i8*, i8** %8
%13 = load i8**, i8*** %6
%14 = load i8**, i8*** %7
%15 = call i32 @execve(i8* %12, i8** %13, i8** %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"/sbin/iptables\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = tail call i32 @execve(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %1, i8** %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ search(int *, int, int);
int main() {
  int n[5] = {23, 4, 54, 23, 765};
  search(n, 5, 4);
  search(n, 5, 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
mov    $0x4,%edx
call   1030 <search@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
mov    $0x64,%edx
call   1030 <search@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xef5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x4,%edx
call   1030 <search@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x64,%edx
call   1030 <search@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.n = [5 x i32] [i32 23, i32 4, i32 54, i32 23, i32 765]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @search(i32* %4, i32 5, i32 4)
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = call i32 @search(i32* %6, i32 5, i32 100)
ret i32 0
}

LLVM IR (-O2):
@__const.main.n = [5 x i32] [i32 23, i32 4, i32 54, i32 23, i32 765]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 5, i32 4)
%5 = call i32 @search(i32* %3, i32 5, i32 100)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int8_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
scalar_t__ INT8_MAX;
scalar_t__ INT8_MIN;
int8_t __hsail_sat_sub_s8(int8_t a, int8_t b) {
  int16_t c = (int16_t)a - (int16_t)b;
  if (c > INT8_MAX)
    return INT8_MAX;
  else if (c < INT8_MIN)
    return INT8_MIN;
  else
    return c;
}


x86 assembly (clang, -O0):
<__hsail_sat_sub_s8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2eb5(%rip),%rcx
cmp    (%rcx),%rax
jle    113f <__hsail_sat_sub_s8+0x3f>
mov    0x2ea5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <__hsail_sat_sub_s8+0x6e>
mov    -0x20(%rbp),%rax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
jge    1166 <__hsail_sat_sub_s8+0x66>
mov    0x2e8e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <__hsail_sat_sub_s8+0x6e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_sat_sub_s8>:
sub    %rsi,%rdi
mov    0x2ece(%rip),%rcx
mov    0x2ed7(%rip),%rax
mov    (%rax),%rax
cmp    %rax,%rdi
cmovge %rdi,%rax
mov    (%rcx),%rcx
cmp    %rcx,%rdi
cmovg  %rcx,%rax
ret

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

LLVM IR (-O2):
@INT8_MAX = global i64 0
@INT8_MIN = global i64 0
define i64 @__hsail_sat_sub_s8(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = load i64, i64* @INT8_MAX
%5 = icmp sgt i64 %3, %4
%6 = load i64, i64* @INT8_MIN
%7 = icmp slt i64 %3, %6
%8 = select i1 %7, i64 %6, i64 %3
%9 = select i1 %5, i64 %4, i64 %8
ret i64 %9
}
int comp_double_desc(const void *p_d1, const void *p_d2) {
  double d1 = *(double *)p_d1;
  double d2 = *(double *)p_d2;
  if (d1 > d2) {
    return -1;
  }
  if (d1 < d2) {
    return +1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<comp_double_desc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1142 <comp_double_desc+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <comp_double_desc+0x69>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1162 <comp_double_desc+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <comp_double_desc+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_double_desc>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comp_double_desc(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp olt double %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @comp_double_desc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp olt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ BUFSIZ;
int /*<<< orphan*/ _IOFBF;
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void setbuf(FILE *restrict fp, char *restrict buf) {
  setvbuf(fp, buf, (buf) ? _IOFBF : _IONBF, BUFSIZ);
}


x86 assembly (clang, -O0):
<setbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <setbuf+0x3c>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1158 <setbuf+0x48>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    0x2e6e(%rip),%rax
mov    (%rax),%ecx
call   1030 <setvbuf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbuf>:
test   %rsi,%rsi
jne    111e <setbuf+0xe>
mov    0x2ecc(%rip),%rax
jmp    1125 <setbuf+0x15>
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
@_IOFBF = global i32 0
@_IONBF = global i32 0
@BUFSIZ = global i32 0
define void @setbuf(i32* noalias %0, i8* noalias %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* @_IOFBF
br label %13
11: ; preds = %2
%12 = load i32, i32* @_IONBF
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
%15 = load i32, i32* @BUFSIZ
%16 = call i32 @setvbuf(i32* %5, i8* %6, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@_IOFBF = global i32 0
@_IONBF = global i32 0
@BUFSIZ = global i32 0
define void @setbuf(i32* noalias nocapture %0, i8* noalias %1) {
%3 = icmp eq i8* %1, null
%4 = load i32, i32* @_IOFBF
%5 = load i32, i32* @_IONBF
%6 = select i1 %3, i32 %5, i32 %4
%7 = load i32, i32* @BUFSIZ
%8 = tail call i32 @setvbuf(i32* %0, i8* %1, i32 %6, i32 %7)
ret void
}
/* Variables and functions */
int rand();
int random_string(unsigned char *buffer, unsigned int size) {
  unsigned int i = 0;
  for (i = 0; i < size; i++) {
    buffer[i] = rand() & 0xFF;
  }
  return 0;
}


x86 assembly (clang, -O0):
<random_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    115f <random_string+0x4f>
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <random_string+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_string>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1144 <random_string+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <random_string+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @random_string(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 %13, i8* %17
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @random_string(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i32 (...) @rand()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %9, i8* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
unsigned xrop3_18_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_18_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_18_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    $0xffffff00,%eax
or     %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_18_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_18_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -256
%8 = or i32 %7, %4
%9 = xor i32 %8, -1
ret i32 %9
}
int iso_error_get_code(int e) { return ((e & 0x0000FFFF) | 0x00030000); }


x86 assembly (clang, -O0):
<iso_error_get_code>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
or     $0x30000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_error_get_code>:
movzwl %di,%eax
or     $0x30000,%eax
ret

LLVM IR (-O0):
define i32 @iso_error_get_code(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = or i32 %4, 196608
ret i32 %5
}

LLVM IR (-O2):
define i32 @iso_error_get_code(i32 %0) {
%2 = and i32 %0, 65535
%3 = or i32 %2, 196608
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SSP_Free();
int /*<<< orphan*/ SSP_FreeDevice();
int /*<<< orphan*/ SSP_Stop();
int /*<<< orphan*/ printf(char *);
void destroyPlayer() {
  printf("Destroying player...\n");
  SSP_Stop();
  SSP_FreeDevice();
  SSP_Free();
  printf("Player destruction successful!\n");
}


x86 assembly (clang, -O0):
<destroyPlayer>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <SSP_Stop@plt>
mov    $0x0,%al
call   1050 <SSP_FreeDevice@plt>
mov    $0x0,%al
call   1060 <SSP_Free@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyPlayer>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <SSP_Stop@plt>
xor    %eax,%eax
call   1050 <SSP_FreeDevice@plt>
xor    %eax,%eax
call   1060 <SSP_Free@plt>
lea    0xeac(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Destroying player...\0A\00"
@.str.1 = [32 x i8] c"Player destruction successful!\0A\00"
define void @destroyPlayer() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @SSP_Stop()
%3 = call i32 (...) @SSP_FreeDevice()
%4 = call i32 (...) @SSP_Free()
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Destroying player...\00"
@str.2 = [31 x i8] c"Player destruction successful!\00"
define void @destroyPlayer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @SSP_Stop()
%3 = tail call i32 (...) @SSP_FreeDevice()
%4 = tail call i32 (...) @SSP_Free()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
ret void
}