xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stirling(int);
int main() {
  int N;
  scanf("%d", &N);
  printf("%ld\n", stirling(N));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <stirling@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <stirling@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @stirling(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int batadv_dat_init(struct batadv_priv *bat_priv) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.batadv_priv = type opaque
define i32 @batadv_dat_init(%struct.batadv_priv* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
float sqr(double);
float boatAreaTest(float x, float z) {
  return (sqr(z) / sqr(60.0 / 2.0) + sqr(x) / sqr(80.0 / 2.0));
}


x86 assembly (clang, -O0):
<boatAreaTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sqr@plt>
movss  %xmm0,-0x14(%rbp)
movsd  0xecb(%rip),%xmm0
call   1030 <sqr@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sqr@plt>
movss  %xmm0,-0x10(%rbp)
movsd  0xe92(%rip),%xmm0
call   1030 <sqr@plt>
movss  -0x10(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0xc(%rbp),%xmm0
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boatAreaTest>:
sub    $0x38,%rsp
movss  %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
call   1030 <sqr@plt>
movaps %xmm0,0x20(%rsp)
movsd  0xece(%rip),%xmm0
call   1030 <sqr@plt>
movaps %xmm0,0x10(%rsp)
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sqr@plt>
movaps %xmm0,(%rsp)
movsd  0xeb2(%rip),%xmm0
call   1030 <sqr@plt>
movaps 0x20(%rsp),%xmm1
unpcklps (%rsp),%xmm1
movaps 0x10(%rsp),%xmm2
unpcklps %xmm0,%xmm2
divps  %xmm2,%xmm1
movaps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm0
addss  %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define float @boatAreaTest(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fpext float %5 to double
%7 = call float @sqr(double %6)
%8 = call float @sqr(double 3.000000e+01)
%9 = fdiv float %7, %8
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = call float @sqr(double %11)
%13 = call float @sqr(double 4.000000e+01)
%14 = fdiv float %12, %13
%15 = fadd float %9, %14
ret float %15
}

LLVM IR (-O2):
define float @boatAreaTest(float %0, float %1) {
%3 = fpext float %1 to double
%4 = tail call float @sqr(double %3)
%5 = tail call float @sqr(double 3.000000e+01)
%6 = fpext float %0 to double
%7 = tail call float @sqr(double %6)
%8 = tail call float @sqr(double 4.000000e+01)
%9 = insertelement <2 x float> poison, float %4, i64 0
%10 = insertelement <2 x float> %9, float %7, i64 1
%11 = insertelement <2 x float> poison, float %5, i64 0
%12 = insertelement <2 x float> %11, float %8, i64 1
%13 = fdiv <2 x float> %10, %12
%14 = shufflevector <2 x float> %13, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%15 = fadd <2 x float> %13, %14
%16 = extractelement <2 x float> %15, i64 0
ret float %16
}
void serial_init(void) {}


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

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

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

LLVM IR (-O2):
define void @serial_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 0;
  char *s = "haha";
  for (i = 0; *(s + i) != '\0'; i++)
    ;
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <main+0x50>
jmp    1152 <main+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <main+0x28>
mov    -0x8(%rbp),%esi
lea    0xe9b(%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
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @pthread_attr_getschedparam() {
ret void
}
void __config_locale_override(void) {}


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

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

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

LLVM IR (-O2):
define void @__config_locale_override() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int yyerror() {
  printf("\nInvalid string!!");
  printf("\nExiting...");
  exit(0);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"\0AInvalid string!!\00"
@.str.1 = [12 x i8] c"\0AExiting...\00"
define i32 @yyerror() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0AInvalid string!!\00"
@.str.1 = [12 x i8] c"\0AExiting...\00"
define i32 @yyerror() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
unsigned int foo(unsigned int x) {
  return (x >> 24) | ((x >> 8) & 0xff00) | ((x << 8) & 0xff0000) | (x << 24);
}


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

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = load i32, i32* %2
%6 = lshr i32 %5, 8
%7 = and i32 %6, 65280
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
%11 = and i32 %10, 16711680
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = shl i32 %13, 24
%15 = or i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EA_AY_PD_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int /*<<< orphan*/);
void m68k_op_sf_8_pd(void) { m68ki_write_8(EA_AY_PD_8(), 0); }


x86 assembly (clang, -O0):
<m68k_op_sf_8_pd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_AY_PD_8@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <m68ki_write_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sf_8_pd>:
push   %rax
xor    %eax,%eax
call   1030 <EA_AY_PD_8@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sf_8_pd() {
%1 = call i32 (...) @EA_AY_PD_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sf_8_pd() {
%1 = tail call i32 (...) @EA_AY_PD_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 0)
ret void
}
int test_imm_EDint8_reg(signed char val) {
  return ((val) & (0xED << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EDint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xed,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_EDint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 237
%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_EDint8_reg(i8 signext %0) {
%2 = and i8 %0, -19
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
scalar_t__ random();
int main(void) {
  static int element;
  while (element++ < 10)
    printf("%d ", (int)random());
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ef7(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2eec(%rip)
cmp    $0xa,%eax
jge    1173 <main+0x43>
mov    $0x0,%al
call   1050 <random@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2f05(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2efc(%rip)
cmp    $0x9,%eax
jg     1175 <main+0x45>
lea    0xeb4(%rip),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <random@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2ed5(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2ecc(%rip)
cmp    $0xa,%eax
jl     1150 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@main.element = internal unnamed_addr global i32 0
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = load i32, i32* @main.element
%2 = add nsw i32 %1, 1
store i32 %2, i32* @main.element
%3 = icmp slt i32 %1, 10
br i1 %3, label %4, label %11
4: ; preds = %0, %4
%5 = tail call i64 (...) @random()
%6 = trunc i64 %5 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @main.element
%9 = add nsw i32 %8, 1
store i32 %9, i32* @main.element
%10 = icmp slt i32 %8, 10
br i1 %10, label %4, label %11
11: ; preds = %4, %0
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Type definitions */
typedef int uint;
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
int contains_null_bytes(caddr_t addrp) {
  uint addr = (uint)addrp;
  return !(addr & 0xff && addr & 0xff00 && addr & 0xff0000 &&
           addr & 0xff000000);
}


x86 assembly (clang, -O0):
<contains_null_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1163 <contains_null_bytes+0x63>
mov    -0x8(%rbp),%ecx
and    $0xff00,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1163 <contains_null_bytes+0x63>
mov    -0x8(%rbp),%ecx
and    $0xff0000,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1163 <contains_null_bytes+0x63>
mov    -0x8(%rbp),%eax
and    $0xff000000,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains_null_bytes>:
test   %dil,%dil
sete   %al
test   $0xff00,%edi
sete   %cl
or     %al,%cl
test   $0xff0000,%edi
sete   %al
cmp    $0x1000000,%edi
setb   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @contains_null_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 255
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, 65280
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %3
%14 = and i32 %13, 16711680
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i32, i32* %3
%18 = and i32 %17, -16777216
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %16, %12, %8, %1
%21 = phi i1 [ false, %12 ], [ false, %8 ], [ false, %1 ], [ %19, %16 ]
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @contains_null_bytes(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 65280
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
%7 = and i32 %0, 16711680
%8 = icmp eq i32 %7, 0
%9 = or i1 %8, %6
%10 = icmp ult i32 %0, 16777216
%11 = or i1 %10, %9
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ load64_native(void const *);
__attribute__((always_)) uint64_t load64(const void *src) {
  return load64_native(src);
}


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

x86 assembly (clang, -O2):
<load64>:
jmp    1030 <load64_native@plt>

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

LLVM IR (-O2):
define i32 @load64(i8* %0) {
%2 = tail call i32 @load64_native(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int fun() {
  sleep(2);
  return 0;
}


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

x86 assembly (clang, -O2):
<fun>:
push   %rax
mov    $0x2,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fun() {
%1 = call i32 @sleep(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @fun() {
%1 = tail call i32 @sleep(i32 2)
ret i32 0
}
void free_dmatrix(double **m, int nr) {
  int i;
  for (i = 0; i < nr; i++)
    free(m[i]);
  free(m);
}


x86 assembly (clang, -O0):
<free_dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_dmatrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_dmatrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dmatrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_dmatrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_dmatrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_dmatrix(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(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
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outop0str(char *);
void defword() { outop0str("FDB\t"); }


x86 assembly (clang, -O0):
<defword>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <outop0str@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<defword>:
lea    0xee9(%rip),%rdi
jmp    1030 <outop0str@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"FDB\09\00"
define void @defword() {
%1 = call i32 @outop0str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"FDB\09\00"
define void @defword() {
%1 = tail call i32 @outop0str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void version() {
  printf("usbmonctl v%s - USB HID Monitor Control Utility\n", "1.3");
  printf("Copyright (c) 2012 Ondrej Zary - http://www.rainbow-software.org\n");
  printf("License: GLPv2\n");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf0f(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf02(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"usbmonctl v%s - USB HID Monitor Control Utility\0A\00"
@.str.1 = [4 x i8] c"1.3\00"
@.str.2 = [66 x i8] c"Copyright (c) 2012 Ondrej Zary - http://www.rainbow-software.org\0A\00"
@.str.3 = [16 x i8] c"License: GLPv2\0A\00"
define void @version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"usbmonctl v%s - USB HID Monitor Control Utility\0A\00"
@.str.1 = [4 x i8] c"1.3\00"
@str = [65 x i8] c"Copyright (c) 2012 Ondrej Zary - http://www.rainbow-software.org\00"
@str.4 = [15 x i8] c"License: GLPv2\00"
define void @version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
ret void
}
void gc_done(void) { return; }


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

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

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

LLVM IR (-O2):
define void @gc_done() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bonjour() { printf("Wello Horld!\n"); }


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

x86 assembly (clang, -O2):
<bonjour>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Wello Horld!\0A\00"
define void @bonjour() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Wello Horld!\00"
define void @bonjour() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
scalar_t__ pipe(int *);
void makePipe(int *readEnd, int *writeEnd) {
  int pipes[2];
  if (pipe(pipes) < 0) {
    die("pipe");
  }
  *readEnd = pipes[0];
  *writeEnd = pipes[1];
}


x86 assembly (clang, -O0):
<makePipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <pipe@plt>
cmp    $0x0,%rax
jge    114f <makePipe+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makePipe>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1030 <pipe@plt>
test   %rax,%rax
jns    1143 <makePipe+0x23>
lea    0xec2(%rip),%rdi
call   1040 <die@plt>
mov    (%rsp),%eax
mov    %eax,(%rbx)
mov    0x4(%rsp),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"pipe\00"
define void @makePipe(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = call i64 @pipe(i32* %5)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @die(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* %5
store i32 %11, i32* %0
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%13 = load i32, i32* %12
store i32 %13, i32* %1
ret void
}
int compare(const void *s, const void *t) {
  int comp = 1;
  double is = *(double *)s;
  double it = *(double *)t;
  if (is < it) {
    comp = -1;
  } else if (is == it) {
    comp = 0;
  }
  return comp;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114d <compare+0x4d>
movl   $0xffffffff,-0x14(%rbp)
jmp    116f <compare+0x6f>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    116a <compare+0x6a>
jp     116a <compare+0x6a>
movl   $0x0,-0x14(%rbp)
jmp    116f <compare+0x6f>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    $0xffffffff,%eax
ucomisd %xmm0,%xmm1
ja     111d <compare+0x1d>
ucomisd %xmm1,%xmm0
jne    111e <compare+0x1e>
jp     111e <compare+0x1e>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(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 olt double %4, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = fcmp oeq double %4, %6
br i1 %9, label %10, label %11
10: ; preds = %8
br label %11
11: ; preds = %2, %8, %10
%12 = phi i32 [ 0, %10 ], [ 1, %8 ], [ -1, %2 ]
ret i32 %12
}
extern void tracelevel(int level) {}


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

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

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

LLVM IR (-O2):
define void @tracelevel(i32 %0) {
ret void
}
/* Variables and functions */
double mod2pi(double);
double angle_error(double va, double vb) {
  return mod2pi(mod2pi(va) - mod2pi(vb));
}


x86 assembly (clang, -O0):
<angle_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <mod2pi@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <mod2pi@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1030 <mod2pi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle_error>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1030 <mod2pi@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <mod2pi@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
jmp    1030 <mod2pi@plt>

LLVM IR (-O0):
define double @angle_error(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @mod2pi(double %5)
%7 = load double, double* %4
%8 = call double @mod2pi(double %7)
%9 = fsub double %6, %8
%10 = call double @mod2pi(double %9)
ret double %10
}

LLVM IR (-O2):
define double @angle_error(double %0, double %1) {
%3 = tail call double @mod2pi(double %0)
%4 = tail call double @mod2pi(double %1)
%5 = fsub double %3, %4
%6 = tail call double @mod2pi(double %5)
ret double %6
}
/* Variables and functions */
int rand();
int toss(int p) { return (rand() % p) == 0 ? 1 : 0; }


x86 assembly (clang, -O0):
<toss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toss>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
xor    %eax,%eax
test   %edx,%edx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toss(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
define i32 @toss(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *argv0) {
  fprintf(stderr, "Usage: %s <interface to sniff> <...>", argv0);
  exit(2);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s <interface to sniff> <...>\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s <interface to sniff> <...>\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
double wts_qart(double r, double rbase, double p, double pbase) {
  if (p < 1e-5) {
    return ((r + rbase) * p);
  } else {
    return ((r + rbase) * (p + pbase) - rbase * pbase);
  }
}


x86 assembly (clang, -O0):
<wts_qart>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  0xee0(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1144 <wts_qart+0x44>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1186 <wts_qart+0x86>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
addsd  -0x28(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wts_qart>:
movsd  0xef8(%rip),%xmm4
ucomisd %xmm2,%xmm4
addsd  %xmm1,%xmm0
jbe    1117 <wts_qart+0x17>
mulsd  %xmm2,%xmm0
ret
addsd  %xmm3,%xmm2
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @wts_qart(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%10 = load double, double* %8
%11 = fcmp olt double %10, 1.000000e-05
br i1 %11, label %12, label %18
12: ; preds = %4
%13 = load double, double* %6
%14 = load double, double* %7
%15 = fadd double %13, %14
%16 = load double, double* %8
%17 = fmul double %15, %16
store double %17, double* %5
br label %30
18: ; preds = %4
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fadd double %19, %20
%22 = load double, double* %8
%23 = load double, double* %9
%24 = fadd double %22, %23
%25 = load double, double* %7
%26 = load double, double* %9
%27 = fmul double %25, %26
%28 = fneg double %27
%29 = call double @llvm.fmuladd.f64(double %21, double %24, double %28)
store double %29, double* %5
br label %30
30: ; preds = %18, %12
%31 = load double, double* %5
ret double %31
}

LLVM IR (-O2):
define double @wts_qart(double %0, double %1, double %2, double %3) {
%5 = fcmp olt double %2, 1.000000e-05
%6 = fadd double %0, %1
br i1 %5, label %7, label %9
7: ; preds = %4
%8 = fmul double %6, %2
br label %14
9: ; preds = %4
%10 = fadd double %2, %3
%11 = fneg double %1
%12 = fmul double %11, %3
%13 = tail call double @llvm.fmuladd.f64(double %6, double %10, double %12)
br label %14
14: ; preds = %9, %7
%15 = phi double [ %8, %7 ], [ %13, %9 ]
ret double %15
}
void sym_b(void) {}


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

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

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

LLVM IR (-O2):
define void @sym_b() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void help(void) {
  printf(
      "Usage: page-poisoning [OPTION]...\n"
      "Stress test for Linux HWPOISON Page Recovery with multiple processes.\n"
      "\n"
      "Mandatory arguments to long options are mandatory for short options "
      "too.\n"
      "  -C, --clean                record log and result in clean files.\n"
      "  -h                         print this page\n"
      "  -i, --child_num=NUM        spawn NUM processes to do test (default "
      "NUM = %d)\n"
      "  -l, --log=LOG              record logs to file LOG.\n"
      "  -r, --result=RESULT        record test result to file RESULT.\n"
      "  -s, --shmsize=SIZE         each shared memory segment is SIZE-page "
      "based.\n"
      "  -t, --tmpdir=DIR           create temporary files in DIR.\n\n",
      10000);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2710,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
lea    0xee9(%rip),%rdi
mov    $0x2710,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [625 x i8] c"Usage: page-poisoning [OPTION]...\0AStress test for Linux HWPOISON Page Recovery with multiple processes.\0A\0AMandatory arguments to long options are mandatory for short options too.\0A -C, --clean record log and result in clean files.\0A -h print this page\0A -i, --child_num=NUM spawn NUM processes to do test (default NUM = %d)\0A -l, --log=LOG record logs to file LOG.\0A -r, --result=RESULT record test result to file RESULT.\0A -s, --shmsize=SIZE each shared memory segment is SIZE-page based.\0A -t, --tmpdir=DIR create temporary files in DIR.\0A\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([625 x i8], [625 x i8]* @.str, i64 0, i64 0), i32 10000)
ret void
}

LLVM IR (-O2):
@.str = [625 x i8] c"Usage: page-poisoning [OPTION]...\0AStress test for Linux HWPOISON Page Recovery with multiple processes.\0A\0AMandatory arguments to long options are mandatory for short options too.\0A -C, --clean record log and result in clean files.\0A -h print this page\0A -i, --child_num=NUM spawn NUM processes to do test (default NUM = %d)\0A -l, --log=LOG record logs to file LOG.\0A -r, --result=RESULT record test result to file RESULT.\0A -s, --shmsize=SIZE each shared memory segment is SIZE-page based.\0A -t, --tmpdir=DIR create temporary files in DIR.\0A\0A\00"
define void @help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([625 x i8], [625 x i8]* @.str, i64 0, i64 0), i32 10000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FLEXSPI2_DriverIRQHandler();
__attribute__((weak)) void FLEXSPI2_IRQHandler(void) {
  FLEXSPI2_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @FLEXSPI2_IRQHandler() {
%1 = tail call i32 (...) @FLEXSPI2_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_material_ids(int *, int);
void fgmvwrite_material_ids_(int matids[], int *data_type) {
  gmvwrite_material_ids(matids, *data_type);
}


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

x86 assembly (clang, -O2):
<fgmvwrite_material_ids_>:
mov    (%rsi),%esi
jmp    1030 <gmvwrite_material_ids@plt>

LLVM IR (-O0):
define void @fgmvwrite_material_ids_(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 = load i32, i32* %6
%8 = call i32 @gmvwrite_material_ids(i32* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_material_ids_(i32* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @gmvwrite_material_ids(i32* %0, i32 %3)
ret void
}
void *thread_run(void *arg) { return (void *)0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @thread_run(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo();
int main() {
  const int n = foo();
#pragma omp taskwait
  assert(n == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @foo()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ casedjb2(unsigned char const *);
unsigned int hashCstrcasehash(const void *const x) {
  const char *const s = x;
  return (unsigned int)casedjb2((const unsigned char *)s);
}


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

x86 assembly (clang, -O2):
<hashCstrcasehash>:
jmp    1030 <casedjb2@plt>

LLVM IR (-O0):
define i32 @hashCstrcasehash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @casedjb2(i8* %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @hashCstrcasehash(i8* %0) {
%2 = tail call i64 @casedjb2(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fwrite(int *, int, int, int /*<<< orphan*/ *);
int fputc(int c, FILE *stream) {
  if (fwrite(&c, sizeof(char), 1, stream) == 0) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
cmp    $0x0,%rax
jne    1149 <fputc+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <fputc+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fputc(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** %5
%7 = call i64 @fwrite(i32* %4, i32 1, i32 1, i32* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %11
10: ; preds = %2
store i32 0, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @fputc(i32 %0, i32* nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 @fwrite(i32* %3, i32 1, i32 1, i32* %1)
%5 = icmp eq i64 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_server_get_address() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_server_get_address"
         "\n");
}


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

x86 assembly (clang, -O2):
<pa_socket_server_get_address>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_socket_server_get_address\0A\00"
define i32 @pa_socket_server_get_address() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_socket_server_get_address\00"
define i32 @pa_socket_server_get_address() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int config_apcli(int radio) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @config_apcli(i32 %0) {
ret i32 0
}
/* Variables and functions */
int LOG_CONS;
int /*<<< orphan*/ LOG_INFO;
int LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int mpk_init() {
  openlog("libmpk", LOG_PID | LOG_CONS, LOG_USER);
  syslog(LOG_INFO, "Initialized libmpk.");
  return 0;
}


x86 assembly (clang, -O0):
<mpk_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
or     (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    0xeba(%rip),%rdi
call   1040 <openlog@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <syslog@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpk_init>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
lea    0xebd(%rip),%rdi
call   1040 <openlog@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1030 <syslog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"libmpk\00"
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_USER = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [20 x i8] c"Initialized libmpk.\00"
define i32 @mpk_init() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_CONS
%3 = or i32 %1, %2
%4 = load i32, i32* @LOG_USER
%5 = call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @LOG_INFO
%7 = call i32 @syslog(i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"libmpk\00"
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_USER = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [20 x i8] c"Initialized libmpk.\00"
define i32 @mpk_init() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_CONS
%3 = or i32 %2, %1
%4 = load i32, i32* @LOG_USER
%5 = tail call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @LOG_INFO
%7 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ hang();
void main() {
  clear_screen();
  hang();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @clear_screen()
%2 = call i32 (...) @hang()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 (...) @hang()
ret void
}