xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *hash_kdup(void *key, size_t ks) {
  void *nk;
  if ((nk = malloc(ks)) == NULL)
    return (NULL);
  memcpy(nk, key, ks);
  return nk;
}


x86 assembly (clang, -O0):
<hash_kdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1154 <hash_kdup+0x34>
movq   $0x0,-0x8(%rbp)
jmp    116d <hash_kdup+0x4d>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_kdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <hash_kdup+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @hash_kdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %2, %5
ret i8* %3
}
void sock_initialize(void) {}


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

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

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

LLVM IR (-O2):
define void @sock_initialize() {
ret void
}
R0A1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if (r0 <= (*((signed char *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movsbl -0x5(%rbp),%eax
mov    $0xa98ac7,%ecx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jg     113e <R0A1+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <R0A1+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0A1>:
movsbl %dil,%ecx
movsbl 0xa98ac7,%edx
xor    %eax,%eax
cmp    %edx,%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @R0A1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = shl i32 %0, 24
%8 = ashr exact i32 %7, 24
%9 = load i8, i8* inttoptr (i64 11111111 to i8*)
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %8, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
void av_camellia_crypt() {}


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

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

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

LLVM IR (-O2):
define void @av_camellia_crypt() {
ret void
}
float fz_max(float a, float b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<fz_max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <fz_max+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <fz_max+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_max>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fz_max(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  union {
    uint32_t u;
    float f;
  } value;
  value.u = strtoul(argv[1], NULL, 16);
  printf("%f\n", value.f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %eax,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
movd   %eax,%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { i32 }
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %union.anon
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @strtoul(i8* %9, i32* null, i32 16)
%11 = bitcast %union.anon* %6 to i32*
store i32 %10, i32* %11
%12 = bitcast %union.anon* %6 to float*
%13 = load float, float* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strtoul(i8* nocapture %4, i32* null, i32 16)
%6 = bitcast i32 %5 to float
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delete_appendix(char *, char *);
int /*<<< orphan*/ delete_files(char *);
int main(int argc, char **argv) {
  delete_files("./dd");
  delete_appendix("./aa", ".c");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"./dd\00"
@.str.1 = [5 x i8] c"./aa\00"
@.str.2 = [3 x i8] c".c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @delete_files(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @delete_appendix(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"./dd\00"
@.str.1 = [5 x i8] c"./aa\00"
@.str.2 = [3 x i8] c".c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @delete_files(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @delete_appendix(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigpipe_handler(int sig) { printf("Client close socket connection\n"); }


x86 assembly (clang, -O0):
<sigpipe_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"Client close socket connection\0A\00"
define void @sigpipe_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"Client close socket connection\00"
define void @sigpipe_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _rs_stir();
void arc4random_stir(void) {
  ;
  _rs_stir();
  ;
}


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

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

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

LLVM IR (-O2):
define void @arc4random_stir() {
%1 = tail call i32 (...) @_rs_stir()
ret void
}
unsigned short int kern_ntohs(x)
unsigned short int x;
{ return ((((x) >> 8) | ((x) << 8)) & 0xffff); }


x86 assembly (clang, -O0):
<kern_ntohs>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
and    $0xffff,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kern_ntohs>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @kern_ntohs(i32 %0) {
%2 = alloca i16
%3 = trunc i32 %0 to i16
store i16 %3, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = ashr i32 %5, 8
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
%11 = and i32 %10, 65535
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @kern_ntohs(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
ret i16 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(int /*<<< orphan*/ const *, int, size_t, int /*<<< orphan*/ *);
size_t strnlen(char *, int);
bool dumpstr(const uint8_t *str, FILE *stream) {
  size_t length = strnlen((char *)str, 32);
  size_t wrote = fwrite(str, sizeof(uint8_t), length, stream);
  if (wrote >= length) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<dumpstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strnlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
call   1040 <fwrite@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     1176 <dumpstr+0x56>
movl   $0x1,-0x4(%rbp)
jmp    117d <dumpstr+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpstr>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x20,%esi
call   1030 <strnlen@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %rax,%rdx
mov    %r14,%rcx
call   1040 <fwrite@plt>
xor    %ecx,%ecx
cmp    %r15,%rax
setae  %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @dumpstr(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
%8 = load i32*, i32** %4
%9 = bitcast i32* %8 to i8*
%10 = call i64 @strnlen(i8* %9, i32 32)
store i64 %10, i64* %6
%11 = load i32*, i32** %4
%12 = load i64, i64* %6
%13 = load i32*, i32** %5
%14 = call i64 @fwrite(i32* %11, i32 4, i64 %12, i32* %13)
store i64 %14, i64* %7
%15 = load i64, i64* %7
%16 = load i64, i64* %6
%17 = icmp uge i64 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %2
store i32 1, i32* %3
br label %20
19: ; preds = %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @dumpstr(i32* %0, i32* nocapture %1) {
%3 = bitcast i32* %0 to i8*
%4 = tail call i64 @strnlen(i8* %3, i32 32)
%5 = tail call i64 @fwrite(i32* %0, i32 4, i64 %4, i32* %1)
%6 = icmp uge i64 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
int socket_v_abi(void) { return 0x20150625; }


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

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

LLVM IR (-O0):
define i32 @socket_v_abi() {
ret i32 538248741
}

LLVM IR (-O2):
define i32 @socket_v_abi() {
ret i32 538248741
}
double f(double x) { return x * x; }


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

x86 assembly (clang, -O2):
<f>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @f(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
char const *mode_name(int /*<<< orphan*/);
int /*<<< orphan*/ video_current_mode();
const char *video_name(void) { return mode_name(video_current_mode()); }


x86 assembly (clang, -O0):
<video_name>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <video_current_mode@plt>
mov    %eax,%edi
call   1040 <mode_name@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_name>:
push   %rax
xor    %eax,%eax
call   1030 <video_current_mode@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <mode_name@plt>

LLVM IR (-O0):
define i8* @video_name() {
%1 = call i32 (...) @video_current_mode()
%2 = call i8* @mode_name(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
define i8* @video_name() {
%1 = tail call i32 (...) @video_current_mode()
%2 = tail call i8* @mode_name(i32 %1)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int umorse_encode(char const *, size_t, int /*<<< orphan*/ *, size_t, int);
int umorse_encode_compact(const char *text, size_t tlen, uint8_t *code,
                          size_t clen) {
  return umorse_encode(text, tlen, code, clen, (0x1));
}


x86 assembly (clang, -O0):
<umorse_encode_compact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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
mov    -0x20(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <umorse_encode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umorse_encode_compact>:
mov    $0x1,%r8d
jmp    1030 <umorse_encode@plt>

LLVM IR (-O0):
define i32 @umorse_encode_compact(i8* %0, i64 %1, i32* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i32*, i32** %7
%12 = load i64, i64* %8
%13 = call i32 @umorse_encode(i8* %9, i64 %10, i32* %11, i64 %12, i32 1)
ret i32 %13
}

LLVM IR (-O2):
define i32 @umorse_encode_compact(i8* %0, i64 %1, i32* %2, i64 %3) {
%5 = tail call i32 @umorse_encode(i8* %0, i64 %1, i32* %2, i64 %3, i32 1)
ret i32 %5
}
unsigned int fast_pow10(unsigned int n) {
  unsigned int _pow10[10] = {1,      10,      100,      1000,      10000,
                             100000, 1000000, 10000000, 100000000, 1000000000};
  return _pow10[n % 10];
}


x86 assembly (clang, -O0):
<fast_pow10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
mov    -0x30(%rbp,%rax,4),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_pow10>:
mov    %edi,%eax
mov    $0xcccccccd,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%eax
sub    %eax,%edi
lea    0xee3(%rip),%rax
mov    (%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
@__const.fast_pow10._pow10 = [10 x i32] [i32 1, i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000, i32 1000000000]
define i32 @fast_pow10(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i32]
store i32 %0, i32* %2
%4 = bitcast [10 x i32]* %3 to i8*
%5 = load i32, i32* %2
%6 = urem i32 %5, 10
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
@__const.fast_pow10._pow10 = [10 x i32] [i32 1, i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000, i32 1000000000]
define i32 @fast_pow10(i32 %0) {
%2 = urem i32 %0, 10
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [10 x i32], [10 x i32]* @__const.fast_pow10._pow10, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ write_mair1(int /*<<< orphan*/);
void write_nmrr(uint32_t nmrr) { write_mair1(nmrr); }


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

x86 assembly (clang, -O2):
<write_nmrr>:
jmp    1030 <write_mair1@plt>

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

LLVM IR (-O2):
define void @write_nmrr(i32 %0) {
%2 = tail call i32 @write_mair1(i32 %0)
ret void
}
void intmapnew(int arraya[], int arrayb[], int arrayLength,
               int (*function)(int)) {
  for (int i = 0; i < arrayLength; i++) {
    arraya[i] = function(arrayb[i]);
  }
}


x86 assembly (clang, -O0):
<intmapnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1156 <intmapnew+0x56>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rdx
mov    (%rcx,%rdx,4),%edi
call   *%rax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111e <intmapnew+0x1e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intmapnew>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    1134 <intmapnew+0x34>
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %edx,%r13d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   *%r14
mov    %eax,(%r12,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1120 <intmapnew+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @intmapnew(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2, i32 (i32)* nocapture %3) {
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = zext i32 %2 to i64
br label %9
8: ; preds = %9, %4
ret void
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %15, %9 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = tail call i32 %3(i32 %12)
%14 = getelementptr inbounds i32, i32* %0, i64 %10
store i32 %13, i32* %14
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %7
br i1 %16, label %8, label %9
}
void *read_bounds_table_into_buf(unsigned long table_vaddr) {
  return (void *)table_vaddr;
}


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

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

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

LLVM IR (-O2):
define i8* @read_bounds_table_into_buf(i64 %0) {
%2 = inttoptr i64 %0 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ msDelay(int);
scalar_t__ owFirst(int /*<<< orphan*/, int, int /*<<< orphan*/);
scalar_t__ owNext(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ owTouchReset(int /*<<< orphan*/);
int owScan() {
  int nMem = 0;
  owTouchReset(0);
  msDelay(10);
  if (owFirst(0, 1, 0)) {
    nMem++;
    while (owNext(0, 1, 0)) {
      nMem++;
    }
  }
  return nMem;
}


x86 assembly (clang, -O0):
<owScan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1060 <owTouchReset@plt>
mov    $0xa,%edi
call   1040 <msDelay@plt>
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1030 <owFirst@plt>
cmp    $0x0,%rax
je     11ac <owScan+0x6c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1050 <owNext@plt>
cmp    $0x0,%rax
je     11a7 <owScan+0x67>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <owScan+0x41>
jmp    11ac <owScan+0x6c>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<owScan>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1060 <owTouchReset@plt>
mov    $0xa,%edi
call   1040 <msDelay@plt>
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <owFirst@plt>
test   %rax,%rax
je     1186 <owScan+0x46>
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <owNext@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1170 <owScan+0x30>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @owScan() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @owTouchReset(i32 0)
%3 = call i32 @msDelay(i32 10)
%4 = call i64 @owFirst(i32 0, i32 1, i32 0)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %0
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %9
9: ; preds = %12, %6
%10 = call i64 @owNext(i32 0, i32 1, i32 0)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %9
15: ; preds = %9
br label %16
16: ; preds = %15, %0
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @owScan() {
%1 = tail call i32 @owTouchReset(i32 0)
%2 = tail call i32 @msDelay(i32 10)
%3 = tail call i64 @owFirst(i32 0, i32 1, i32 0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ 1, %0 ]
%7 = tail call i64 @owNext(i32 0, i32 1, i32 0)
%8 = icmp eq i64 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %5
10: ; preds = %5, %0
%11 = phi i32 [ 0, %0 ], [ %6, %5 ]
ret i32 %11
}
int blk_mq_debugfs_register(struct request_queue *q) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.request_queue = type opaque
define i32 @blk_mq_debugfs_register(%struct.request_queue* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int stat(char *, struct stat *);
int test_source_exist(char *source, int *is_dir) {
  struct stat buf;
  int result = stat(source, &buf);
  if (!result) {
    *is_dir = S_ISDIR(buf.st_mode);
  }
  return result;
}


x86 assembly (clang, -O0):
<test_source_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    115a <test_source_exist+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_source_exist>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    113e <test_source_exist+0x1e>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,(%rbx)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @test_source_exist(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i32 @stat(i8* %0, %struct.stat* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i32 @S_ISDIR(i32 %9)
store i32 %10, i32* %1
br label %11
11: ; preds = %7, %2
ret i32 %5
}
/* Variables and functions */
int rand();
int rd() { return rand() % 2 == 0; }


x86 assembly (clang, -O0):
<rd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
not    %eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rd() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 2
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @rd() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int min = 3;
  int max = 15;
  int i = min + 1;
  for (; i < max; i++) {
    if (i % 2 != 0)
      printf("%d ", i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0xf,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1178 <main+0x68>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1165 <main+0x55>
mov    -0x10(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    116a <main+0x5a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <main+0x26>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 11)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ socketlist_reset_next();
void reset_next_socket(void) { socketlist_reset_next(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ Z_BEST_SPEED;
int /*<<< orphan*/ Z_DEFAULT_STRATEGY;
int /*<<< orphan*/ Z_DEFLATED;
int deflateInit2(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/,
                 int, int, int /*<<< orphan*/);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int init_z_stream(z_stream *stream) {
  memset(stream, 0, sizeof(*stream));
  return deflateInit2(stream, Z_BEST_SPEED, Z_DEFLATED, -14, 9,
                      Z_DEFAULT_STRATEGY);
}


x86 assembly (clang, -O0):
<init_z_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
mov    0x2e6f(%rip),%rax
mov    (%rax),%r9d
mov    $0xfffffff2,%ecx
mov    $0x9,%r8d
call   1040 <deflateInit2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_z_stream>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    0x2e7f(%rip),%rax
mov    (%rax),%r9d
mov    %rbx,%rdi
mov    $0xfffffff2,%ecx
mov    $0x9,%r8d
pop    %rbx
jmp    1040 <deflateInit2@plt>

LLVM IR (-O0):
@Z_BEST_SPEED = global i32 0
@Z_DEFLATED = global i32 0
@Z_DEFAULT_STRATEGY = global i32 0
define i32 @init_z_stream(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @memset(i32* %3, i32 0, i32 4)
%5 = load i32*, i32** %2
%6 = load i32, i32* @Z_BEST_SPEED
%7 = load i32, i32* @Z_DEFLATED
%8 = load i32, i32* @Z_DEFAULT_STRATEGY
%9 = call i32 @deflateInit2(i32* %5, i32 %6, i32 %7, i32 -14, i32 9, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@Z_BEST_SPEED = global i32 0
@Z_DEFLATED = global i32 0
@Z_DEFAULT_STRATEGY = global i32 0
define i32 @init_z_stream(i32* %0) {
%2 = tail call i32 @memset(i32* %0, i32 0, i32 4)
%3 = load i32, i32* @Z_BEST_SPEED
%4 = load i32, i32* @Z_DEFLATED
%5 = load i32, i32* @Z_DEFAULT_STRATEGY
%6 = tail call i32 @deflateInit2(i32* %0, i32 %3, i32 %4, i32 -14, i32 9, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ runtime_fixnumValue(long);
void prNum(long n) { printf("%ld", runtime_fixnumValue(n)); }


x86 assembly (clang, -O0):
<prNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <runtime_fixnumValue@plt>
mov    %eax,%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prNum>:
push   %rax
call   1040 <runtime_fixnumValue@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define void @prNum(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @runtime_fixnumValue(i64 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @prNum(i64 %0) {
%2 = tail call i32 @runtime_fixnumValue(i64 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void UARTEnable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000002C))) |= 0x00000010;
  (*((volatile uint32_t *)(ui32Base + 0x00000030))) |=
      (0x00000001 | 0x00000100 | 0x00000200);
}


x86 assembly (clang, -O0):
<UARTEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%ecx
or     $0x10,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%ecx
or     $0x301,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTEnable>:
movslq %edi,%rax
orl    $0x10,0x2c(%rax)
orl    $0x301,0x30(%rax)
ret

LLVM IR (-O0):
define void @UARTEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 44
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 16
store volatile i32 %8, i32* %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 48
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = or i32 %13, 769
store volatile i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @UARTEnable(i32 %0) {
%2 = add nsw i32 %0, 44
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 16
store volatile i32 %6, i32* %4
%7 = add nsw i32 %0, 48
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = or i32 %10, 769
store volatile i32 %11, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned int);
int __sleep(unsigned int time) {
  sleep(time);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @__sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void help(char *progname) {
  printf("%s compare|fpu|sse3|sse4 iter-count\n", progname);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"%s compare|fpu|sse3|sse4 iter-count\0A\00"
@EXIT_FAILURE = global i32 0
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [37 x i8] c"%s compare|fpu|sse3|sse4 iter-count\0A\00"
@EXIT_FAILURE = global i32 0
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
char *imalloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
char *istrdup(char *s) {
  char *m;
  int l;
  l = strlen(s) + 1;
  m = imalloc(l);
  memcpy(m, s, l);
  return m;
}


x86 assembly (clang, -O0):
<istrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <imalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<istrdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1040 <imalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @istrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i8* @imalloc(i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = load i32, i32* %4
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @istrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @imalloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
ret i8* %4
}
/* Type definitions */
struct mcuio_packet {
  int dummy;
};

/* Variables and functions */
int BIT(int);
int mcuio_packet_type(struct mcuio_packet *);
int mcuio_packet_is_fill_data(struct mcuio_packet *p) {
  return (mcuio_packet_type(p) & BIT(7));
}


x86 assembly (clang, -O0):
<mcuio_packet_is_fill_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mcuio_packet_type@plt>
mov    %eax,-0xc(%rbp)
mov    $0x7,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcuio_packet_is_fill_data>:
push   %rbx
call   1040 <mcuio_packet_type@plt>
mov    %eax,%ebx
mov    $0x7,%edi
call   1030 <BIT@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mcuio_packet = type { i32 }
define i32 @mcuio_packet_is_fill_data(%struct.mcuio_packet* %0) {
%2 = alloca %struct.mcuio_packet*
store %struct.mcuio_packet* %0, %struct.mcuio_packet** %2
%3 = load %struct.mcuio_packet*, %struct.mcuio_packet** %2
%4 = call i32 @mcuio_packet_type(%struct.mcuio_packet* %3)
%5 = call i32 @BIT(i32 7)
%6 = and i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.mcuio_packet = type { i32 }
define i32 @mcuio_packet_is_fill_data(%struct.mcuio_packet* %0) {
%2 = tail call i32 @mcuio_packet_type(%struct.mcuio_packet* %0)
%3 = tail call i32 @BIT(i32 7)
%4 = and i32 %3, %2
ret i32 %4
}
void CFGMR3QuerySIntDef(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QuerySIntDef() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void app_exit(int sig) {
  printf("Exit!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<app_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<app_exit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Exit!\0A\00"
define void @app_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [6 x i8] c"Exit!\00"
define void @app_exit(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double *memalign(int, size_t);
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, size_t);
double *zeros(size_t n) {
  double *buf;
  buf = memalign(16, n * sizeof(double));
  memset(buf, 0, n * sizeof(double));
  return buf;
}


x86 assembly (clang, -O0):
<zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
shl    $0x3,%rsi
mov    $0x10,%edi
call   1040 <memalign@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeros>:
push   %r14
push   %rbx
push   %rax
lea    0x0(,%rdi,8),%r14
mov    $0x10,%edi
mov    %r14,%rsi
call   1040 <memalign@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double* @zeros(i64 %0) {
%2 = alloca i64
%3 = alloca double*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 %4, 8
%6 = call double* @memalign(i32 16, i64 %5)
store double* %6, double** %3
%7 = load double*, double** %3
%8 = load i64, i64* %2
%9 = mul i64 %8, 8
%10 = call i32 @memset(double* %7, i32 0, i64 %9)
%11 = load double*, double** %3
ret double* %11
}

LLVM IR (-O2):
define double* @zeros(i64 %0) {
%2 = shl i64 %0, 3
%3 = tail call double* @memalign(i32 16, i64 %2)
%4 = tail call i32 @memset(double* %3, i32 0, i64 %2)
ret double* %3
}
void emit_type_definition_nat32(
    struct processor_explicatory_state *process_state,
    struct modern_stream *stream, void *stream_state,
    struct modern_vfile *vfile, void *vfile_state) {}


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

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_nat32(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_nat32(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, void *);
void verbose_free(void *buf) {
  free(buf);
  printf("free (%p)\n", buf);
}


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

x86 assembly (clang, -O2):
<verbose_free>:
push   %rbx
mov    %rdi,%rbx
call   1030 <free@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"free (%p)\0A\00"
define void @verbose_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"free (%p)\0A\00"
define void @verbose_free(i8* %0) {
%2 = tail call i32 @free(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}