xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ ceil(int /*<<< orphan*/);
int /*<<< orphan*/ log2(int);
int fixed_resolution(double epsilon) {
  return (int)(epsilon ? ceil(log2(1 / epsilon)) : 0);
}


x86 assembly (clang, -O0):
<fixed_resolution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114a <fixed_resolution+0x2a>
jp     114a <fixed_resolution+0x2a>
jmp    1170 <fixed_resolution+0x50>
movsd  0xeae(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log2@plt>
mov    %eax,%edi
call   1040 <ceil@plt>
mov    %rax,-0x10(%rbp)
jmp    117b <fixed_resolution+0x5b>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    117b <fixed_resolution+0x5b>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed_resolution>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112c <fixed_resolution+0xc>
jnp    114e <fixed_resolution+0x2e>
push   %rax
movsd  0xecb(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <log2@plt>
mov    %eax,%edi
call   1040 <ceil@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @fixed_resolution(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp une double %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load double, double* %2
%7 = fdiv double 1.000000e+00, %6
%8 = fptosi double %7 to i32
%9 = call i32 @log2(i32 %8)
%10 = call i64 @ceil(i32 %9)
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %5
%13 = phi i64 [ %10, %5 ], [ 0, %11 ]
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @fixed_resolution(double %0) {
%2 = fcmp une double %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = fdiv double 1.000000e+00, %0
%5 = fptosi double %4 to i32
%6 = tail call i32 @log2(i32 %5)
%7 = tail call i64 @ceil(i32 %6)
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
void prints(char *s) {
  while (*s != 0) {
    putc(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<prints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <prints+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <prints+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prints>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <prints+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <prints+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @prints(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putc(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ procedural_sine_timing_test(int);
int /*<<< orphan*/ waveform_initialise();
int /*<<< orphan*/ wavetable_sine_timing_test(int);
void waveform_timing_test(int count) {
  printf("*********************************************************************"
         "\n");
  printf("Waveform Timing Test\n");
  waveform_initialise();
  procedural_sine_timing_test(count);
  wavetable_sine_timing_test(count);
}


x86 assembly (clang, -O0):
<waveform_timing_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <waveform_initialise@plt>
mov    -0x4(%rbp),%edi
call   1040 <procedural_sine_timing_test@plt>
mov    -0x4(%rbp),%edi
call   1050 <wavetable_sine_timing_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waveform_timing_test>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <waveform_initialise@plt>
mov    %ebx,%edi
call   1040 <procedural_sine_timing_test@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <wavetable_sine_timing_test@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"*********************************************************************\0A\00"
@.str.1 = [22 x i8] c"Waveform Timing Test\0A\00"
define void @waveform_timing_test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @waveform_initialise()
%6 = load i32, i32* %2
%7 = call i32 @procedural_sine_timing_test(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @wavetable_sine_timing_test(i32 %8)
ret void
}

LLVM IR (-O2):
@str = [70 x i8] c"*********************************************************************\00"
@str.2 = [21 x i8] c"Waveform Timing Test\00"
define void @waveform_timing_test(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 (...) @waveform_initialise()
%5 = tail call i32 @procedural_sine_timing_test(i32 %0)
%6 = tail call i32 @wavetable_sine_timing_test(i32 %0)
ret void
}
void test_perror(const char *str) {}


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

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

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

LLVM IR (-O2):
define void @test_perror(i8* nocapture %0) {
ret void
}
const char *get_basic_type_asm_name(int size) {
  switch (size) {
  case 1:
    return "db";
  case 2:
    return "dw";
  case 4:
    return "dd";
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_basic_type_asm_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     113d <get_basic_type_asm_name+0x3d>
jmp    111b <get_basic_type_asm_name+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     114d <get_basic_type_asm_name+0x4d>
jmp    112c <get_basic_type_asm_name+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     115d <get_basic_type_asm_name+0x5d>
jmp    116d <get_basic_type_asm_name+0x6d>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <get_basic_type_asm_name+0x75>
lea    0xeaf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <get_basic_type_asm_name+0x75>
lea    0xea2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <get_basic_type_asm_name+0x75>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_basic_type_asm_name>:
add    $0xffffffff,%edi
cmp    $0x3,%edi
ja     1117 <get_basic_type_asm_name+0x17>
movslq %edi,%rax
lea    0x2d1e(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"db\00"
@.str.1 = [3 x i8] c"dw\00"
@.str.2 = [3 x i8] c"dd\00"
define i8* @get_basic_type_asm_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 1, label %5
i32 2, label %6
i32 4, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* null, i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"db\00"
@.str.1 = [3 x i8] c"dw\00"
@.str.2 = [3 x i8] c"dd\00"
@switch.table.get_basic_type_asm_name = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)]
define i8* @get_basic_type_asm_name(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i8*], [4 x i8*]* @switch.table.get_basic_type_asm_name, i64 0, i64 %5
%7 = load i8*, i8** %6
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void dumpBuf(unsigned char *buf, int len) {
  int i = 0;
  for (i = 0; i < len; i++) {
    printf("%02X", buf[i]);
  }
}


x86 assembly (clang, -O0):
<dumpBuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <dumpBuf+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <dumpBuf+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpBuf>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <dumpBuf+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <dumpBuf+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%02X\00"
define void @dumpBuf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %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 i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
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
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02X\00"
define void @dumpBuf(i8* 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 i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int main() {
  int *t = 0x1;
  *t = 1;
  if (*t == 1) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1137 <main+0x37>
movl   $0x0,-0x4(%rbp)
jmp    113e <main+0x3e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x1,0x1
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
store i32 1, i32* inttoptr (i64 1 to i32*)
ret i32 0
}
int test_imm_7Auint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x7A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Auint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 122
%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_7Auint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7995392
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int tegra_sleep_core(unsigned long v2p) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tegra_sleep_core(i64 %0) {
ret i32 0
}
int lower(int c) {
  (c = (c >= 'A' && c <= 'Z')) ? (c + 'a' - 'A') : c;
  return c;
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <lower+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x4(%rbp)
test   $0x1,%al
jne    113b <lower+0x3b>
jmp    1149 <lower+0x49>
mov    -0x4(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
jmp    114c <lower+0x4c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @lower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
store i32 %10, i32* %2
br i1 %9, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 97
%14 = sub nsw i32 %13, 65
br label %17
15: ; preds = %8
%16 = load i32, i32* %2
br label %17
17: ; preds = %15, %11
%18 = phi i32 [ %14, %11 ], [ %16, %15 ]
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int sqrt(double);
int32_t FixedSqrtHP(int32_t n) { return (int32_t)(sqrt((double)n) * 256); }


x86 assembly (clang, -O0):
<FixedSqrtHP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
shl    $0x8,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FixedSqrtHP>:
push   %rax
cvtsi2sd %rdi,%xmm0
call   1030 <sqrt@plt>
shl    $0x8,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @FixedSqrtHP(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = call i32 @sqrt(double %4)
%6 = mul nsw i32 %5, 256
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @FixedSqrtHP(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = tail call i32 @sqrt(double %2)
%4 = shl nsw i32 %3, 8
%5 = sext i32 %4 to i64
ret i64 %5
}
double max(double a, double b) {
  if (b > a)
    return b;
  return a;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <max+0x2d>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <max+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
float __rtl_cos_f32_v1_00(float);
float rtl_cos_f32(float a) { return __rtl_cos_f32_v1_00(a); }


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

x86 assembly (clang, -O2):
<rtl_cos_f32>:
jmp    1030 <__rtl_cos_f32_v1_00@plt>

LLVM IR (-O0):
define float @rtl_cos_f32(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__rtl_cos_f32_v1_00(float %3)
ret float %4
}

LLVM IR (-O2):
define float @rtl_cos_f32(float %0) {
%2 = tail call float @__rtl_cos_f32_v1_00(float %0)
ret float %2
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int clear_dobldobl_tracker(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(510, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<clear_dobldobl_tracker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1fe,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_dobldobl_tracker>:
mov    $0x1fe,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @clear_dobldobl_tracker() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 510, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_dobldobl_tracker() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 510, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void myprint(const char *text, size_t textlength) {
  for (size_t i = 0; i < textlength; ++i) {
    printf("%02X", text[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<myprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1161 <myprint+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <myprint+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myprint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1158 <myprint+0x38>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <myprint+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02X\00"
define void @myprint(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %12, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw i64 %7, 1
%13 = icmp eq i64 %12, %1
br i1 %13, label %4, label %6
}
/* Variables and functions */
int alarm(int);
int Ualarm(int usecs) {
  if (1 <= usecs / 1000000)
    return alarm(usecs / 1000000);
  else
    return alarm(1);
}


x86 assembly (clang, -O0):
<Ualarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jg     114f <Ualarm+0x3f>
mov    -0x8(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <alarm@plt>
mov    %eax,-0x4(%rbp)
jmp    115c <Ualarm+0x4c>
mov    $0x1,%edi
call   1030 <alarm@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ualarm>:
mov    %edi,%eax
mov    $0x1,%edi
cmp    $0xf4240,%eax
jl     112b <Ualarm+0x1b>
mov    %eax,%eax
imul   $0x431bde83,%rax,%rdi
shr    $0x32,%rdi
jmp    1030 <alarm@plt>

LLVM IR (-O0):
define i32 @Ualarm(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 1000000
%6 = icmp sle i32 1, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 1000000
%10 = call i32 @alarm(i32 %9)
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = call i32 @alarm(i32 1)
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @Ualarm(i32 %0) {
%2 = icmp sgt i32 %0, 999999
%3 = udiv i32 %0, 1000000
%4 = select i1 %2, i32 %3, i32 1
%5 = tail call i32 @alarm(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ on_exit(void (*)(), int /*<<< orphan*/);
int atexit(void (*f)()) {
  on_exit(f, 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @atexit(void (...)* %0) {
%2 = tail call i32 @on_exit(void (...)* %0, i32 0)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long selection;
};
typedef TYPE_1__ XSelectionEvent;

/* Variables and functions */
void set_XSelectionEvent_selection(void *_p, unsigned long _v) {
  ((XSelectionEvent *)_p)->selection = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XSelectionEvent_selection>:
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_XSelectionEvent_selection>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XSelectionEvent_selection(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void gtk_main_quit() {}


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

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

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

LLVM IR (-O2):
define void @gtk_main_quit() {
ret void
}
/* Variables and functions */
char getchar();
scalar_t__ malloc(int);
char *readString() {
  char *s;
  char c;
  s = (char *)malloc(1024 + 1);
  int i = 0;
  while ((c = getchar()) != '\n') {
    s[i++] = c;
  }
  return s;
}


x86 assembly (clang, -O0):
<readString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x401,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1170 <readString+0x50>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    113d <readString+0x1d>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readString>:
push   %r14
push   %rbx
push   %rax
mov    $0x401,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1151 <readString+0x31>
mov    %r14,%rbx
nop
mov    %al,(%rbx)
xor    %eax,%eax
call   1030 <getchar@plt>
add    $0x1,%rbx
cmp    $0xa,%al
jne    1140 <readString+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @readString() {
%1 = alloca i8*
%2 = alloca i8
%3 = alloca i32
%4 = call i64 @malloc(i32 1025)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %1
store i32 0, i32* %3
br label %6
6: ; preds = %10, %0
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8, i8* %2
%12 = load i8*, i8** %1
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = sext i32 %13 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
store i8 %11, i8* %16
br label %6
17: ; preds = %6
%18 = load i8*, i8** %1
ret i8* %18
}

LLVM IR (-O2):
define i8* @readString() {
%1 = tail call i64 @malloc(i32 1025)
%2 = inttoptr i64 %1 to i8*
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %12, label %5
5: ; preds = %0, %5
%6 = phi i64 [ %8, %5 ], [ 0, %0 ]
%7 = phi i8 [ %10, %5 ], [ %3, %0 ]
%8 = add nuw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %2, i64 %6
store i8 %7, i8* %9
%10 = tail call signext i8 (...) @getchar()
%11 = icmp eq i8 %10, 10
br i1 %11, label %12, label %5
12: ; preds = %5, %0
ret i8* %2
}
int test_imm_5Eint8_mem(signed char *val) {
  return ((*val) & (-0x5E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Eint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -94
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float t21(long double x) {
  register float result;
  __asm __volatile("frndint" : "=t"(result) : "0"(x));
  return result;
}


x86 assembly (clang, -O0):
<t21>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
frndint
fstps  -0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<t21>:
fldt   0x8(%rsp)
frndint
fstps  -0x4(%rsp)
movss  -0x4(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @t21(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca float
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 asm sideeffect "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4)
%6 = fptrunc x86_fp80 %5 to float
store float %6, float* %3
%7 = load float, float* %3
ret float %7
}

LLVM IR (-O2):
define float @t21(x86_fp80 %0) {
%2 = tail call x86_fp80 asm sideeffect "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
%3 = fptrunc x86_fp80 %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ inplace_swap(int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 1, b = 2;
  printf("a %d, b %d\n", a, b);
  inplace_swap(&a, &b);
  printf("swap: a %d, b %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <inplace_swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
movl   $0x2,(%rsp)
lea    0xecf(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <inplace_swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"a %d, b %d\0A\00"
@.str.1 = [18 x i8] c"swap: a %d, b %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
%6 = call i32 @inplace_swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sysv_daemonize();
int main(int argc, char *argv[]) {
  sysv_daemonize();
  printf("Daemonzied");
  sleep(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)
mov    $0x0,%al
call   1030 <sysv_daemonize@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    $0x14,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sysv_daemonize@plt>
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x14,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Daemonzied\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 (...) @sysv_daemonize()
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @sleep(i32 20)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Daemonzied\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sysv_daemonize()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 20)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m512i;

/* Variables and functions */
void _mm512_storeu_epi16(void *, int /*<<< orphan*/);
void test_mm512_storeu_epi16(void *__P, __m512i __A) {
  return _mm512_storeu_epi16(__P, __A);
}


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

x86 assembly (clang, -O2):
<test_mm512_storeu_epi16>:
jmp    1030 <_mm512_storeu_epi16@plt>

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

LLVM IR (-O2):
define void @test_mm512_storeu_epi16(i8* %0, i32 %1) {
tail call void @_mm512_storeu_epi16(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __emit_string_literal_range(char *, int, int, int);
void test_U(void) { __emit_string_literal_range(U"0123456789", 6, 4, 7); }


x86 assembly (clang, -O0):
<test_U>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x6,%esi
mov    $0x4,%edx
mov    $0x7,%ecx
call   1030 <__emit_string_literal_range@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_U>:
lea    0xee9(%rip),%rdi
mov    $0x6,%esi
mov    $0x4,%edx
mov    $0x7,%ecx
jmp    1030 <__emit_string_literal_range@plt>

LLVM IR (-O0):
@.str = [11 x i32] [i32 48, i32 49, i32 50, i32 51, i32 52, i32 53, i32 54, i32 55, i32 56, i32 57, i32 0]
define void @test_U() {
%1 = call i32 @__emit_string_literal_range(i8* bitcast ([11 x i32]* @.str to i8*), i32 6, i32 4, i32 7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i32] [i32 48, i32 49, i32 50, i32 51, i32 52, i32 53, i32 54, i32 55, i32 56, i32 57, i32 0]
define void @test_U() {
%1 = tail call i32 @__emit_string_literal_range(i8* bitcast ([11 x i32]* @.str to i8*), i32 6, i32 4, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  printf("Enter number:\n");
  scanf("%d", &number);
  is_prime(number);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [14 x i8] c"Enter number:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @is_prime(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  for (int i = 0; i < 81; i++) {
    printf("cat_knockout%04d.jpg\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x51,-0x14(%rbp)
jge    1154 <main+0x44>
mov    -0x14(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x51,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"cat_knockout%04d.jpg\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %4
3: ; preds = %4
ret i32 0
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %7, %4 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 81
br i1 %8, label %3, label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ encode_u32le(int /*<<< orphan*/ **, scalar_t__);
void encode_s32le(uint8_t **cursor, int32_t val) {
  encode_u32le(cursor, (int32_t)val);
}


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

x86 assembly (clang, -O2):
<encode_s32le>:
jmp    1030 <encode_u32le@plt>

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

LLVM IR (-O2):
define void @encode_s32le(i32** %0, i64 %1) {
%3 = tail call i32 @encode_u32le(i32** %0, i64 %1)
ret void
}
/* Variables and functions */
int no_declaration() { return 3; }


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

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

LLVM IR (-O0):
define i32 @no_declaration() {
ret i32 3
}

LLVM IR (-O2):
define i32 @no_declaration() {
ret i32 3
}
char ft_tolower(char c) {
  c = c + 32;
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @ft_tolower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, 32
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @ft_tolower(i8 signext %0) {
%2 = add i8 %0, 32
ret i8 %2
}
void __attribute__((__warning__(
    "curl_easy_setopt expects a curl_conv_callback argument for this option")))
__attribute__((__unused__)) __attribute__((__no__))
_curl_easy_setopt_err_conv_cb(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_conv_cb() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aes_gcm_decrypt();
int /*<<< orphan*/ aes_gcm_encrypt();
int main(int argc, char **argv) {
  aes_gcm_encrypt();
  aes_gcm_decrypt();
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @aes_gcm_encrypt()
%4 = tail call i32 (...) @aes_gcm_decrypt()
ret i32 0
}
/* Type definitions */
struct ttrie__choice_table {
  int dummy;
};

/* Variables and functions */
int get_choice_table_row_count(struct ttrie__choice_table *);
bool choice_table_full(struct ttrie__choice_table *ct) {
  int depth = get_choice_table_row_count(ct);
  if (depth == 256)
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<choice_table_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_choice_table_row_count@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jne    1141 <choice_table_full+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <choice_table_full+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choice_table_full>:
push   %rax
call   1030 <get_choice_table_row_count@plt>
xor    %ecx,%ecx
cmp    $0x100,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ttrie__choice_table = type { i32 }
define i32 @choice_table_full(%struct.ttrie__choice_table* %0) {
%2 = alloca i32
%3 = alloca %struct.ttrie__choice_table*
%4 = alloca i32
store %struct.ttrie__choice_table* %0, %struct.ttrie__choice_table** %3
%5 = load %struct.ttrie__choice_table*, %struct.ttrie__choice_table** %3
%6 = call i32 @get_choice_table_row_count(%struct.ttrie__choice_table* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 256
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.ttrie__choice_table = type { i32 }
define i32 @choice_table_full(%struct.ttrie__choice_table* %0) {
%2 = tail call i32 @get_choice_table_row_count(%struct.ttrie__choice_table* %0)
%3 = icmp eq i32 %2, 256
%4 = zext i1 %3 to i32
ret i32 %4
}
int get_a(int argc) { return argc + 1; }


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

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

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

LLVM IR (-O2):
define i32 @get_a(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void x6048029D00000000(signed char *text) {
  assert(text != NULL);
  printf("%s", text);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @x6048029D00000000(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @x6048029D00000000(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int IOLHD(int);
int vpu_ESDMISC_LHD(int disable) { return IOLHD(disable); }


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

x86 assembly (clang, -O2):
<vpu_ESDMISC_LHD>:
jmp    1030 <IOLHD@plt>

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

LLVM IR (-O2):
define i32 @vpu_ESDMISC_LHD(i32 %0) {
%2 = tail call i32 @IOLHD(i32 %0)
ret i32 %2
}