xunge/DecIR huggingface dataset:
void HibernateWriteComplete(void) {
  while (!((*((volatile unsigned long *)(0x400FC010))) & 0x80000000)) {
  }
}


x86 assembly (clang, -O0):
<HibernateWriteComplete>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <HibernateWriteComplete+0x9>
mov    $0x400fc010,%eax
mov    (%rax),%rax
movabs $0x80000000,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1134 <HibernateWriteComplete+0x34>
jmp    1139 <HibernateWriteComplete+0x39>
jmp    1109 <HibernateWriteComplete+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateWriteComplete>:
mov    0x400fc010,%rax
40
and    $0x80000000,%eax
test   %rax,%rax
je     1100 <HibernateWriteComplete>
ret

LLVM IR (-O0):
define void @HibernateWriteComplete() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%3 = and i64 %2, 2147483648
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @HibernateWriteComplete() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%3 = and i64 %2, 2147483648
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Variables and functions */
float sin(int);
float sine_wave(float A, float f, float t, float phi) {
  return A * sin(2 * 3.14159265358979 * f * t + phi);
}


x86 assembly (clang, -O0):
<sine_wave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine_wave>:
push   %rax
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xeda(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sine_wave(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = fpext float %10 to double
%12 = fmul double 0x401921FB54442D11, %11
%13 = load float, float* %7
%14 = fpext float %13 to double
%15 = load float, float* %8
%16 = fpext float %15 to double
%17 = call double @llvm.fmuladd.f64(double %12, double %14, double %16)
%18 = fptosi double %17 to i32
%19 = call float @sin(i32 %18)
%20 = fmul float %9, %19
ret float %20
}

LLVM IR (-O2):
define float @sine_wave(float %0, float %1, float %2, float %3) {
%5 = fpext float %1 to double
%6 = fmul double %5, 0x401921FB54442D11
%7 = fpext float %2 to double
%8 = fpext float %3 to double
%9 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %8)
%10 = fptosi double %9 to i32
%11 = tail call float @sin(i32 %10)
%12 = fmul float %11, %0
ret float %12
}
/* Variables and functions */
float sqrt(float const);
float v_length(const float *v) {
  return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
}


x86 assembly (clang, -O0):
<v_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_length>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113f <v_length+0x2f>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @v_length(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
%24 = call float @sqrt(float %23)
ret float %24
}

LLVM IR (-O2):
define float @v_length(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call float @sqrt(float %9)
ret float %10
}
/* Type definitions */
struct ehca_shca {
  int dummy;
};

/* Variables and functions */
int ehca_get_max_hwpage_size(struct ehca_shca *);
int y(struct ehca_shca *shca) { return ehca_get_max_hwpage_size(shca); }


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

x86 assembly (clang, -O2):
<y>:
jmp    1030 <ehca_get_max_hwpage_size@plt>

