xunge/DecIR huggingface dataset:
float calculaX1(float a, float b, float c) {}


x86 assembly (clang, -O0):
<calculaX1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @calculaX1(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %4
ret float %8
}

LLVM IR (-O2):
define float @calculaX1(float %0, float %1, float %2) {
ret float undef
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main(void) {
  test(2147395600);
  test(250);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7ffea810,%edi
call   1030 <test@plt>
mov    $0xfa,%edi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7ffea810,%edi
call   1030 <test@plt>
mov    $0xfa,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 2147395600)
%3 = call i32 @test(i32 250)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 2147395600)
%2 = tail call i32 @test(i32 250)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mos_idle_hook();
int mos_idle_thread(void *param) {
  while (1) {
    mos_idle_hook();
  }
}


x86 assembly (clang, -O0):
<mos_idle_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <mos_idle_hook@plt>
jmp    111c <mos_idle_thread+0xc>

x86 assembly (clang, -O2):
<mos_idle_thread>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mos_idle_hook@plt>
jmp    1120 <mos_idle_thread+0x10>

LLVM IR (-O0):
define i32 @mos_idle_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @mos_idle_hook()
br label %3
}

LLVM IR (-O2):
define i32 @mos_idle_thread(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @mos_idle_hook()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ PRGM_GetKey_OS(unsigned char *);
int PRGM_GetKey(void) {
  unsigned char buffer[12];
  PRGM_GetKey_OS(buffer);
  return (buffer[1] & 0x0F) * 10 + ((buffer[2] & 0xF0) >> 4);
}


x86 assembly (clang, -O0):
<PRGM_GetKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1030 <PRGM_GetKey_OS@plt>
movzbl -0xb(%rbp),%eax
and    $0xf,%eax
imul   $0xa,%eax,%eax
movzbl -0xa(%rbp),%ecx
and    $0xf0,%ecx
sar    $0x4,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRGM_GetKey>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rdi
call   1030 <PRGM_GetKey_OS@plt>
movzbl 0xd(%rsp),%eax
and    $0xf,%eax
lea    (%rax,%rax,4),%eax
movzbl 0xe(%rsp),%ecx
shr    $0x4,%ecx
lea    (%rcx,%rax,2),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @PRGM_GetKey() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @PRGM_GetKey_OS(i8* %2)
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 15
%8 = mul nsw i32 %7, 10
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 240
%13 = ashr i32 %12, 4
%14 = add nsw i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @PRGM_GetKey() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @PRGM_GetKey_OS(i8* %2)
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 1
%5 = load i8, i8* %4
%6 = and i8 %5, 15
%7 = mul nuw i8 %6, 10
%8 = zext i8 %7 to i32
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 2
%10 = load i8, i8* %9
%11 = lshr i8 %10, 4
%12 = zext i8 %11 to i32
%13 = add nuw nsw i32 %8, %12
ret i32 %13
}
/* Variables and functions */
double log(double);
double sqrt(double);
double efunc2(double x) { return sqrt(x) * log(x); }


x86 assembly (clang, -O0):
<efunc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efunc2>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     113b <efunc2+0x1b>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    1150 <efunc2+0x30>
movapd %xmm1,%xmm0
movsd  %xmm1,0x10(%rsp)
call   1040 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @efunc2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sqrt(double %3)
%5 = load double, double* %2
%6 = call double @log(double %5)
%7 = fmul double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @efunc2(double %0) {
%2 = tail call double @sqrt(double %0)
%3 = tail call double @log(double %0)
%4 = fmul double %2, %3
ret double %4
}
/* Variables and functions */
int f53(int *);
int f54(int *p) { return f53(p); }


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

x86 assembly (clang, -O2):
<f54>:
jmp    1030 <f53@plt>

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

