xunge/DecIR huggingface dataset:
/* Variables and functions */
double RAND_MAX;
double rand();
int generate_aleatory(int min, int max) {
  return (int)(min + ((rand() * 1.0) / RAND_MAX) * (max - min + 1) + 0.5);
}


x86 assembly (clang, -O0):
<generate_aleatory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xecc(%rip),%xmm2
mulsd  %xmm2,%xmm0
mov    0x2ea1(%rip),%rax
divsd  (%rax),%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe98(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_aleatory>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eba(%rip),%rax
divsd  (%rax),%xmm0
sub    %ebp,%ebx
add    $0x1,%ebx
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rsp),%xmm1
addsd  0xeb4(%rip),%xmm1
cvttsd2si %xmm1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @generate_aleatory(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 = sitofp i32 %5 to double
%7 = call double (...) @rand()
%8 = fmul double %7, 1.000000e+00
%9 = load double, double* @RAND_MAX
%10 = fdiv double %8, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = sub nsw i32 %11, %12
%14 = add nsw i32 %13, 1
%15 = sitofp i32 %14 to double
%16 = call double @llvm.fmuladd.f64(double %10, double %15, double %6)
%17 = fadd double %16, 5.000000e-01
%18 = fptosi double %17 to i32
ret i32 %18
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @generate_aleatory(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = tail call double (...) @rand()
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = sub i32 1, %0
%8 = add i32 %7, %1
%9 = sitofp i32 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %6, double %9, double %3)
%11 = fadd double %10, 5.000000e-01
%12 = fptosi double %11 to i32
ret i32 %12
}
int test_imm_2Euint8_mem(unsigned char *val) {
  return ((*val) & (-0x2E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Euint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -46
%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_2Euint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -46
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_93uint16_reg(unsigned short val) {
  return ((val) & (0x93 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_93uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 147
%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_93uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 147
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memccpy(char *, char const *, int /*<<< orphan*/, size_t);
char *memset(char *, int /*<<< orphan*/, size_t);
size_t strlen(char *);
size_t strxfrm(char *dest, const char *src, size_t n) {
  dest = memset(dest, 0, n);
  memccpy(dest, src, 0, n);
  return strlen(dest);
}


x86 assembly (clang, -O0):
<strxfrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1050 <memccpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strxfrm>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    %r15,%rcx
call   1050 <memccpy@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i64 @strxfrm(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %6
%9 = call i8* @memset(i8* %7, i32 0, i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 @memccpy(i8* %10, i8* %11, i32 0, i64 %12)
%14 = load i8*, i8** %4
%15 = call i64 @strlen(i8* %14)
ret i64 %15
}

LLVM IR (-O2):
define i64 @strxfrm(i8* %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %2, i1 false)
%4 = tail call i32 @memccpy(i8* %0, i8* %1, i32 0, i64 %2)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %5
}
void McASPAMuteDisable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x48)))) &= ~(0x00000003u);
}


x86 assembly (clang, -O0):
<McASPAMuteDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x48,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffc,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPAMuteDisable>:
add    $0x48,%edi
andl   $0xfffffffc,(%rdi)
ret

LLVM IR (-O0):
define void @McASPAMuteDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 72
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -4
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @McASPAMuteDisable(i32 %0) {
%2 = add i32 %0, 72
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -4
store volatile i32 %6, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int intern_printf(int /*<<< orphan*/, int /*<<< orphan*/, char const *,
                  int /*<<< orphan*/);
int vprintf(const char *fmt, va_list ap) {
  return intern_printf(0, 0, fmt, ap);
}


x86 assembly (clang, -O0):
<vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <intern_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprintf>:
mov    %esi,%ecx
mov    %rdi,%rdx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <intern_printf@plt>

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

LLVM IR (-O2):
define i32 @vprintf(i8* %0, i32 %1) {
%3 = tail call i32 @intern_printf(i32 0, i32 0, i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("./../Files/11.sh");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"./../Files/11.sh\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"./../Files/11.sh\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void motion(int x, int y) {
  if (x > 0 && x < 800 && y > 0 && y < 600) {
  }
}


x86 assembly (clang, -O0):
<motion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113d <motion+0x3d>
cmpl   $0x320,-0x4(%rbp)
jge    113d <motion+0x3d>
cmpl   $0x0,-0x8(%rbp)
jle    113d <motion+0x3d>
cmpl   $0x258,-0x8(%rbp)
jge    113d <motion+0x3d>
jmp    113d <motion+0x3d>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @motion(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 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 800
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 600
br i1 %15, label %16, label %17
16: ; preds = %13
br label %17
17: ; preds = %16, %13, %10, %7, %2
ret void
}

LLVM IR (-O2):
define void @motion(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void for_loop_func() {
  for (int i = 1; i < 11; i++) {
    printf("%d\n", i);
  }
}


x86 assembly (clang, -O0):
<for_loop_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0xb,-0x4(%rbp)
jge    1146 <for_loop_func+0x36>
mov    -0x4(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <for_loop_func+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<for_loop_func>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @for_loop_func() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
ret void
}
float etna_clampf(float x) {
  if (x < 0.0f)
    return 0.0f;
  else if (x > 1.0f)
    return 1.0f;
  else
    return x;
}


x86 assembly (clang, -O0):
<etna_clampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1123 <etna_clampf+0x23>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1155 <etna_clampf+0x55>
movss  -0x8(%rbp),%xmm0
movss  0xed0(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    114b <etna_clampf+0x4b>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1155 <etna_clampf+0x55>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<etna_clampf>:
movss  0xef8(%rip),%xmm1
minss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm2,%xmm0
andnps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @etna_clampf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %0
%5 = select i1 %2, float 0.000000e+00, float %4
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int write_be_24(int val, FILE *fp) {
  unsigned char c[3];
  c[0] = (val >> 16) & 0xFFL;
  c[1] = (val >> 8) & 0xFFL;
  c[2] = val & 0xFFL;
  return fwrite(c, 1, 3, fp);
}


x86 assembly (clang, -O0):
<write_be_24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
cltq
and    $0xff,%rax
mov    %al,-0x13(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
cltq
and    $0xff,%rax
mov    %al,-0x12(%rbp)
movslq -0x4(%rbp),%rax
and    $0xff,%rax
mov    %al,-0x11(%rbp)
lea    -0x13(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_be_24>:
push   %rax
mov    %rsi,%rcx
mov    %edi,%eax
mov    %edi,%edx
shr    $0x10,%edx
mov    %dl,0x5(%rsp)
mov    %ah,0x6(%rsp)
mov    %al,0x7(%rsp)
lea    0x5(%rsp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <fwrite@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @write_be_24(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [3 x i8]
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = ashr i32 %6, 16
%8 = sext i32 %7 to i64
%9 = and i64 %8, 255
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
store i8 %10, i8* %11
%12 = load i32, i32* %3
%13 = ashr i32 %12, 8
%14 = sext i32 %13 to i64
%15 = and i64 %14, 255
%16 = trunc i64 %15 to i8
%17 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
store i8 %16, i8* %17
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = and i64 %19, 255
%21 = trunc i64 %20 to i8
%22 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 2
store i8 %21, i8* %22
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%24 = load i32*, i32** %4
%25 = call i32 @fwrite(i8* %23, i32 1, i32 3, i32* %24)
ret i32 %25
}

LLVM IR (-O2):
define i32 @write_be_24(i32 %0, i32* nocapture %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
store i8 %6, i8* %4
%7 = lshr i32 %0, 8
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %8, i8* %9
%10 = trunc i32 %0 to i8
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 %10, i8* %11
%12 = call i32 @fwrite(i8* %4, i32 1, i32 3, i32* %1)
ret i32 %12
}
const char *get_screenshots_path() { return "./screenshots"; }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"./screenshots\00"
define i8* @get_screenshots_path() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double momrand_genrand_int32();
double momrand_genrand_real2(void) {
  return momrand_genrand_int32() * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<momrand_genrand_real2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <momrand_genrand_int32@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<momrand_genrand_real2>:
push   %rax
xor    %eax,%eax
call   1030 <momrand_genrand_int32@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @momrand_genrand_real2() {
%1 = call double (...) @momrand_genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}

LLVM IR (-O2):
define double @momrand_genrand_real2() {
%1 = tail call double (...) @momrand_genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}
/* Variables and functions */
char const *getenv(char const *);
const char *mygetenv(const char *var) { return getenv(var); }


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

x86 assembly (clang, -O2):
<mygetenv>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @mygetenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
void gtk_tree_view_set_fixed_height_mode() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_set_fixed_height_mode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chi(unsigned short *);
int /*<<< orphan*/ iota(unsigned short *, unsigned int);
int /*<<< orphan*/ pi(unsigned short *);
int /*<<< orphan*/ rho(unsigned short *);
int /*<<< orphan*/ theta(unsigned short *);
void Round400(unsigned short *state, unsigned int rnd) {
  theta(state);
  rho(state);
  pi(state);
  chi(state);
  iota(state, rnd);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <theta@plt>
mov    -0x8(%rbp),%rdi
call   1050 <rho@plt>
mov    -0x8(%rbp),%rdi
call   1070 <pi@plt>
mov    -0x8(%rbp),%rdi
call   1030 <chi@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <iota@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <theta@plt>
mov    %rbx,%rdi
call   1050 <rho@plt>
mov    %rbx,%rdi
call   1070 <pi@plt>
mov    %rbx,%rdi
call   1030 <chi@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <iota@plt>

LLVM IR (-O0):
define void @Round400(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = load i16*, i16** %3
%6 = call i32 @theta(i16* %5)
%7 = load i16*, i16** %3
%8 = call i32 @rho(i16* %7)
%9 = load i16*, i16** %3
%10 = call i32 @pi(i16* %9)
%11 = load i16*, i16** %3
%12 = call i32 @chi(i16* %11)
%13 = load i16*, i16** %3
%14 = load i32, i32* %4
%15 = call i32 @iota(i16* %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @Round400(i16* %0, i32 %1) {
%3 = tail call i32 @theta(i16* %0)
%4 = tail call i32 @rho(i16* %0)
%5 = tail call i32 @pi(i16* %0)
%6 = tail call i32 @chi(i16* %0)
%7 = tail call i32 @iota(i16* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ murmur3(int /*<<< orphan*/, char const *,
                           int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
uint32_t murmur3_str(uint32_t hash, const char *val) {
  return murmur3(hash, val, strlen(val));
}


x86 assembly (clang, -O0):
<murmur3_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <murmur3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<murmur3_str>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <murmur3@plt>

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

LLVM IR (-O2):
define i32 @murmur3_str(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @murmur3(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ SHA256_CTX;

/* Variables and functions */
int /*<<< orphan*/ sha256_block(int /*<<< orphan*/ *, void const *, size_t,
                                int /*<<< orphan*/);
void sha256_block_data_order(SHA256_CTX *ctx, const void *in, size_t num) {
  sha256_block(ctx, in, num, 0);
}


x86 assembly (clang, -O0):
<sha256_block_data_order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <sha256_block@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha256_block_data_order>:
xor    %ecx,%ecx
jmp    1030 <sha256_block@plt>

LLVM IR (-O0):
define void @sha256_block_data_order(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @sha256_block(i32* %7, i8* %8, i64 %9, i32 0)
ret void
}

LLVM IR (-O2):
define void @sha256_block_data_order(i32* %0, i8* %1, i64 %2) {
%4 = tail call i32 @sha256_block(i32* %0, i8* %1, i64 %2, i32 0)
ret void
}
/* Variables and functions */
unsigned long _LE_to_BE_long(int /*<<< orphan*/);
void outsl(int port, long *ptr, int len) {
  unsigned long *io_ptr = (unsigned long *)(((unsigned long)0x80000000) + port);
  while (len-- > 0) {
    *io_ptr = _LE_to_BE_long(*ptr++);
  }
}


x86 assembly (clang, -O0):
<outsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x80000000,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jle    1173 <outsl+0x63>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %eax,%edi
call   1030 <_LE_to_BE_long@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
jmp    1137 <outsl+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsl>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1147 <outsl+0x37>
mov    %edx,%ebp
mov    %rsi,%rbx
movslq %edi,%r14
add    $0x1,%ebp
mov    $0x80000000,%r15d
nopl   0x0(%rax)
mov    (%rbx),%edi
add    $0x8,%rbx
call   1030 <_LE_to_BE_long@plt>
mov    %rax,(%r14,%r15,1)
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <outsl+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @outsl(i32 %0, i64* nocapture %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = add nsw i64 %4, 2147483648
%6 = inttoptr i64 %5 to i64*
%7 = icmp sgt i32 %2, 0
br i1 %7, label %8, label %17
8: ; preds = %3, %8
%9 = phi i64* [ %12, %8 ], [ %1, %3 ]
%10 = phi i32 [ %11, %8 ], [ %2, %3 ]
%11 = add nsw i32 %10, -1
%12 = getelementptr inbounds i64, i64* %9, i64 1
%13 = load i64, i64* %9
%14 = trunc i64 %13 to i32
%15 = tail call i64 @_LE_to_BE_long(i32 %14)
store i64 %15, i64* %6
%16 = icmp ugt i32 %10, 1
br i1 %16, label %8, label %17
17: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __gcov_flush();
void flush_gcov() { __gcov_flush(); }


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

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

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

LLVM IR (-O2):
define void @flush_gcov() {
%1 = tail call i32 (...) @__gcov_flush()
ret void
}
/* Variables and functions */
char *getenv(char const *);
char *strdup(char *);
char *pyi_getenv(const char *variable) {
  char *env = NULL;
  env = getenv(variable);
  return (env && env[0]) ? strdup(env) : NULL;
}


x86 assembly (clang, -O0):
<pyi_getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116e <pyi_getenv+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116e <pyi_getenv+0x4e>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    1179 <pyi_getenv+0x59>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1179 <pyi_getenv+0x59>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pyi_getenv>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
je     1139 <pyi_getenv+0x19>
cmpb   $0x0,(%rax)
je     1139 <pyi_getenv+0x19>
mov    %rax,%rdi
pop    %rax
jmp    1040 <strdup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @pyi_getenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load i8*, i8** %3
%16 = call i8* @strdup(i8* %15)
br label %18
17: ; preds = %8, %1
br label %18
18: ; preds = %17, %14
%19 = phi i8* [ %16, %14 ], [ null, %17 ]
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @pyi_getenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i8* @strdup(i8* %2)
br label %9
9: ; preds = %1, %4, %7
%10 = phi i8* [ %8, %7 ], [ null, %4 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
char *gs_c_rtrim(char *, char *);
char *gs_rtrim(char *str) { return gs_c_rtrim(str, " \t\v\r\n\f"); }


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

x86 assembly (clang, -O2):
<gs_rtrim>:
lea    0xee9(%rip),%rsi
jmp    1030 <gs_c_rtrim@plt>

LLVM IR (-O0):
@.str = [7 x i8] c" \09\0B\0D\0A\0C\00"
define i8* @gs_rtrim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @gs_c_rtrim(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [7 x i8] c" \09\0B\0D\0A\0C\00"
define i8* @gs_rtrim(i8* %0) {
%2 = tail call i8* @gs_c_rtrim(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int test_imm_12int16_reg(short val) {
  return ((val) & (-0x12 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_12int16_reg>:
test   $0xffee,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_12int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -18
%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_12int16_reg(i16 signext %0) {
%2 = and i16 %0, -18
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_help(const char *program) {
  fprintf(stderr, "Usage: %s <replay_pid> [-h]\n", program);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: %s <replay_pid> [-h]\0A\00"
define void @print_help(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 ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: %s <replay_pid> [-h]\0A\00"
define void @print_help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void sysc_cleanup(struct pci_access *a) {}


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

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

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

LLVM IR (-O2):
%struct.pci_access = type opaque
define void @sysc_cleanup(%struct.pci_access* nocapture %0) {
ret void
}
const char *loader_GPF_get_name(void) {
  return "loader for GEMINI-Emulator files";
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"loader for GEMINI-Emulator files\00"
define i8* @loader_GPF_get_name() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [33 x i8] c"loader for GEMINI-Emulator files\00"
define i8* @loader_GPF_get_name() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct _Locale_monetary {
  int dummy;
};

/* Variables and functions */
char _Locale_mon_thousands_sep(struct _Locale_monetary *lmon) { return ','; }


x86 assembly (clang, -O0):
<_Locale_mon_thousands_sep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x2c,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_mon_thousands_sep>:
mov    $0x2c,%al
ret

LLVM IR (-O0):
%struct._Locale_monetary = type { i32 }
define signext i8 @_Locale_mon_thousands_sep(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
ret i8 44
}

LLVM IR (-O2):
%struct._Locale_monetary = type { i32 }
define signext i8 @_Locale_mon_thousands_sep(%struct._Locale_monetary* nocapture readnone %0) {
ret i8 44
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int j;
  int z;
  int res;
  res = 0;
  i = 0;
  z = 0;
  if (i) {
    if (j) {
    } else {
    }
  } else {
    if (z) {
    } else {
      res = 1;
    }
  }
  assert(!res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1157 <main+0x47>
cmpl   $0x0,-0xc(%rbp)
je     114d <main+0x3d>
jmp    1152 <main+0x42>
jmp    1152 <main+0x42>
jmp    1172 <main+0x62>
cmpl   $0x0,-0x10(%rbp)
je     1166 <main+0x56>
jmp    116d <main+0x5d>
movl   $0x1,-0x14(%rbp)
jmp    1172 <main+0x62>
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %2
store i32 0, i32* %4
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %13
12: ; preds = %8
br label %13
13: ; preds = %12, %11
br label %20
14: ; preds = %0
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
br label %19
18: ; preds = %14
store i32 1, i32* %5
br label %19
19: ; preds = %18, %17
br label %20
20: ; preds = %19, %13
%21 = load i32, i32* %5
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ f(int, int, int, int, int, int, char);
int main(void) {
  if (f(1, 2, -3, true, true, true, '\001'))
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%r9d
mov    $0x2,%esi
mov    $0xfffffffd,%edx
mov    %r9d,%edi
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x1,(%rsp)
call   1040 <f@plt>
cmp    $0x0,%rax
je     1175 <main+0x45>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,(%rsp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0xfffffffd,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1040 <f@plt>
test   %rax,%rax
jne    1169 <main+0x39>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @f(i32 1, i32 2, i32 -3, i32 1, i32 1, i32 1, i8 signext 1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @f(i32 1, i32 2, i32 -3, i32 1, i32 1, i32 1, i8 signext 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
int compareIntegers(const void *a, const void *b) {
  const int *da = (const int *)a;
  const int *db = (const int *)b;
  return ((*da > *db) - (*da < *db));
}


x86 assembly (clang, -O0):
<compareIntegers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x20(%rbp),%rdx
cmp    (%rdx),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareIntegers>:
mov    (%rdi),%ecx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%ecx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @compareIntegers(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp sgt i32 %12, %14
%16 = zext i1 %15 to i32
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = icmp slt i32 %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @compareIntegers(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i32 %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
unsigned char *deserialize_char(char *dest, unsigned char *src, int len) {
  assert(dest);
  assert(src);
  assert(len);
  memcpy(dest, src, len);
  src += len;
  return src;
}


x86 assembly (clang, -O0):
<deserialize_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deserialize_char>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <assert@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <assert@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <assert@plt>
movslq %ebp,%rbp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1040 <memcpy@plt>
add    %rbp,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @deserialize_char(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %7)
%9 = load i8*, i8** %5
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %9)
%11 = load i32, i32* %6
%12 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = load i32, i32* %6
%18 = load i8*, i8** %5
%19 = sext i32 %17 to i64
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8* %20, i8** %5
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @deserialize_char(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %0)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %1)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %2)
%7 = sext i32 %2 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %7, i1 false)
%8 = getelementptr inbounds i8, i8* %1, i64 %7
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
void traitement_signal(int sig) {
  printf("Signal %d reçu\n", sig);
  int status;
  waitpid(-1, &status, WNOHANG);
}


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
call   1040 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Signal %d re\C3\A7u\0A\00"
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %3, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Signal %d re\C3\A7u\0A\00"
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = alloca i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 -1, i32* %2, i32 %5)
ret void
}
/* Variables and functions */
int sc_strlen(char *);
int sc_strcmplen(char *T, char *S) {
  int tlen = sc_strlen(T);
  int slen = sc_strlen(S);
  if (tlen < slen)
    return -1;
  else if (tlen == slen)
    return 0;
  else if (tlen > slen)
    return 1;
  return 1;
}


x86 assembly (clang, -O0):
<sc_strcmplen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sc_strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <sc_strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1150 <sc_strcmplen+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1191 <sc_strcmplen+0x81>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1168 <sc_strcmplen+0x58>
movl   $0x0,-0x4(%rbp)
jmp    1191 <sc_strcmplen+0x81>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1180 <sc_strcmplen+0x70>
movl   $0x1,-0x4(%rbp)
jmp    1191 <sc_strcmplen+0x81>
jmp    1185 <sc_strcmplen+0x75>
jmp    118a <sc_strcmplen+0x7a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_strcmplen>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <sc_strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <sc_strlen@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sc_strcmplen(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 @sc_strlen(i8* %8)
store i32 %9, i32* %6
%10 = load i8*, i8** %5
%11 = call i32 @sc_strlen(i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %29
16: ; preds = %2
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %3
br label %29
21: ; preds = %16
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = icmp sgt i32 %22, %23
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 1, i32* %3
br label %29
26: ; preds = %21
br label %27
27: ; preds = %26
br label %28
28: ; preds = %27
store i32 1, i32* %3
br label %29
29: ; preds = %28, %25, %20, %15
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @sc_strcmplen(i8* %0, i8* %1) {
%3 = tail call i32 @sc_strlen(i8* %0)
%4 = tail call i32 @sc_strlen(i8* %1)
%5 = icmp slt i32 %3, %4
%6 = icmp ne i32 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
void WebServer_Stop() {}


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

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

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

LLVM IR (-O2):
define void @WebServer_Stop() {
ret void
}
int execute_rt_tgsigqueueinfo() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_rt_tgsigqueueinfo() {
ret i32 0
}
int do_354() { return 354; }


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

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

LLVM IR (-O0):
define i32 @do_354() {
ret i32 354
}

LLVM IR (-O2):
define i32 @do_354() {
ret i32 354
}
/* Variables and functions */
float bessj0(float);
float func(float x) { return bessj0(x); }


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

x86 assembly (clang, -O2):
<func>:
jmp    1030 <bessj0@plt>

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

LLVM IR (-O2):
define float @func(float %0) {
%2 = tail call float @bessj0(float %0)
ret float %2
}