xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ write_bit(int /*<<< orphan*/);
void write_zeros(int bits) {
  while (bits-- > 0)
    write_bit(0);
}


x86 assembly (clang, -O0):
<write_zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    113b <write_zeros+0x2b>
xor    %edi,%edi
call   1030 <write_bit@plt>
jmp    111b <write_zeros+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_zeros>:
push   %rbx
test   %edi,%edi
jle    112f <write_zeros+0x1f>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <write_bit@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <write_zeros+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @write_zeros(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @write_bit(i32 0)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @write_zeros(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @write_bit(i32 0)
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
double ftoc(double temp) { return (5.0 / 9.0) * (temp - 32.0); }


x86 assembly (clang, -O0):
<ftoc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xef2(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xede(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftoc>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ftoc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 3.200000e+01
%5 = fmul double 0x3FE1C71C71C71C72, %4
ret double %5
}

LLVM IR (-O2):
define double @ftoc(double %0) {
%2 = fadd double %0, -3.200000e+01
%3 = fmul double %2, 0x3FE1C71C71C71C72
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mount();
int /*<<< orphan*/ nfile();
int /*<<< orphan*/ umount();
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  if (argc != 1)
    usage(argv[0]);
  mount();
  nfile();
  umount();
  exit(EXIT_SUCCESS);
}


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)
cmpl   $0x1,-0x8(%rbp)
je     117c <main+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <usage@plt>
mov    $0x0,%al
call   1040 <mount@plt>
mov    $0x0,%al
call   1050 <nfile@plt>
mov    $0x0,%al
call   1030 <umount@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
je     115e <main+0xe>
mov    (%rsi),%rdi
call   1060 <usage@plt>
xor    %eax,%eax
call   1040 <mount@plt>
xor    %eax,%eax
call   1050 <nfile@plt>
xor    %eax,%eax
call   1030 <umount@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @usage(i8* %11)
br label %13
13: ; preds = %8, %2
%14 = call i32 (...) @mount()
%15 = call i32 (...) @nfile()
%16 = call i32 (...) @umount()
%17 = load i32, i32* @EXIT_SUCCESS
%18 = call i32 @exit(i32 %17)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %7
7: ; preds = %4, %2
%8 = tail call i32 (...) @mount()
%9 = tail call i32 (...) @nfile()
%10 = tail call i32 (...) @umount()
%11 = load i32, i32* @EXIT_SUCCESS
%12 = tail call i32 @exit(i32 %11)
unreachable
}
int getMid(int s, int e) { return s + (e - s) / 2; }


x86 assembly (clang, -O0):
<getMid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMid>:
sub    %edi,%esi
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @getMid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = sdiv i32 %8, 2
%10 = add nsw i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @getMid(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = sdiv i32 %3, 2
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ XKeyEvent;
typedef int KeySym;

/* Variables and functions */
#define XK_Escape 128
int XLookupKeysym(int /*<<< orphan*/ *, int /*<<< orphan*/);
int get_key(XKeyEvent *xkey) {
  KeySym sym = XLookupKeysym(xkey, 0);
  switch (sym) {
  case XK_Escape:
    return 27;
  default:
    break;
  }
  return sym;
}


x86 assembly (clang, -O0):
<get_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <XLookupKeysym@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x80,%eax
jne    1149 <get_key+0x39>
jmp    113d <get_key+0x2d>
movl   $0x1b,-0x4(%rbp)
jmp    1154 <get_key+0x44>
jmp    114e <get_key+0x3e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_key>:
push   %rax
xor    %esi,%esi
call   1030 <XLookupKeysym@plt>
cmp    $0x80,%eax
mov    $0x1b,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_key(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @XLookupKeysym(i32* %5, i32 0)
store i32 %6, i32* %4
%7 = load i32, i32* %4
switch i32 %7, label %9 [
i32 128, label %8
]
8: ; preds = %1
store i32 27, i32* %2
br label %12
9: ; preds = %1
br label %10
10: ; preds = %9
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_key(i32* %0) {
%2 = tail call i32 @XLookupKeysym(i32* %0, i32 0)
%3 = icmp eq i32 %2, 128
%4 = select i1 %3, i32 27, i32 %2
ret i32 %4
}
int pdf_aes_flush(void *_ctx, char *out) {
  int tmplen = 0;
  return tmplen;
}


x86 assembly (clang, -O0):
<pdf_aes_flush>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pdf_aes_flush(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int POWER_OF_TWO(int n) { return n && !(n & (n - 1)); }


x86 assembly (clang, -O0):
<POWER_OF_TWO>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <POWER_OF_TWO+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<POWER_OF_TWO>:
test   %edi,%edi
je     110f <POWER_OF_TWO+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @POWER_OF_TWO(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @POWER_OF_TWO(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
char *lookupa(int x, char *names[]) {
  int i = 0;
  while (names[i] != NULL) {
    if (x == i) {
      return (names[i]);
    }
    i++;
  }
  return (NULL);
}


x86 assembly (clang, -O0):
<lookupa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1154 <lookupa+0x54>
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1146 <lookupa+0x46>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    115c <lookupa+0x5c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1112 <lookupa+0x12>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookupa>:
mov    %edi,%ecx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rsi,%rdx,8),%rax
test   %rax,%rax
je     1125 <lookupa+0x25>
lea    0x1(%rdx),%rdi
cmp    %rdx,%rcx
mov    %rdi,%rdx
jne    1110 <lookupa+0x10>
ret

LLVM IR (-O0):
define i8* @lookupa(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %24, %2
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %27
14: ; preds = %7
%15 = load i32, i32* %4
%16 = load i32, i32* %6
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i8**, i8*** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
store i8* %23, i8** %3
br label %28
24: ; preds = %14
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %7
27: ; preds = %7
store i8* null, i8** %3
br label %28
28: ; preds = %27, %18
%29 = load i8*, i8** %3
ret i8* %29
}

LLVM IR (-O2):
define i8* @lookupa(i32 %0, i8** nocapture %1) {
%3 = zext i32 %0 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %11, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8*, i8** %1, i64 %5
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
%9 = icmp eq i64 %5, %3
%10 = select i1 %8, i1 true, i1 %9
%11 = add nuw nsw i64 %5, 1
br i1 %10, label %12, label %4
12: ; preds = %4
ret i8* %7
}
/* Variables and functions */
int PAPI_flops(float *, float *, long long *, float *);
void PAPIF_FLOPS(float *real_time, float *proc_time, long long *flpops,
                 float *mflops, int *check) {
  *check = PAPI_flops(real_time, proc_time, flpops, mflops);
}


x86 assembly (clang, -O0):
<PAPIF_FLOPS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <PAPI_flops@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_FLOPS>:
push   %rbx
mov    %r8,%rbx
call   1030 <PAPI_flops@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PAPIF_FLOPS(float* %0, float* %1, i64* %2, float* %3, i32* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca i64*
%9 = alloca float*
%10 = alloca i32*
store float* %0, float** %6
store float* %1, float** %7
store i64* %2, i64** %8
store float* %3, float** %9
store i32* %4, i32** %10
%11 = load float*, float** %6
%12 = load float*, float** %7
%13 = load i64*, i64** %8
%14 = load float*, float** %9
%15 = call i32 @PAPI_flops(float* %11, float* %12, i64* %13, float* %14)
%16 = load i32*, i32** %10
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @PAPIF_FLOPS(float* %0, float* %1, i64* %2, float* %3, i32* nocapture writeonly %4) {
%6 = tail call i32 @PAPI_flops(float* %0, float* %1, i64* %2, float* %3)
store i32 %6, i32* %4
ret void
}
void rsm(void) { __asm__("rsm"); }


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

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

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

LLVM IR (-O2):
define void @rsm() {
tail call void asm sideeffect "rsm", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int iis_s3c2410_set_samplerate(unsigned int);
int iis_set_samplerate(unsigned rate) {
  return iis_s3c2410_set_samplerate(rate);
}


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

x86 assembly (clang, -O2):
<iis_set_samplerate>:
jmp    1030 <iis_s3c2410_set_samplerate@plt>

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

LLVM IR (-O2):
define i32 @iis_set_samplerate(i32 %0) {
%2 = tail call i32 @iis_s3c2410_set_samplerate(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
void copy_blocks(unsigned char *dptr, const unsigned char *sptr, long size) {
  while (size >= 130) {
    memcpy(dptr, sptr, 129);
    dptr += 129;
    sptr += 130;
    size -= 130;
  }
}


x86 assembly (clang, -O0):
<copy_blocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x82,-0x18(%rbp)
jl     1173 <copy_blocks+0x63>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x81,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x81,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x82,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x82,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <copy_blocks+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_blocks>:
push   %r15
push   %r14
push   %rbx
cmp    $0x82,%rdx
jl     115e <copy_blocks+0x4e>
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x82,%r15
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x81,%edx
call   1030 <memcpy@plt>
add    $0x81,%rbx
add    $0x82,%r14
add    $0xffffffffffffff7e,%r15
cmp    $0x103,%r15
ja     1130 <copy_blocks+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @copy_blocks(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
br label %7
7: ; preds = %10, %3
%8 = load i64, i64* %6
%9 = icmp sge i64 %8, 130
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call i32 @memcpy(i8* %11, i8* %12, i32 129)
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 129
store i8* %15, i8** %4
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 130
store i8* %17, i8** %5
%18 = load i64, i64* %6
%19 = sub nsw i64 %18, 130
store i64 %19, i64* %6
br label %7
20: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @copy_blocks(i8* %0, i8* %1, i64 %2) {
%4 = icmp sgt i64 %2, 129
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i64 [ %12, %5 ], [ %2, %3 ]
%7 = phi i8* [ %11, %5 ], [ %1, %3 ]
%8 = phi i8* [ %10, %5 ], [ %0, %3 ]
%9 = tail call i32 @memcpy(i8* %8, i8* %7, i32 129)
%10 = getelementptr inbounds i8, i8* %8, i64 129
%11 = getelementptr inbounds i8, i8* %7, i64 130
%12 = add nsw i64 %6, -130
%13 = icmp ugt i64 %6, 259
br i1 %13, label %5, label %14
14: ; preds = %5, %3
ret void
}
void dlm_debug_init(struct dlm_ctxt *dlm) {}


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

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

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

LLVM IR (-O2):
%struct.dlm_ctxt = type opaque
define void @dlm_debug_init(%struct.dlm_ctxt* nocapture %0) {
ret void
}
/* Variables and functions */
extern int SizeofSizeT() { return sizeof(size_t); }


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

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

LLVM IR (-O0):
define i32 @SizeofSizeT() {
ret i32 8
}

LLVM IR (-O2):
define i32 @SizeofSizeT() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int read(int, char *, int, int /*<<< orphan*/);
void socket_flush(int fd) {
  int nread = -1;
  char c;
  while ((nread = read(fd, &c, 1, 0)) > 0) {
    printf("cleaning...: %c\n", c);
    continue;
  }
}


x86 assembly (clang, -O0):
<socket_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <read@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1166 <socket_flush+0x46>
lea    0xea8(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
jmp    1132 <socket_flush+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_flush>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <read@plt>
test   %eax,%eax
jle    1172 <socket_flush+0x52>
lea    0xeb9(%rip),%r14
lea    0xf(%rsp),%r15
nopl   0x0(%rax)
movsbl 0xf(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <read@plt>
test   %eax,%eax
jg     1150 <socket_flush+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"cleaning...: %c\0A\00"
define void @socket_flush(i32 %0) {
%2 = alloca i8
%3 = call i32 @read(i32 %0, i8* %2, i32 1, i32 0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = load i8, i8* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = call i32 @read(i32 %0, i8* %2, i32 1, i32 0)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_with_tab(char *);
void gen_immediate(void) { output_with_tab("load r1 "); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"load r1 \00"
define void @gen_immediate() {
%1 = call i32 @output_with_tab(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"load r1 \00"
define void @gen_immediate() {
%1 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
double MItoM(double MI) { return MI * 1609.344; }


x86 assembly (clang, -O0):
<MItoM>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MItoM>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @MItoM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x409925604189374C
ret double %4
}

LLVM IR (-O2):
define double @MItoM(double %0) {
%2 = fmul double %0, 0x409925604189374C
ret double %2
}
int ikeepalive(int sock, int keepcnt, int keepidle, int keepintvl) {
  int enable = (keepcnt < 0 || keepidle < 0 || keepintvl < 0) ? 0 : 1;
  unsigned long value;
  return -1;
  return 0;
}


x86 assembly (clang, -O0):
<ikeepalive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x21(%rbp)
jl     1138 <ikeepalive+0x38>
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x21(%rbp)
jl     1138 <ikeepalive+0x38>
cmpl   $0x0,-0x10(%rbp)
setl   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ikeepalive(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 -1
}
/* Variables and functions */
unsigned int rand();
unsigned int rand_get(unsigned int modulo) { return (rand() % modulo); }


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

x86 assembly (clang, -O2):
<rand_get>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand_get(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = urem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rand_get(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = urem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(int **);
scalar_t__ malloc(int);
int main() {
  int a, b, c;
  int *pa, *pb, *pc;
  int **parr = (int **)malloc(3 * sizeof(int *));
  a = 1;
  b = 2;
  c = 3;
  pa = &a;
  pb = &b;
  parr[0] = pa;
  parr[1] = pb;
  parr[2] = &c;
  pc = parr[2];
  free(parr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x18,%edi
call   1040 <malloc@plt>
mov    %rax,-0x30(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x30(%rbp),%rax
lea    -0x10(%rbp),%rcx
mov    %rcx,0x10(%rax)
mov    -0x30(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    $0x18,%edi
call   1040 <malloc@plt>
lea    0x14(%rsp),%rcx
mov    %rcx,(%rax)
lea    0x10(%rsp),%rcx
mov    %rcx,0x8(%rax)
lea    0xc(%rsp),%rcx
mov    %rcx,0x10(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32**
store i32 0, i32* %1
%9 = call i64 @malloc(i32 24)
%10 = inttoptr i64 %9 to i32**
store i32** %10, i32*** %8
store i32 1, i32* %2
store i32 2, i32* %3
store i32 3, i32* %4
store i32* %2, i32** %5
store i32* %3, i32** %6
%11 = load i32*, i32** %5
%12 = load i32**, i32*** %8
%13 = getelementptr inbounds i32*, i32** %12, i64 0
store i32* %11, i32** %13
%14 = load i32*, i32** %6
%15 = load i32**, i32*** %8
%16 = getelementptr inbounds i32*, i32** %15, i64 1
store i32* %14, i32** %16
%17 = load i32**, i32*** %8
%18 = getelementptr inbounds i32*, i32** %17, i64 2
store i32* %4, i32** %18
%19 = load i32**, i32*** %8
%20 = getelementptr inbounds i32*, i32** %19, i64 2
%21 = load i32*, i32** %20
store i32* %21, i32** %7
%22 = load i32**, i32*** %8
%23 = call i32 @free(i32** %22)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i64 @malloc(i32 24)
%8 = inttoptr i64 %7 to i32**
store i32* %1, i32** %8
%9 = getelementptr inbounds i32*, i32** %8, i64 1
store i32* %2, i32** %9
%10 = getelementptr inbounds i32*, i32** %8, i64 2
store i32* %3, i32** %10
%11 = call i32 @free(i32** %8)
ret i32 0
}
void gdk_display_pointer_is_grabbed() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_pointer_is_grabbed() {
ret void
}
/* Variables and functions */
char toLower(char);
void stringToLowerCase(char string[]) {
  char *s;
  for (s = string; *s; s++)
    *s = toLower(*s);
}


x86 assembly (clang, -O0):
<stringToLowerCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <stringToLowerCase+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toLower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <stringToLowerCase+0x14>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @stringToLowerCase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toLower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int Cos(int N) {
  int NMod8 = N % 8;
  if (NMod8 == 0) {
    return 1;
  }
  if (NMod8 == 4) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Cos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112b <Cos+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1148 <Cos+0x48>
cmpl   $0x4,-0xc(%rbp)
jne    1141 <Cos+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <Cos+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cos>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff8,%eax
mov    %edi,%ecx
sub    %eax,%ecx
xor    %edx,%edx
cmp    $0x4,%ecx
sete   %dl
neg    %edx
cmp    %eax,%edi
mov    $0x1,%eax
cmovne %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @Cos(i32 %0) {
%2 = srem i32 %0, 8
%3 = icmp eq i32 %2, 4
%4 = sext i1 %3 to i32
%5 = icmp eq i32 %2, 0
%6 = select i1 %5, i32 1, i32 %4
ret i32 %6
}
/* Variables and functions */
int hPrintNumber(int, unsigned long long, int /*<<< orphan*/,
                 int /*<<< orphan*/, int);
int fb_PrintUsingULongint(int fnum, unsigned long long value_ull, int mask) {
  return hPrintNumber(fnum, value_ull, 0, 0, mask);
}


x86 assembly (clang, -O0):
<fb_PrintUsingULongint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%r8d
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <hPrintNumber@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_PrintUsingULongint>:
mov    %edx,%r8d
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <hPrintNumber@plt>

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

LLVM IR (-O2):
define i32 @fb_PrintUsingULongint(i32 %0, i64 %1, i32 %2) {
%4 = tail call i32 @hPrintNumber(i32 %0, i64 %1, i32 0, i32 0, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() { printf("\n %d", 10); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int MPU_Init(int);
int MPU_Detect(int *port, int *unk) {
  if (port == NULL) {
    return -1;
  }
  return MPU_Init(*port);
}


x86 assembly (clang, -O0):
<MPU_Detect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <MPU_Detect+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <MPU_Detect+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <MPU_Init@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPU_Detect>:
test   %rdi,%rdi
je     111c <MPU_Detect+0xc>
mov    (%rdi),%edi
jmp    1030 <MPU_Init@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @MPU_Detect(i32* %0, i32* nocapture readnone %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* %0
%6 = tail call i32 @MPU_Init(i32 %5)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ -1, %2 ]
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ RAND_MAX;

/* Variables and functions */
scalar_t__ rand();
float RndReal(int idum) {
  return (float)((double)rand() / ((double)(RAND_MAX) + (double)(1)));
}


x86 assembly (clang, -O0):
<RndReal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RndReal>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @RndReal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = fdiv double %4, 1.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @RndReal(i32 %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
scalar_t__ fmod(double, double);
float fmodf(float x, float y) { return (float)fmod((double)x, (double)y); }


x86 assembly (clang, -O0):
<fmodf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
call   1030 <fmod@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodf>:
push   %rax
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
call   1030 <fmod@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = call i64 @fmod(double %6, double %8)
%10 = sitofp i64 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @fmodf(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fpext float %1 to double
%5 = tail call i64 @fmod(double %3, double %4)
%6 = sitofp i64 %5 to float
ret float %6
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ random();
double random_between_double(double low, double high) {
  double r = (double)random();
  double p = r / (double)RAND_MAX;
  double d = low + p * (high - low);
  return d;
}


x86 assembly (clang, -O0):
<random_between_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    0x2ea9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_between_double>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2sd %rax,%xmm2
mov    0x2eb5(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @random_between_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
%8 = call i64 (...) @random()
%9 = sitofp i64 %8 to double
store double %9, double* %5
%10 = load double, double* %5
%11 = load i64, i64* @RAND_MAX
%12 = sitofp i64 %11 to double
%13 = fdiv double %10, %12
store double %13, double* %6
%14 = load double, double* %3
%15 = load double, double* %6
%16 = load double, double* %4
%17 = load double, double* %3
%18 = fsub double %16, %17
%19 = call double @llvm.fmuladd.f64(double %15, double %18, double %14)
store double %19, double* %7
%20 = load double, double* %7
ret double %20
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @random_between_double(double %0, double %1) {
%3 = tail call i64 (...) @random()
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
%8 = fsub double %1, %0
%9 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %0)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ echo();
int /*<<< orphan*/ getstr(char *);
int /*<<< orphan*/ move(int, int);
void getkey(char *key) {
  echo();
  curs_set(1);
  move(1, 5);
  getstr(key);
}


x86 assembly (clang, -O0):
<getkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <echo@plt>
mov    $0x1,%edi
call   1050 <curs_set@plt>
mov    $0x1,%edi
mov    $0x5,%esi
call   1060 <move@plt>
mov    -0x8(%rbp),%rdi
call   1040 <getstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getkey>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <echo@plt>
mov    $0x1,%edi
call   1050 <curs_set@plt>
mov    $0x1,%edi
mov    $0x5,%esi
call   1060 <move@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <getstr@plt>

LLVM IR (-O0):
define void @getkey(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @echo()
%4 = call i32 @curs_set(i32 1)
%5 = call i32 @move(i32 1, i32 5)
%6 = load i8*, i8** %2
%7 = call i32 @getstr(i8* %6)
ret void
}

LLVM IR (-O2):
define void @getkey(i8* %0) {
%2 = tail call i32 (...) @echo()
%3 = tail call i32 @curs_set(i32 1)
%4 = tail call i32 @move(i32 1, i32 5)
%5 = tail call i32 @getstr(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int socket(int, int, int);
int Socket(int domain, int type, int protocol) {
  int sockfd = socket(domain, type, protocol);
  if (sockfd == -1) {
    perror("socket() error");
    exit(0);
  }
  return sockfd;
}


x86 assembly (clang, -O0):
<Socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <socket@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    116f <Socket+0x3f>
lea    0xe9d(%rip),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socket>:
push   %rax
call   1050 <socket@plt>
cmp    $0xffffffff,%eax
je     113d <Socket+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"socket() error\00"
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
__m128 __attribute__((__always___, __nodebug__)) _mm_load_ps(const float *p) {
  return *(__m128 *)p;
}


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

x86 assembly (clang, -O2):
<_mm_load_ps>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @_mm_load_ps(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = bitcast float* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @_mm_load_ps(float* nocapture %0) {
%2 = bitcast float* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void foo_1_1_2_1_2_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_2_2_1_2_1() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *zeros_i(int n) {
  int *buf;
  int i;
  buf = (int *)malloc(n * sizeof(int));
  for (i = 0; i < n; i++) {
    buf[i] = 0;
  }
  return buf;
}


x86 assembly (clang, -O0):
<zeros_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115e <zeros_i+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <zeros_i+0x25>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeros_i>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1149 <zeros_i+0x29>
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @zeros_i(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = inttoptr i64 %3 to i8*
%7 = zext i32 %0 to i64
%8 = shl nuw nsw i64 %7, 2
br label %9
9: ; preds = %5, %1
%10 = inttoptr i64 %3 to i32*
ret i32* %10
}
/* Variables and functions */
scalar_t__ hash_int(void *);
int equal_int(void *ip, void *jp) { return (hash_int(ip) == hash_int(jp)); }


x86 assembly (clang, -O0):
<equal_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hash_int@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <hash_int@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <hash_int@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <hash_int@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @equal_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @hash_int(i8* %5)
%7 = load i8*, i8** %4
%8 = call i64 @hash_int(i8* %7)
%9 = icmp eq i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @equal_int(i8* %0, i8* %1) {
%3 = tail call i64 @hash_int(i8* %0)
%4 = tail call i64 @hash_int(i8* %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
size_t find(int *, size_t, size_t);
void Union(int *parent, uint32_t parent_len, uint32_t x, uint32_t y) {
  uint32_t xset = find(parent, parent_len, x);
  uint32_t yset = find(parent, parent_len, y);
  parent[xset] = (int)yset;
}


x86 assembly (clang, -O0):
<Union>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <find@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <find@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Union>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <find@plt>
mov    %rax,%r12
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <find@plt>
mov    %eax,(%rbx,%r12,4)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Union(i32* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i32* %0, i32** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%11 = load i32*, i32** %5
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = call i64 @find(i32* %11, i64 %12, i64 %13)
store i64 %14, i64* %9
%15 = load i32*, i32** %5
%16 = load i64, i64* %6
%17 = load i64, i64* %8
%18 = call i64 @find(i32* %15, i64 %16, i64 %17)
store i64 %18, i64* %10
%19 = load i64, i64* %10
%20 = trunc i64 %19 to i32
%21 = load i32*, i32** %5
%22 = load i64, i64* %9
%23 = getelementptr inbounds i32, i32* %21, i64 %22
store i32 %20, i32* %23
ret void
}

LLVM IR (-O2):
define void @Union(i32* %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 @find(i32* %0, i64 %1, i64 %2)
%6 = tail call i64 @find(i32* %0, i64 %1, i64 %3)
%7 = trunc i64 %6 to i32
%8 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %7, i32* %8
ret void
}