LLVM IR (-O2):
define i32 @f54(i32* %0) {
%2 = tail call i32 @f53(i32* %0)
ret i32 %2
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf3(int f, int n) { return (cbuf(f, n, 3)); }


x86 assembly (clang, -O0):
<cbuf3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x3,%edx
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf3>:
mov    $0x3,%edx
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf3(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 = call i32 @cbuf(i32 %5, i32 %6, i32 3)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf3(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 3)
ret i32 %3
}
/* Variables and functions */
int hash_join();
int benchmarkRun() { return hash_join(); }


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

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

LLVM IR (-O0):
define i32 @benchmarkRun() {
%1 = call i32 (...) @hash_join()
ret i32 %1
}

LLVM IR (-O2):
define i32 @benchmarkRun() {
%1 = tail call i32 (...) @hash_join()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ write_port(unsigned short, int);
void configure_serial_line(unsigned short com) { write_port((com + 3), 0x03); }


x86 assembly (clang, -O0):
<configure_serial_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x3,%eax
mov    $0x3,%esi
movzwl %ax,%edi
call   1030 <write_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configure_serial_line>:
add    $0x3,%edi
movzwl %di,%edi
mov    $0x3,%esi
jmp    1030 <write_port@plt>

LLVM IR (-O0):
define void @configure_serial_line(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = add nsw i32 %4, 3
%6 = trunc i32 %5 to i16
%7 = call i32 @write_port(i16 zeroext %6, i32 3)
ret void
}

LLVM IR (-O2):
define void @configure_serial_line(i16 zeroext %0) {
%2 = add i16 %0, 3
%3 = tail call i32 @write_port(i16 zeroext %2, i32 3)
ret void
}
/* Type definitions */
struct md5_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ md5_final(struct md5_s *);
void EndMD5(struct md5_s *h) { md5_final(h); }


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

x86 assembly (clang, -O2):
<EndMD5>:
jmp    1030 <md5_final@plt>

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

LLVM IR (-O2):
%struct.md5_s = type { i32 }
define void @EndMD5(%struct.md5_s* %0) {
%2 = tail call i32 @md5_final(%struct.md5_s* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DDSpriteBuffer_BltImg(int, int, int, int /*<<< orphan*/);
void DrawImage(int X, int Y, int graphic) {
  DDSpriteBuffer_BltImg(((2) * 16) * X, ((2) * 16) * Y, graphic, 0);
}


x86 assembly (clang, -O0):
<DrawImage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x5,%edi
mov    -0x8(%rbp),%esi
shl    $0x5,%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
call   1030 <DDSpriteBuffer_BltImg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawImage>:
shl    $0x5,%edi
shl    $0x5,%esi
xor    %ecx,%ecx
jmp    1030 <DDSpriteBuffer_BltImg@plt>

LLVM IR (-O0):
define void @DrawImage(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* %4
%8 = mul nsw i32 32, %7
%9 = load i32, i32* %5
%10 = mul nsw i32 32, %9
%11 = load i32, i32* %6
%12 = call i32 @DDSpriteBuffer_BltImg(i32 %8, i32 %10, i32 %11, i32 0)
ret void
}

LLVM IR (-O2):
define void @DrawImage(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %0, 5
%5 = shl nsw i32 %1, 5
%6 = tail call i32 @DDSpriteBuffer_BltImg(i32 %4, i32 %5, i32 %2, i32 0)
ret void
}
/* Variables and functions */
size_t min(size_t a, size_t b) { return a > b ? b : a; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <min+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmova  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @min(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 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
br label %12
10: ; preds = %2
%11 = load i64, i64* %3
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
__typeof__(strncmp(1, 1, (void *)1)) test_strncmp_188(void) {
  return strncmp(1, 1, (void *)1);
}


x86 assembly (clang, -O0):
<test_strncmp_188>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1030 <strncmp@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_strncmp_188() {
%1 = call i32 @strncmp(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i64 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_strncmp_188() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ putl(char *);
int main(void) {
  putl("dsfasdfasdfasfasfas");
  getchar();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"dsfasdfasdfasfasfas\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @putl(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"dsfasdfasdfasfasfas\00"
define i32 @main() {
%1 = tail call i32 @putl(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AUDIO_IO_DeInit();
void wm8994_DeInit(void) { AUDIO_IO_DeInit(); }


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

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

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

LLVM IR (-O2):
define void @wm8994_DeInit() {
%1 = tail call i32 (...) @AUDIO_IO_DeInit()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ host_sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ host_sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ host_sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                                    int /*<<< orphan*/ *);
void host_ipl_restore(int ipl) {
  sigset_t iset;
  if (ipl) {
    host_sigfillset(&iset);
  } else {
    host_sigemptyset(&iset);
  }
  host_sigprocmask(SIG_SETMASK, &iset, NULL);
}


x86 assembly (clang, -O0):
<host_ipl_restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1153 <host_ipl_restore+0x23>
lea    -0x8(%rbp),%rdi
call   1040 <host_sigfillset@plt>
jmp    115c <host_ipl_restore+0x2c>
lea    -0x8(%rbp),%rdi
call   1050 <host_sigemptyset@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <host_sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_ipl_restore>:
push   %rax
test   %edi,%edi
je     1141 <host_ipl_restore+0x11>
lea    0x4(%rsp),%rdi
call   1040 <host_sigfillset@plt>
jmp    114b <host_ipl_restore+0x1b>
lea    0x4(%rsp),%rdi
call   1050 <host_sigemptyset@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1030 <host_sigprocmask@plt>
pop    %rax
ret

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
define void @host_ipl_restore(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @host_sigfillset(i32* %3)
br label %10
8: ; preds = %1
%9 = call i32 @host_sigemptyset(i32* %3)
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* @SIG_SETMASK
%12 = call i32 @host_sigprocmask(i32 %11, i32* %3, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
define void @host_ipl_restore(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @host_sigfillset(i32* %2)
br label %9
7: ; preds = %1
%8 = call i32 @host_sigemptyset(i32* %2)
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* @SIG_SETMASK
%11 = call i32 @host_sigprocmask(i32 %10, i32* %2, i32* null)
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ getString(char *, unsigned int, char *);
int getNonEmptyString(char *string, unsigned length, char *prompt) {
  getString(string, length, prompt);
  if (string[0] != '\0') {
    return EXIT_SUCCESS;
  } else {
    return EXIT_FAILURE;
  }
}


x86 assembly (clang, -O0):
<getNonEmptyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <getString@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1154 <getNonEmptyString+0x44>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <getNonEmptyString+0x50>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNonEmptyString>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getString@plt>
cmpb   $0x0,(%rbx)
jne    1127 <getNonEmptyString+0x17>
mov    0x2ebb(%rip),%rax
jmp    112e <getNonEmptyString+0x1e>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @getNonEmptyString(i8* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i8*, i8** %7
%11 = call i32 @getString(i8* %8, i32 %9, i8* %10)
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %3
%18 = load i32, i32* @EXIT_SUCCESS
store i32 %18, i32* %4
br label %21
19: ; preds = %3
%20 = load i32, i32* @EXIT_FAILURE
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %17
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @getNonEmptyString(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @getString(i8* %0, i32 %1, i8* %2)
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
%7 = load i32, i32* @EXIT_FAILURE
%8 = load i32, i32* @EXIT_SUCCESS
%9 = select i1 %6, i32 %7, i32 %8
ret i32 %9
}
/* Variables and functions */
float fastexp(float);
float fastsigmoid(float x) { return 1.0f / (1.0f + fastexp(-x)); }


x86 assembly (clang, -O0):
<fastsigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <fastexp@plt>
movss  0xec4(%rip),%xmm1
addss  %xmm0,%xmm1
movss  0xeb8(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastsigmoid>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <fastexp@plt>
movss  0xeeb(%rip),%xmm1
addss  %xmm1,%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fastsigmoid(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call float @fastexp(float %4)
%6 = fadd float 1.000000e+00, %5
%7 = fdiv float 1.000000e+00, %6
ret float %7
}

LLVM IR (-O2):
define float @fastsigmoid(float %0) {
%2 = fneg float %0
%3 = tail call float @fastexp(float %2)
%4 = fadd float %3, 1.000000e+00
%5 = fdiv float 1.000000e+00, %4
ret float %5
}
/* Variables and functions */
void *malloc(size_t);
void *cfe_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<cfe_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @cfe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void bzero(void *s, long unsigned int n) {
  char *p;
  for (p = s; n-- > 0; p++)
    *p = 0;
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    1145 <bzero+0x45>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <bzero+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %rsi,%rsi
je     1124 <bzero+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void show_banner(void) {
  fprintf(stderr, "\x1b[0;36m"
                  "afl-showmap "
                  "\x1b[1;97m"
                  "2.57b"
                  "\x1b[0m"
                  " by <lcamtuf@google.com>\n");
}


x86 assembly (clang, -O0):
<show_banner>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_banner>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"\1B[0;36mafl-showmap \1B[1;97m2.57b\1B[0m by <lcamtuf@google.com>\0A\00"
define void @show_banner() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"\1B[0;36mafl-showmap \1B[1;97m2.57b\1B[0m by <lcamtuf@google.com>\0A\00"
define void @show_banner() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret void
}
void wordsplit_free(char **ws) {
  if (ws) {
    char **c;
    for (c = ws; *c; c++) {
      free(*c);
    }
    free(ws);
  }
}


x86 assembly (clang, -O0):
<wordsplit_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <wordsplit_free+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     115a <wordsplit_free+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <wordsplit_free+0x1f>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordsplit_free>:
test   %rdi,%rdi
je     1150 <wordsplit_free+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <wordsplit_free+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <wordsplit_free+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @wordsplit_free(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
tail call void @free(i8* %7)
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
br label %14
14: ; preds = %12, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reset();
void menu_init() { reset(); }


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

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

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

LLVM IR (-O2):
define void @menu_init() {
%1 = tail call i32 (...) @reset()
ret void
}
/* Variables and functions */
int rand();
int get_rand(void) { return rand(); }


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

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

LLVM IR (-O0):
define i32 @get_rand() {
%1 = call i32 (...) @rand()
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_rand() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
void initialize(void) {}


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

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

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

LLVM IR (-O2):
define void @initialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ swap(int, int);
main() {
  int x, y;
  printf("Enter x & y\n");
  scanf("%d%d", &x, &y);
  swap(x, y);
}


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

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

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

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%d%d\00"
@str = [12 x i8] c"Enter x & y\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @swap(i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(unsigned int);
void f1() {
  int size = 10;
  void *ptr = malloc((unsigned)size);
  free(ptr);
}


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

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca i8*
store i32 10, i32* %1
%3 = load i32, i32* %1
%4 = call i8* @malloc(i32 %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @free(i8* %1)
ret void
}
__attribute__((noreturn)) void default_handler() {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<default_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <default_handler+0x9>
jmp    1109 <default_handler+0x9>

x86 assembly (clang, -O2):
<default_handler>:
jmp    1100 <default_handler>

LLVM IR (-O0):
define void @default_handler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @default_handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
void console_write(const char *str, int cnt) {}


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

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

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

LLVM IR (-O2):
define void @console_write(i8* nocapture %0, i32 %1) {
ret void
}
void foo208(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo208(i32 %0) {
ret void
}
/* Variables and functions */
int generic_proc_open(char *, char *);
int net_snmp_open(void) {
  return generic_proc_open("PROC_NET_SNMP", "net/snmp");
}


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

x86 assembly (clang, -O2):
<net_snmp_open>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <generic_proc_open@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"PROC_NET_SNMP\00"
@.str.1 = [9 x i8] c"net/snmp\00"
define i32 @net_snmp_open() {
%1 = call i32 @generic_proc_open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"PROC_NET_SNMP\00"
@.str.1 = [9 x i8] c"net/snmp\00"
define i32 @net_snmp_open() {
%1 = tail call i32 @generic_proc_open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ CG_AddAward(int /*<<< orphan*/);
int /*<<< orphan*/ trap_Cmd_Argv(int);
void CG_SC_AddAward(void) { CG_AddAward(trap_Cmd_Argv(1)); }


x86 assembly (clang, -O0):
<CG_SC_AddAward>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <trap_Cmd_Argv@plt>
mov    %eax,%edi
call   1030 <CG_AddAward@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_SC_AddAward>:
push   %rax
mov    $0x1,%edi
call   1040 <trap_Cmd_Argv@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <CG_AddAward@plt>

LLVM IR (-O0):
define void @CG_SC_AddAward() {
%1 = call i32 @trap_Cmd_Argv(i32 1)
%2 = call i32 @CG_AddAward(i32 %1)
ret void
}

LLVM IR (-O2):
define void @CG_SC_AddAward() {
%1 = tail call i32 @trap_Cmd_Argv(i32 1)
%2 = tail call i32 @CG_AddAward(i32 %1)
ret void
}
unsigned int djb2_hash(char *str) {
  unsigned long hash = 5381;
  int c;
  c = *str;
  while (c) {
    hash = ((hash << 5) + hash) + c;
    c = *++str;
  }
  return (unsigned int)(hash & ((1 << 6) - 1));
}


x86 assembly (clang, -O0):
<djb2_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1156 <djb2_hash+0x56>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl 0x1(%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    111a <djb2_hash+0x1a>
mov    -0x10(%rbp),%rax
and    $0x3f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb2_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112f <djb2_hash+0x2f>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <djb2_hash+0x10>
and    $0x3f,%eax
ret
mov    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @djb2_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 33
%9 = zext i8 %5 to i64
%10 = add i64 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = trunc i64 %10 to i32
%16 = and i32 %15, 63
br label %17
17: ; preds = %14, %1
%18 = phi i32 [ 5, %1 ], [ %16, %14 ]
ret i32 %18
}
int a_unsigned_cmp(const unsigned *x, const unsigned *y) { return *x - *y; }


x86 assembly (clang, -O0):
<a_unsigned_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @a_unsigned_cmp(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sub i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @a_unsigned_cmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int floor(double n) {
  n = (int)(n * 10) / 10;
  return n;
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
mulsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+01
%5 = fptosi double %4 to i32
%6 = sdiv i32 %5, 10
%7 = sitofp i32 %6 to double
store double %7, double* %2
%8 = load double, double* %2
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @floor(double %0) {
%2 = fmul double %0, 1.000000e+01
%3 = fptosi double %2 to i32
%4 = sdiv i32 %3, 10
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func2() { printf("this is func2"); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"this is func2\00"
define void @func2() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ getuid();
int reboot();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (getuid() != 0) {
    fprintf(stderr, "reboot: must be superuser\n");
    return 1;
  } else {
    sleep(1);
    return reboot();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
cmp    $0x0,%rax
je     1188 <main+0x48>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    119c <main+0x5c>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1050 <reboot@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
test   %rax,%rax
je     1169 <main+0x29>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <reboot@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"reboot: must be superuser\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 = call i64 (...) @getuid()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %14
11: ; preds = %2
%12 = call i32 @sleep(i32 1)
%13 = call i32 (...) @reboot()
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"reboot: must be superuser\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @getuid()
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %2
%9 = tail call i32 @sleep(i32 1)
%10 = tail call i32 (...) @reboot()
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ 1, %5 ], [ %10, %8 ]
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ time;
};
struct TYPE_4__ {
  TYPE_1__ xselection;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xselection_time(void *_p) {
  return (unsigned long)((XEvent *)_p)->xselection.time;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xselection_time(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xselection_time(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ fork_and_communicate();
int /*<<< orphan*/ print_arg_env(char **, char **);
int test_functions(int argc, char **argv, char **envp) {
  print_arg_env(argv, envp);
  while (true) {
    fork_and_communicate();
  }
  _exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<test_functions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <print_arg_env@plt>
mov    $0x0,%al
call   1040 <fork_and_communicate@plt>
jmp    1140 <test_functions+0x20>

x86 assembly (clang, -O2):
<test_functions>:
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <print_arg_env@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <fork_and_communicate@plt>
jmp    1130 <test_functions+0x10>

LLVM IR (-O0):
define i32 @test_functions(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %5
%8 = load i8**, i8*** %6
%9 = call i32 @print_arg_env(i8** %7, i8** %8)
br label %10
10: ; preds = %3, %10
%11 = call i32 (...) @fork_and_communicate()
br label %10
}

LLVM IR (-O2):
define i32 @test_functions(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @print_arg_env(i8** %1, i8** %2)
br label %5
5: ; preds = %3, %5
%6 = tail call i32 (...) @fork_and_communicate()
br label %5
}
long long as_int64(long long unsigned a) { return *((long long *)&a); }


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

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

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

LLVM IR (-O2):
define i64 @as_int64(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void print_system_error(char *message) {
  {
    perror((char const *)message);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<print_system_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_system_error>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @print_system_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @print_system_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int globusl_url_issafe(char x) {
  if (x == '$' || x == '-' || x == '_' || x == '.' || x == '+') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<globusl_url_issafe>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x24,%eax
je     114b <globusl_url_issafe+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     114b <globusl_url_issafe+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x5f,%eax
je     114b <globusl_url_issafe+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
je     114b <globusl_url_issafe+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
jne    1157 <globusl_url_issafe+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <globusl_url_issafe+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<globusl_url_issafe>:
add    $0xdc,%dil
cmp    $0x3b,%dil
ja     1124 <globusl_url_issafe+0x24>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x800000000000681,%rdx
bt     %rcx,%rdx
jae    1124 <globusl_url_issafe+0x24>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @globusl_url_issafe(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 36
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 95
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 46
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 43
br i1 %22, label %23, label %24
23: ; preds = %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %25
24: ; preds = %19
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @globusl_url_issafe(i8 signext %0) {
switch i8 %0, label %2 [
i8 95, label %3
i8 46, label %3
i8 45, label %3
i8 43, label %3
i8 36, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
char *getenv(char const *);
char *fgaj_getenv(const char *k0, const char *k1) {
  char *s = getenv(k0);
  if (s == NULL)
    s = getenv(k1);
  return s;
}


x86 assembly (clang, -O0):
<fgaj_getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1145 <fgaj_getenv+0x35>
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgaj_getenv>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1120 <fgaj_getenv+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @fgaj_getenv(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i8* @getenv(i8* %1)
br label %7
7: ; preds = %5, %2
%8 = phi i8* [ %6, %5 ], [ %3, %2 ]
ret i8* %8
}
void tsv_timestamp_read(struct encode_context *ectxt,
                        struct decode_context *dctxt, const char *format) {}


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

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

LLVM IR (-O0):
%struct.encode_context = type opaque
%struct.decode_context = type opaque
define void @tsv_timestamp_read(%struct.encode_context* %0, %struct.decode_context* %1, i8* %2) {
%4 = alloca %struct.encode_context*
%5 = alloca %struct.decode_context*
%6 = alloca i8*
store %struct.encode_context* %0, %struct.encode_context** %4
store %struct.decode_context* %1, %struct.decode_context** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.encode_context = type opaque
%struct.decode_context = type opaque
define void @tsv_timestamp_read(%struct.encode_context* nocapture %0, %struct.decode_context* nocapture %1, i8* nocapture %2) {
ret void
}