LLVM IR (-O0):
%struct.ehca_shca = type { i32 }
define i32 @y(%struct.ehca_shca* %0) {
%2 = alloca %struct.ehca_shca*
store %struct.ehca_shca* %0, %struct.ehca_shca** %2
%3 = load %struct.ehca_shca*, %struct.ehca_shca** %2
%4 = call i32 @ehca_get_max_hwpage_size(%struct.ehca_shca* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.ehca_shca = type { i32 }
define i32 @y(%struct.ehca_shca* %0) {
%2 = tail call i32 @ehca_get_max_hwpage_size(%struct.ehca_shca* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xd3() {
  Assert_real((ispunct(211) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              1060, ("ispunct should be 0 for 0xd3"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xd3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd3,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x424,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xd3>:
push   %rax
mov    $0xd3,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x424,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xd3\00"
define void @t_ispunct_0xd3() {
%1 = call i64 @ispunct(i32 211)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1060, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xd3\00"
define void @t_ispunct_0xd3() {
%1 = tail call i64 @ispunct(i32 211)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1060, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void _M2_Points_finish(__attribute__((unused)) int argc,
                       __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_Points_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
int /*<<< orphan*/ True;
Bool glXQueryExtension(Display *dpy, int *errorb, int *event) { return True; }


x86 assembly (clang, -O0):
<glXQueryExtension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glXQueryExtension>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@True = global i32 0
define i32 @glXQueryExtension(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* @True
ret i32 %7
}

LLVM IR (-O2):
@True = global i32 0
define i32 @glXQueryExtension(i32* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @True
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xfc() {
  Assert_real((isodigit(252) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1265, ("isodigit should be 0 for 0xfc"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xfc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfc,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4f1,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xfc>:
push   %rax
mov    $0xfc,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4f1,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xfc\00"
define void @t_isodigit_0xfc() {
%1 = call i64 @isodigit(i32 252)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1265, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xfc\00"
define void @t_isodigit_0xfc() {
%1 = tail call i64 @isodigit(i32 252)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1265, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int send_recv(int, int /*<<< orphan*/);
int case_empty(int fd) { return send_recv(fd, 0); }


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

x86 assembly (clang, -O2):
<case_empty>:
xor    %esi,%esi
jmp    1030 <send_recv@plt>

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

LLVM IR (-O2):
define i32 @case_empty(i32 %0) {
%2 = tail call i32 @send_recv(i32 %0, i32 0)
ret i32 %2
}
extern unsigned long _sbus_readl(unsigned long addr) {
  return *(volatile unsigned long *)addr;
}


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

x86 assembly (clang, -O2):
<_sbus_readl>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @_sbus_readl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @_sbus_readl(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
ret i64 %3
}
void printchar(char **str, int c) {
  if (str) {
    **str = (char)c;
    ++(*str);
  } else {
    (void)c;
  }
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <printchar+0x37>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1137 <printchar+0x37>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     110f <printchar+0xf>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @printchar(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 = icmp ne i8** %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
store i8 %9, i8* %11
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %17
15: ; preds = %2
%16 = load i32, i32* %4
br label %17
17: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %9
9: ; preds = %2, %4
ret void
}
long myReadSector(struct Device *dev, long n, int size, unsigned char *buf) {
  return 0;
}


x86 assembly (clang, -O0):
<myReadSector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Device = type opaque
define i64 @myReadSector(%struct.Device* %0, i64 %1, i32 %2, i8* %3) {
%5 = alloca %struct.Device*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
store %struct.Device* %0, %struct.Device** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret i64 0
}

LLVM IR (-O2):
%struct.Device = type opaque
define i64 @myReadSector(%struct.Device* nocapture readnone %0, i64 %1, i32 %2, i8* nocapture readnone %3) {
ret i64 0
}
/* Type definitions */
struct sockaddr_storage {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ af_sa_len(struct sockaddr const *);
int /*<<< orphan*/ memcpy(struct sockaddr_storage *, struct sockaddr const *,
                          int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct sockaddr_storage *, int /*<<< orphan*/, int);
void af_copy_sa_to_sas(struct sockaddr_storage *sas,
                       const struct sockaddr *sa) {
  memset(sas, 0, sizeof(*sa));
  memcpy(sas, sa, af_sa_len(sa));
}


x86 assembly (clang, -O0):
<af_copy_sa_to_sas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <af_sa_len@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<af_copy_sa_to_sas>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    %r14,%rdi
call   1050 <af_sa_len@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
define void @af_copy_sa_to_sas(%struct.sockaddr_storage* %0, %struct.sockaddr* %1) {
%3 = alloca %struct.sockaddr_storage*
%4 = alloca %struct.sockaddr*
store %struct.sockaddr_storage* %0, %struct.sockaddr_storage** %3
store %struct.sockaddr* %1, %struct.sockaddr** %4
%5 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %3
%6 = call i32 @memset(%struct.sockaddr_storage* %5, i32 0, i32 4)
%7 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %3
%8 = load %struct.sockaddr*, %struct.sockaddr** %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %4
%10 = call i32 @af_sa_len(%struct.sockaddr* %9)
%11 = call i32 @memcpy(%struct.sockaddr_storage* %7, %struct.sockaddr* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
define void @af_copy_sa_to_sas(%struct.sockaddr_storage* %0, %struct.sockaddr* %1) {
%3 = tail call i32 @memset(%struct.sockaddr_storage* %0, i32 0, i32 4)
%4 = tail call i32 @af_sa_len(%struct.sockaddr* %1)
%5 = tail call i32 @memcpy(%struct.sockaddr_storage* %0, %struct.sockaddr* %1, i32 %4)
ret void
}
int destroy_8023_server(void) {}


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

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

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

LLVM IR (-O2):
define i32 @destroy_8023_server() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
FILE *fileopen(char *name, char *mode) {
  FILE *f;
  f = fopen(name, mode);
  if (f == NULL) {
    printf("Error: Cannot open file %s with mode %s\n", name, mode);
    exit(1);
  }
  return f;
}


x86 assembly (clang, -O0):
<fileopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117a <fileopen+0x4a>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileopen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     114c <fileopen+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Error: Cannot open file %s with mode %s\0A\00"
define i32* @fileopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@.str = [41 x i8] c"Error: Cannot open file %s with mode %s\0A\00"
define noalias i32* @fileopen(i8* %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32* %3
}
double asDouble(long secs, long usecs) {
  return ((double)secs) + (usecs / 1000000.0);
}


x86 assembly (clang, -O0):
<asDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<asDouble>:
cvtsi2sd %rdi,%xmm1
cvtsi2sd %rsi,%xmm0
divsd  0xeee(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @asDouble(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = sitofp i64 %5 to double
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %6, %9
ret double %10
}

LLVM IR (-O2):
define double @asDouble(i64 %0, i64 %1) {
%3 = sitofp i64 %0 to double
%4 = sitofp i64 %1 to double
%5 = fdiv double %4, 1.000000e+06
%6 = fadd double %5, %3
ret double %6
}
int main() {
  int j = 0;
  for (int i = 0; i < 10; i++) {
    j += j;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void uxmi_maint() { printf("\nMaint\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"\0AMaint\00"
define void @uxmi_maint() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void VmFatal(char *Error) {
  printf("Error: %s", Error);
  exit(-1);
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Error: %s\00"
define void @VmFatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"Error: %s\00"
define void @VmFatal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
double atof(char const *);
char *miget_cfg_str(int);
double miget_cfg_double(int id) {
  const char *_var = miget_cfg_str(id);
  return atof(_var);
}


x86 assembly (clang, -O0):
<miget_cfg_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <miget_cfg_str@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<miget_cfg_double>:
push   %rax
call   1040 <miget_cfg_str@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <atof@plt>

LLVM IR (-O0):
define double @miget_cfg_double(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @miget_cfg_str(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call double @atof(i8* %6)
ret double %7
}

LLVM IR (-O2):
define double @miget_cfg_double(i32 %0) {
%2 = tail call i8* @miget_cfg_str(i32 %0)
%3 = tail call double @atof(i8* %2)
ret double %3
}
int isign(int x) { return ((x > 0) - (x < 0)); }


x86 assembly (clang, -O0):
<isign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x4(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isign>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
sar    $0x1f,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @isign(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @isign(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = ashr i32 %0, 31
%5 = add nsw i32 %4, %3
ret i32 %5
}
int scsi_major(int m) {
  return ((m) == 8 || (m) == 9 || (m) == 11 || (m) == 21);
}


x86 assembly (clang, -O0):
<scsi_major>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x8,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <scsi_major+0x3e>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <scsi_major+0x3e>
mov    $0x1,%al
cmpl   $0xb,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <scsi_major+0x3e>
cmpl   $0x15,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scsi_major>:
cmp    $0xb,%edi
ja     1115 <scsi_major+0x15>
mov    $0x1,%eax
mov    $0xb00,%ecx
bt     %edi,%ecx
jae    1115 <scsi_major+0x15>
ret
xor    %eax,%eax
cmp    $0x15,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @scsi_major(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 8
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 11
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 21
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @scsi_major(i32 %0) {
switch i32 %0, label %2 [
i32 11, label %5
i32 9, label %5
i32 8, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 21
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset) {
  return (void *)-1;
}


x86 assembly (clang, -O0):
<mmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmap>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret i8* inttoptr (i64 -1 to i8*)
}

LLVM IR (-O2):
define i8* @mmap(i8* nocapture readnone %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret i8* inttoptr (i64 -1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ board_init();
int engine(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ init_hash();
int /*<<< orphan*/ move_init();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ transposition_init(int);
int main(int argc, char **argv) {
  fprintf(stderr, "Dreamer v"
                  "0.2.1-RC2"
                  " ("
                  "5625775"
                  ")\n");
  board_init();
  init_hash();
  move_init();
  transposition_init(128);
  return engine(NULL);
}


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    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    0xe7a(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x0,%al
call   1070 <board_init@plt>
mov    $0x0,%al
call   1050 <init_hash@plt>
mov    $0x0,%al
call   1030 <move_init@plt>
mov    $0x80,%edi
call   1040 <transposition_init@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <engine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1060 <fprintf@plt>
xor    %eax,%eax
call   1070 <board_init@plt>
xor    %eax,%eax
call   1050 <init_hash@plt>
xor    %eax,%eax
call   1030 <move_init@plt>
mov    $0x80,%edi
call   1040 <transposition_init@plt>
xor    %edi,%edi
pop    %rax
jmp    1080 <engine@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Dreamer v0.2.1-RC2 (5625775)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @board_init()
%9 = call i32 (...) @init_hash()
%10 = call i32 (...) @move_init()
%11 = call i32 @transposition_init(i32 128)
%12 = call i32 @engine(i32* null)
ret i32 %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Dreamer v0.2.1-RC2 (5625775)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @board_init()
%6 = tail call i32 (...) @init_hash()
%7 = tail call i32 (...) @move_init()
%8 = tail call i32 @transposition_init(i32 128)
%9 = tail call i32 @engine(i32* null)
ret i32 %9
}
int bs_compare(const void *key_p, const void *el_p) {
  int key = *((const int *)key_p);
  int el = *((const int *)el_p);
  return ((key > el) ? 1 : ((key < el) ? -1 : 0));
}


x86 assembly (clang, -O0):
<bs_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1137 <bs_compare+0x37>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <bs_compare+0x4c>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_compare>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @bs_compare(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*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = icmp slt i32 %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 -1, i32 0
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ 1, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @bs_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void nopSignal(int sigNr) {}


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

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

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

LLVM IR (-O2):
define void @nopSignal(i32 %0) {
ret void
}
/* Type definitions */
struct gges_bnf_grammar {
  int dummy;
};

/* Variables and functions */
struct gges_bnf_grammar *gges_create_empty_grammar();
int /*<<< orphan*/ gges_extend_grammar(struct gges_bnf_grammar *, char const *,
                                       int);
struct gges_bnf_grammar *gges_parse_bnf(const char *bnfstr) {
  struct gges_bnf_grammar *g;
  g = gges_create_empty_grammar();
  gges_extend_grammar(g, bnfstr, true);
  return g;
}


x86 assembly (clang, -O0):
<gges_parse_bnf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <gges_create_empty_grammar@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <gges_extend_grammar@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gges_parse_bnf>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <gges_create_empty_grammar@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <gges_extend_grammar@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.gges_bnf_grammar = type { i32 }
define %struct.gges_bnf_grammar* @gges_parse_bnf(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.gges_bnf_grammar*
store i8* %0, i8** %2
%4 = call %struct.gges_bnf_grammar* (...) @gges_create_empty_grammar()
store %struct.gges_bnf_grammar* %4, %struct.gges_bnf_grammar** %3
%5 = load %struct.gges_bnf_grammar*, %struct.gges_bnf_grammar** %3
%6 = load i8*, i8** %2
%7 = call i32 @gges_extend_grammar(%struct.gges_bnf_grammar* %5, i8* %6, i32 1)
%8 = load %struct.gges_bnf_grammar*, %struct.gges_bnf_grammar** %3
ret %struct.gges_bnf_grammar* %8
}

LLVM IR (-O2):
%struct.gges_bnf_grammar = type { i32 }
define %struct.gges_bnf_grammar* @gges_parse_bnf(i8* %0) {
%2 = tail call %struct.gges_bnf_grammar* (...) @gges_create_empty_grammar()
%3 = tail call i32 @gges_extend_grammar(%struct.gges_bnf_grammar* %2, i8* %0, i32 1)
ret %struct.gges_bnf_grammar* %2
}
void keyring_endtrans(struct onak_dbctx *dbctx) { return; }


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

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

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

LLVM IR (-O2):
%struct.onak_dbctx = type opaque
define void @keyring_endtrans(%struct.onak_dbctx* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  short a = 1;
  int b = 2;
  long c = 3;
  long d = a + b + c;
  printf("%d %d %d\n", sizeof(short), sizeof(int), sizeof(long));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movl   $0x2,-0xc(%rbp)
movq   $0x3,-0x18(%rbp)
movswl -0x6(%rbp),%eax
add    -0xc(%rbp),%eax
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xeb4(%rip),%rdi
mov    $0x2,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2, i32 4, i32 8)
ret i32 0
}
void _M2_NumberIO_init(__attribute__((unused)) int argc,
                       __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_NumberIO_init(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ kbhit();
int getch(void) {
  while (!kbhit()) {
  }
  return getchar();
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <getch+0x9>
mov    $0x0,%al
call   1030 <kbhit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1145 <getch+0x25>
jmp    114a <getch+0x2a>
jmp    1129 <getch+0x9>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <kbhit@plt>
test   %eax,%eax
je     1130 <getch+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

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

LLVM IR (-O2):
define i32 @getch() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @kbhit()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i32 (...) @getchar()
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
double sqrt(double);
double stdlib_strided_dvarianceyc(scalar_t__ const, double const,
                                  double const *, scalar_t__ const);
double stdlib_strided_dsemyc(const int64_t N, const double correction,
                             const double *X, const int64_t stride) {
  return sqrt(stdlib_strided_dvarianceyc(N, correction, X, stride) / (double)N);
}


x86 assembly (clang, -O0):
<stdlib_strided_dsemyc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <stdlib_strided_dvarianceyc@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dsemyc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <stdlib_strided_dvarianceyc@plt>
cvtsi2sd %rbx,%xmm1
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1142 <stdlib_strided_dsemyc+0x22>
sqrtsd %xmm0,%xmm0
pop    %rbx
ret
pop    %rbx
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @stdlib_strided_dsemyc(i64 %0, double %1, double* %2, i64 %3) {
%5 = alloca i64
%6 = alloca double
%7 = alloca double*
%8 = alloca i64
store i64 %0, i64* %5
store double %1, double* %6
store double* %2, double** %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load double, double* %6
%11 = load double*, double** %7
%12 = load i64, i64* %8
%13 = call double @stdlib_strided_dvarianceyc(i64 %9, double %10, double* %11, i64 %12)
%14 = load i64, i64* %5
%15 = sitofp i64 %14 to double
%16 = fdiv double %13, %15
%17 = call double @sqrt(double %16)
ret double %17
}

LLVM IR (-O2):
define double @stdlib_strided_dsemyc(i64 %0, double %1, double* %2, i64 %3) {
%5 = tail call double @stdlib_strided_dvarianceyc(i64 %0, double %1, double* %2, i64 %3)
%6 = sitofp i64 %0 to double
%7 = fdiv double %5, %6
%8 = tail call double @sqrt(double %7)
ret double %8
}
void a_or(volatile void *p, int v) { *(int *)p |= v; }


x86 assembly (clang, -O0):
<a_or>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_or>:
or     %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @a_or(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = or i32 %4, %1
store i32 %5, i32* %3
ret void
}
int fun(int n) {
  static int f = 1;
  f = f * n;
  return f;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2f13(%rip),%eax
imul   -0x4(%rbp),%eax
mov    %eax,0x2f09(%rip)
mov    0x2f03(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
mov    %edi,%eax
imul   0x2f17(%rip),%eax
mov    %eax,0x2f11(%rip)
ret

LLVM IR (-O0):
@fun.f = internal global i32 1
define i32 @fun(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @fun.f
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
store i32 %5, i32* @fun.f
%6 = load i32, i32* @fun.f
ret i32 %6
}

LLVM IR (-O2):
@fun.f = internal unnamed_addr global i32 1
define i32 @fun(i32 %0) {
%2 = load i32, i32* @fun.f
%3 = mul nsw i32 %2, %0
store i32 %3, i32* @fun.f
ret i32 %3
}
char *textdomain(const char *domainname) { return (char *)domainname; }


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

x86 assembly (clang, -O2):
<textdomain>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @textdomain(i8* readnone returned %0) {
ret i8* %0
}
int my_strlen(char *str) {
  int i;
  i = 0;
  while (str[i] != 0) {
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}