xunge/DecIR huggingface dataset:
IR0A1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((*p0) <= (*((double *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0A1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mov    $0xa98ac7,%eax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1143 <IR0A1+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <IR0A1+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0A1>:
movsd  0xa98ac7,%xmm0
xor    %eax,%eax
ucomisd (%rdx),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @IR0A1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = load double, double* %14
%16 = load double, double* inttoptr (i64 11111111 to double*)
%17 = fcmp ole double %15, %16
br i1 %17, label %18, label %19
18: ; preds = %6
store i32 1, i32* %7
br label %20
19: ; preds = %6
store i32 0, i32* %7
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @IR0A1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture readnone %5) {
%7 = load double, double* %4
%8 = load double, double* inttoptr (i64 11111111 to double*)
%9 = fcmp ole double %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
const char *deviceI2cMasterDebugGetName(void) { return "i2cMasterDebug"; }


x86 assembly (clang, -O0):
<deviceI2cMasterDebugGetName>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deviceI2cMasterDebugGetName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"i2cMasterDebug\00"
define i8* @deviceI2cMasterDebugGetName() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"i2cMasterDebug\00"
define i8* @deviceI2cMasterDebugGetName() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XCreateWindowEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XCreateWindowEvent_display(void *_p, void *_v) {
  ((XCreateWindowEvent *)_p)->display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XCreateWindowEvent_display>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XCreateWindowEvent_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XCreateWindowEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int soma(int, int);
int main(int argc, char **argv) {
  printf("Hello World!\n");
  printf("Soma: %d\n", soma(10, 20));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1050 <soma@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [10 x i8] c"Soma: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @soma(i32 10, i32 20)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"Soma: %d\0A\00"
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @soma(i32 10, i32 20)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
struct timeval {
  long tv_sec;
  unsigned long tv_usec;
};

/* Variables and functions */
unsigned long tv_diff_usec(struct timeval *stp, struct timeval *etp) {
  return ((1000000L * (etp)->tv_sec + (etp)->tv_usec) -
          (1000000L * (stp)->tv_sec + (stp)->tv_usec));
}


x86 assembly (clang, -O0):
<tv_diff_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   $0xf4240,(%rax),%rax
mov    -0x10(%rbp),%rcx
add    0x8(%rcx),%rax
mov    -0x8(%rbp),%rcx
imul   $0xf4240,(%rcx),%rcx
mov    -0x8(%rbp),%rdx
add    0x8(%rdx),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tv_diff_usec>:
mov    (%rsi),%rcx
mov    0x8(%rsi),%rax
sub    (%rdi),%rcx
imul   $0xf4240,%rcx,%rcx
sub    0x8(%rdi),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @tv_diff_usec(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = mul nsw i64 1000000, %7
%9 = load %struct.timeval*, %struct.timeval** %4
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
%11 = load i64, i64* %10
%12 = add i64 %8, %11
%13 = load %struct.timeval*, %struct.timeval** %3
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 0
%15 = load i64, i64* %14
%16 = mul nsw i64 1000000, %15
%17 = load %struct.timeval*, %struct.timeval** %3
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = add i64 %16, %19
%21 = sub i64 %12, %20
ret i64 %21
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @tv_diff_usec(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%8 = load i64, i64* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%10 = load i64, i64* %9
%11 = sub i64 %4, %8
%12 = mul i64 %11, 1000000
%13 = sub i64 %6, %10
%14 = add i64 %13, %12
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *me) {
  printf("Usage: %s [-r] [-s]\n\t-r recives packets of ethernet\n"
         "\t-s sends a packet to ethernet\n",
         me);
  exit(0);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [84 x i8] c"Usage: %s [-r] [-s]\0A\09-r recives packets of ethernet\0A\09-s sends a packet to ethernet\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [84 x i8] c"Usage: %s [-r] [-s]\0A\09-r recives packets of ethernet\0A\09-s sends a packet to ethernet\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
long grib_op_modulo(long a, long b) { return a % b; }


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

x86 assembly (clang, -O2):
<grib_op_modulo>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1118 <grib_op_modulo+0x18>
cqto
idiv   %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @grib_op_modulo(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 = srem i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @grib_op_modulo(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
ret i64 %3
}
int fun1070() { return 1070; }


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

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

LLVM IR (-O0):
define i32 @fun1070() {
ret i32 1070
}

LLVM IR (-O2):
define i32 @fun1070() {
ret i32 1070
}
/* Variables and functions */
int /*<<< orphan*/ arm_lsr(int /*<<< orphan*/);
int /*<<< orphan*/ t16_data_rdn3_op();
void t16_lsr_rdn3() { arm_lsr(t16_data_rdn3_op()); }


x86 assembly (clang, -O0):
<t16_lsr_rdn3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <t16_data_rdn3_op@plt>
mov    %eax,%edi
call   1030 <arm_lsr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_lsr_rdn3>:
push   %rax
xor    %eax,%eax
call   1040 <t16_data_rdn3_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_lsr@plt>

LLVM IR (-O0):
define void @t16_lsr_rdn3() {
%1 = call i32 (...) @t16_data_rdn3_op()
%2 = call i32 @arm_lsr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_lsr_rdn3() {
%1 = tail call i32 (...) @t16_data_rdn3_op()
%2 = tail call i32 @arm_lsr(i32 %1)
ret void
}
int test_imm_6Bint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x6B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Bint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 459561500672
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int really_is_var(char *str) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @really_is_var(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ outplain(char *);
void styledOutput(char *type, char *mesg) {
  outplain("[");
  outplain(type);
  outplain("]");
  outplain(mesg);
  outplain("\n");
}


x86 assembly (clang, -O0):
<styledOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <outplain@plt>
mov    -0x8(%rbp),%rdi
call   1030 <outplain@plt>
lea    0xec6(%rip),%rdi
call   1030 <outplain@plt>
mov    -0x10(%rbp),%rdi
call   1030 <outplain@plt>
lea    0xeb3(%rip),%rdi
call   1030 <outplain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<styledOutput>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rdi
call   1030 <outplain@plt>
mov    %rbx,%rdi
call   1030 <outplain@plt>
lea    0xecd(%rip),%rdi
call   1030 <outplain@plt>
mov    %r14,%rdi
call   1030 <outplain@plt>
lea    0xebb(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <outplain@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"[\00"
@.str.1 = [2 x i8] c"]\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @styledOutput(i8* %0, i8* %1) {
%3 = tail call i32 @outplain(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @outplain(i8* %0)
%5 = tail call i32 @outplain(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @outplain(i8* %1)
%7 = tail call i32 @outplain(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int powerOf2(int a) {
  if (a == 0) {
    return 1;
  } else {
    return 2 * powerOf2(a - 1);
  }
}


x86 assembly (clang, -O0):
<powerOf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <powerOf2+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1142 <powerOf2+0x32>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <powerOf2@plt>
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerOf2>:
test   %edi,%edi
je     1124 <powerOf2+0x14>
push   %rax
add    $0xffffffff,%edi
call   1030 <powerOf2@plt>
add    %eax,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @powerOf2(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 1, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @powerOf2(i32 %9)
%11 = mul nsw i32 2, %10
store i32 %11, i32* %2
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @powerOf2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %8, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @powerOf2(i32 %6)
%8 = shl nsw i32 %7, 1
br label %3
}
void swap(int a, int b) {
  int tmp = b;
  b = a;
  a = tmp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int comp_str(void *ref_data, void *new_data) {
  return strcmp((char *)ref_data, (char *)new_data);
}


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

x86 assembly (clang, -O2):
<comp_str>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @comp_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int strans(double const);
double f(double const x) { return x + (strans((x + 1) / 2) * 2 - 1) * 2; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed9(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <strans@plt>
movsd  -0x10(%rbp),%xmm0
shl    $0x1,%eax
sub    $0x1,%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
movsd  0xede(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  0xeda(%rip),%xmm0
call   1030 <strans@plt>
lea    -0x2(,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %5, 2.000000e+00
%7 = call i32 @strans(double %6)
%8 = mul nsw i32 %7, 2
%9 = sub nsw i32 %8, 1
%10 = mul nsw i32 %9, 2
%11 = sitofp i32 %10 to double
%12 = fadd double %3, %11
ret double %12
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fmul double %2, 5.000000e-01
%4 = tail call i32 @strans(double %3)
%5 = shl i32 %4, 2
%6 = add i32 %5, -2
%7 = sitofp i32 %6 to double
%8 = fadd double %7, %0
ret double %8
}
/* Type definitions */
struct splay_tree_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ splay_tree_remove(struct splay_tree_s *, char *);
void splay_delete(struct splay_tree_s *splay, const char *key) {
  splay_tree_remove(splay, (char *)key);
}


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

x86 assembly (clang, -O2):
<splay_delete>:
jmp    1030 <splay_tree_remove@plt>

LLVM IR (-O0):
%struct.splay_tree_s = type { i32 }
define void @splay_delete(%struct.splay_tree_s* %0, i8* %1) {
%3 = alloca %struct.splay_tree_s*
%4 = alloca i8*
store %struct.splay_tree_s* %0, %struct.splay_tree_s** %3
store i8* %1, i8** %4
%5 = load %struct.splay_tree_s*, %struct.splay_tree_s** %3
%6 = load i8*, i8** %4
%7 = call i32 @splay_tree_remove(%struct.splay_tree_s* %5, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.splay_tree_s = type { i32 }
define void @splay_delete(%struct.splay_tree_s* %0, i8* %1) {
%3 = tail call i32 @splay_tree_remove(%struct.splay_tree_s* %0, i8* %1)
ret void
}
int test_imm_7Auint32_mem(unsigned int *val) {
  return ((*val) & (0x7A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Auint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 122
%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_7Auint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 122
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fd_led_set_usb(int /*<<< orphan*/, int /*<<< orphan*/);
void usb_off(void) { fd_led_set_usb(0, 0); }


x86 assembly (clang, -O0):
<usb_off>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <fd_led_set_usb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_off>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <fd_led_set_usb@plt>

LLVM IR (-O0):
define void @usb_off() {
%1 = call i32 @fd_led_set_usb(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @usb_off() {
%1 = tail call i32 @fd_led_set_usb(i32 0, i32 0)
ret void
}
/* Variables and functions */
int _c2_addr_read();
void wait_ready(void) {
  while (!(_c2_addr_read() & (1 << 0)))
    ;
}


x86 assembly (clang, -O0):
<wait_ready>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <wait_ready+0x9>
mov    $0x0,%al
call   1030 <_c2_addr_read@plt>
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <wait_ready+0x28>
jmp    113d <wait_ready+0x2d>
jmp    1119 <wait_ready+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_ready>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <_c2_addr_read@plt>
test   $0x1,%al
je     1120 <wait_ready+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @wait_ready() {
br label %1
1: ; preds = %6, %0
%2 = call i32 (...) @_c2_addr_read()
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @wait_ready() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @_c2_addr_read()
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
int test_imm_53uint32_mem(unsigned int *val) {
  return ((*val) & (0x53 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_53uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 83
%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_53uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 83
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ val;
typedef int __u16;

/* Variables and functions */
__u16 ___swab16(__u16 val) {
  return ((__u16)((((__u16)(val) & (__u16)0x00ffU) << 8) |
                  (((__u16)(val) & (__u16)0xff00U) >> 8)));
}


x86 assembly (clang, -O0):
<___swab16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<___swab16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @___swab16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @___swab16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
void av_cmp_i() {}


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

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

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

LLVM IR (-O2):
define void @av_cmp_i() {
ret void
}
int free() {
  int retval;
  __asm__("int $0x80      \n\t"
          "mov %%eax, %0"
          : "=m"(retval)
          : "a"(14)
          : "memory");
  return retval;
}


x86 assembly (clang, -O0):
<free>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe,%eax
int    $0x80
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<free>:
mov    $0xe,%eax
int    $0x80
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @free() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
float stbir__support_trapezoid(float scale) {
  assert(scale <= 1);
  return 0.5f + scale / 2;
}


x86 assembly (clang, -O0):
<stbir__support_trapezoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  -0x4(%rbp),%xmm1
movss  0xec1(%rip),%xmm0
divss  %xmm0,%xmm1
movss  0xeb1(%rip),%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbir__support_trapezoid>:
push   %rax
movss  %xmm0,0x4(%rsp)
movss  0xee1(%rip),%xmm1
xor    %edi,%edi
ucomiss %xmm0,%xmm1
setae  %dil
call   1030 <assert@plt>
movss  0xecf(%rip),%xmm1
movss  0x4(%rsp),%xmm0
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @stbir__support_trapezoid(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ole float %3, 1.000000e+00
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load float, float* %2
%8 = fdiv float %7, 2.000000e+00
%9 = fadd float 5.000000e-01, %8
ret float %9
}

LLVM IR (-O2):
define float @stbir__support_trapezoid(float %0) {
%2 = fcmp ole float %0, 1.000000e+00
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = fmul float %0, 5.000000e-01
%6 = fadd float %5, 5.000000e-01
ret float %6
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *display;
};
struct TYPE_4__ {
  TYPE_1__ xany;
};
typedef TYPE_2__ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XEvent_xany_display(void *_p, void *_v) {
  ((XEvent *)_p)->xany.display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xany_display>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32* }
define void @set_XEvent_xany_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_4__*
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
store i32* %6, i32** %10
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xany_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void outb(uint8_t value, uint16_t port) {}


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

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

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

LLVM IR (-O2):
define void @outb(i32 %0, i32 %1) {
ret void
}
void avio_open2() {}


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

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

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

LLVM IR (-O2):
define void @avio_open2() {
ret void
}
/* Variables and functions */
int dwarf_get_EH_name(unsigned int, char const **);
char const *ellipname(int, unsigned int, char const *, char *, int);
const char *get_EH_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_EH_name(val_in, &v);
  return ellipname(res, val_in, v, "EH", printonerr);
}


x86 assembly (clang, -O0):
<get_EH_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <dwarf_get_EH_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    0xea6(%rip),%rcx
call   1040 <ellipname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_EH_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <dwarf_get_EH_name@plt>
mov    (%rsp),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
call   1040 <ellipname@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"EH\00"
define i8* @get_EH_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
%7 = load i32, i32* %3
%8 = call i32 @dwarf_get_EH_name(i32 %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i8* @ellipname(i32 %9, i32 %10, i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"EH\00"
define i8* @get_EH_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @dwarf_get_EH_name(i32 %0, i8** %3)
%6 = load i8*, i8** %3
%7 = call i8* @ellipname(i32 %5, i32 %0, i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ Serial_begin(int);
int /*<<< orphan*/ clearBss();
int /*<<< orphan*/ init_syst();
void rpi_init(void) {
  clearBss();
  init_syst();
  Serial_begin(115200);
}


x86 assembly (clang, -O0):
<rpi_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clearBss@plt>
mov    $0x0,%al
call   1030 <init_syst@plt>
mov    $0x1c200,%edi
call   1050 <Serial_begin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpi_init>:
push   %rax
xor    %eax,%eax
call   1040 <clearBss@plt>
xor    %eax,%eax
call   1030 <init_syst@plt>
mov    $0x1c200,%edi
pop    %rax
jmp    1050 <Serial_begin@plt>

LLVM IR (-O0):
define void @rpi_init() {
%1 = call i32 (...) @clearBss()
%2 = call i32 (...) @init_syst()
%3 = call i32 @Serial_begin(i32 115200)
ret void
}

LLVM IR (-O2):
define void @rpi_init() {
%1 = tail call i32 (...) @clearBss()
%2 = tail call i32 (...) @init_syst()
%3 = tail call i32 @Serial_begin(i32 115200)
ret void
}
int foo(int i, int n) {
  if (i < n) {
    return 1 + foo(i + 1, n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1143 <foo+0x33>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    -0xc(%rbp),%esi
call   1030 <foo@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114a <foo+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
sub    %edi,%esi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = sub i32 %1, %0
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ delete_test();
int main() {
  delete_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @delete_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ other();
int main(int argc, char **argv) {
  other();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @other()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @other()
ret i32 0
}
char TestBE() {
  char r;
  __asm__("cmp $2, %1" : "=@ccbe"(r) : "r"(1));
  if (r) {
    __asm__("cmp $0, %1" : "=@ccnbe"(r) : "r"(1));
    if (r) {
      __asm__("cmp $1, %1" : "=@ccbe"(r) : "r"(1));
      if (r)
        return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<TestBE>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
cmp    $0x2,%eax
setbe  %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     115f <TestBE+0x5f>
mov    $0x1,%eax
cmp    $0x0,%eax
seta   %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     115a <TestBE+0x5a>
mov    $0x1,%eax
cmp    $0x1,%eax
setbe  %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     1155 <TestBE+0x55>
movb   $0x1,-0x1(%rbp)
jmp    1163 <TestBE+0x63>
jmp    115a <TestBE+0x5a>
jmp    115f <TestBE+0x5f>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestBE>:
mov    $0x1,%eax
cmp    $0x2,%eax
ja     111c <TestBE+0x1c>
cmp    $0x0,%eax
jbe    111c <TestBE+0x1c>
mov    $0x1,%eax
cmp    $0x1,%eax
mov    $0x1,%al
ja     111c <TestBE+0x1c>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @TestBE() {
%1 = alloca i8
%2 = alloca i8
%3 = call i8 asm "cmp $$2, $1", "={@ccbe},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %0
%7 = call i8 asm "cmp $$0, $1", "={@ccnbe},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = call i8 asm "cmp $$1, $1", "={@ccbe},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %11, i8* %2
%12 = load i8, i8* %2
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i8 1, i8* %1
br label %18
15: ; preds = %10
br label %16
16: ; preds = %15, %6
br label %17
17: ; preds = %16, %0
store i8 0, i8* %1
br label %18
18: ; preds = %17, %14
%19 = load i8, i8* %1
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @TestBE() {
%1 = tail call i8 asm "cmp $$2, $1", "={@ccbe},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%2 = icmp eq i8 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i8 asm "cmp $$0, $1", "={@ccnbe},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i8 asm "cmp $$1, $1", "={@ccbe},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3, %6, %0
br label %10
10: ; preds = %6, %9
%11 = phi i8 [ 0, %9 ], [ 1, %6 ]
ret i8 %11
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ random();
long my_random(int up_to) {
  double random_double;
  random_double = (double)random() / (double)RAND_MAX;
  return (long)((double)up_to * random_double) + 1;
}


x86 assembly (clang, -O0):
<my_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eba(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%rax
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_random>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec2(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i64 @my_random(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = call i64 (...) @random()
%5 = sitofp i64 %4 to double
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fdiv double %5, %7
store double %8, double* %3
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to double
%11 = load double, double* %3
%12 = fmul double %10, %11
%13 = fptosi double %12 to i64
%14 = add nsw i64 %13, 1
ret i64 %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i64 @my_random(i32 %0) {
%2 = tail call i64 (...) @random()
%3 = sitofp i64 %2 to double
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
%7 = sitofp i32 %0 to double
%8 = fmul double %6, %7
%9 = fptosi double %8 to i64
%10 = add nsw i64 %9, 1
ret i64 %10
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
short stat(char *, struct stat *);
short UnixIsFolder(char *path) {
  struct stat filestat;
  short err;
  err = stat(path, &filestat);
  if (err == -1)
    return err;
  return (S_ISREG(filestat.st_mode) != 1) ? 1 : 0;
}


x86 assembly (clang, -O0):
<UnixIsFolder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %ax,-0x1a(%rbp)
movswl -0x1a(%rbp),%eax
cmp    $0xffffffff,%eax
jne    1157 <UnixIsFolder+0x37>
mov    -0x1a(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1172 <UnixIsFolder+0x52>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmovne %ecx,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnixIsFolder>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffff,%ax
je     1143 <UnixIsFolder+0x23>
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
setne  %al
pop    %rcx
ret
mov    $0xffff,%ax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define signext i16 @UnixIsFolder(i8* %0) {
%2 = alloca i16
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i16
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call signext i16 @stat(i8* %6, %struct.stat* %4)
store i16 %7, i16* %5
%8 = load i16, i16* %5
%9 = sext i16 %8 to i32
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i16, i16* %5
store i16 %12, i16* %2
br label %21
13: ; preds = %1
%14 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%15 = load i32, i32* %14
%16 = call i32 @S_ISREG(i32 %15)
%17 = icmp ne i32 %16, 1
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
%20 = trunc i32 %19 to i16
store i16 %20, i16* %2
br label %21
21: ; preds = %13, %11
%22 = load i16, i16* %2
ret i16 %22
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define signext i16 @UnixIsFolder(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call signext i16 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i16 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISREG(i32 %8)
%10 = icmp ne i32 %9, 1
%11 = zext i1 %10 to i16
br label %12
12: ; preds = %1, %6
%13 = phi i16 [ %11, %6 ], [ -1, %1 ]
ret i16 %13
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
scalar_t__ SIG_ERR;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
scalar_t__ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[], char *env[]) {
  if (signal(SIGINT, SIG_IGN) == SIG_ERR) {
    puts("Error en la captura");
    exit(1);
  }
  while (1)
    ;
  exit(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)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    0x2e68(%rip),%rcx
cmp    (%rcx),%rax
jne    1187 <main+0x57>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    118c <main+0x5c>
jmp    118c <main+0x5c>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
je     1162 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1160 <main+0x30>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@.str = [20 x i8] c"Error en la captura\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* @SIGINT
%9 = load i32, i32* @SIG_IGN
%10 = call i64 @signal(i32 %8, i32 %9)
%11 = load i64, i64* @SIG_ERR
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %3
br label %17
17: ; preds = %16, %17
br label %17
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@.str = [20 x i8] c"Error en la captura\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_IGN
%6 = tail call i64 @signal(i32 %4, i32 %5)
%7 = load i64, i64* @SIG_ERR
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %3, %12
br label %12
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
float _mm_cvtss_f32(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_rsqrt_ss(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set_ss(float);
float HMM_RSquareRootF(float Float) {
  float Result;
  __m128 In = _mm_set_ss(Float);
  __m128 Out = _mm_rsqrt_ss(In);
  Result = _mm_cvtss_f32(Out);
  return (Result);
}


x86 assembly (clang, -O0):
<HMM_RSquareRootF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <_mm_set_ss@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <_mm_rsqrt_ss@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <_mm_cvtss_f32@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMM_RSquareRootF>:
push   %rax
call   1040 <_mm_set_ss@plt>
mov    %eax,%edi
call   1050 <_mm_rsqrt_ss@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <_mm_cvtss_f32@plt>

LLVM IR (-O0):
define float @HMM_RSquareRootF(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store float %0, float* %2
%6 = load float, float* %2
%7 = call i32 @_mm_set_ss(float %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @_mm_rsqrt_ss(i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call float @_mm_cvtss_f32(i32 %10)
store float %11, float* %3
%12 = load float, float* %3
ret float %12
}

LLVM IR (-O2):
define float @HMM_RSquareRootF(float %0) {
%2 = tail call i32 @_mm_set_ss(float %0)
%3 = tail call i32 @_mm_rsqrt_ss(i32 %2)
%4 = tail call float @_mm_cvtss_f32(i32 %3)
ret float %4
}
/* Type definitions */
struct utmpx {
  int dummy;
};
struct utmp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __updwtmp(char const *, struct utmp const *);
void updwtmpx(const char *wtmpx_file, const struct utmpx *utmpx) {
  __updwtmp(wtmpx_file, (const struct utmp *)utmpx);
}


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

x86 assembly (clang, -O2):
<updwtmpx>:
jmp    1030 <__updwtmp@plt>

LLVM IR (-O0):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define void @updwtmpx(i8* %0, %struct.utmpx* %1) {
%3 = alloca i8*
%4 = alloca %struct.utmpx*
store i8* %0, i8** %3
store %struct.utmpx* %1, %struct.utmpx** %4
%5 = load i8*, i8** %3
%6 = load %struct.utmpx*, %struct.utmpx** %4
%7 = bitcast %struct.utmpx* %6 to %struct.utmp*
%8 = call i32 @__updwtmp(i8* %5, %struct.utmp* %7)
ret void
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define void @updwtmpx(i8* %0, %struct.utmpx* %1) {
%3 = bitcast %struct.utmpx* %1 to %struct.utmp*
%4 = tail call i32 @__updwtmp(i8* %0, %struct.utmp* %3)
ret void
}