xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t hash64_fmix(uint64_t x) {
  x = (x ^ (x >> 33)) * 14029467366897019727ULL;
  x = (x ^ (x >> 29)) * 1609587929392839161ULL;
  return x ^ (x >> 32);
}


x86 assembly (clang, -O0):
<hash64_fmix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%edx
mov    $0x21,%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
cltq
movabs $0xc2b2ae3d27d4eb4f,%rcx
ae b2 c2
imul   %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1d,%ecx
xor    %ecx,%eax
cltq
movabs $0x165667b19e3779f9,%rcx
67 56 16
imul   %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hash64_fmix(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 33
%6 = xor i32 %3, %5
%7 = sext i32 %6 to i64
%8 = mul i64 %7, -4417276706812531889
%9 = trunc i64 %8 to i32
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 29
%13 = xor i32 %10, %12
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 1609587929392839161
%16 = trunc i64 %15 to i32
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = load i32, i32* %2
%19 = ashr i32 %18, 32
%20 = xor i32 %17, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @hash64_fmix(i32 %0) {
ret i32 poison
}
void do_fxsave(void *p) {
  asm __volatile__("fxsave (%0)" : : "r"(p) : "memory");
}


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

x86 assembly (clang, -O2):
<do_fxsave>:
fxsave (%rdi)
ret

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

LLVM IR (-O2):
define void @do_fxsave(i8* %0) {
tail call void asm sideeffect "fxsave ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, char const *);
int open(char const *, int);
int open_pipe(const char *fname, int flags) {
  int fd = open(fname, flags);
  if (fd == -1)
    error(1, errno, "opening %s", fname);
  return fd;
}


x86 assembly (clang, -O0):
<open_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1166 <open_pipe+0x46>
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edi
lea    0xe9f(%rip),%rdx
call   1030 <error@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_pipe>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <open@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    114f <open_pipe+0x2f>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    0xebe(%rip),%rdx
mov    $0x1,%edi
mov    %rbx,%rcx
call   1030 <error@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
@.str = [11 x i8] c"opening %s\00"
define i32 @open_pipe(i8* %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @error(i32 1, i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %5, %2
ret i32 %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
scalar_t__ pthread_self();
int thread_rand(void *arg) {
  int64_t ord = (int64_t)arg;
  printf("Thread. Order: %ld, tid: %d\n", ord, (int)pthread_self());
  return ord << 1;
}


x86 assembly (clang, -O0):
<thread_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_rand>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xece(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Thread. Order: %ld, tid: %d\0A\00"
define i32 @thread_rand(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i64 (...) @pthread_self()
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
%10 = load i32, i32* %3
%11 = shl i32 %10, 1
ret i32 %11
}

LLVM IR (-O2):
@.str = [29 x i8] c"Thread. Order: %ld, tid: %d\0A\00"
define i32 @thread_rand(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i64 (...) @pthread_self()
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
%7 = shl i32 %3, 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fhexdump(int /*<<< orphan*/, unsigned int, void const *,
                            unsigned int);
int /*<<< orphan*/ stdout;
void hexdump(unsigned int address, const void *buffer, unsigned int bufsize) {
  fhexdump(stdout, address, buffer, bufsize);
}


x86 assembly (clang, -O0):
<hexdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <fhexdump@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fhexdump@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define void @hexdump(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fhexdump(i32 %4, i32 %0, i8* %1, i32 %2)
ret void
}
float getFormVol(float pars[]) {
  float form_vol;
  return form_vol;
}


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

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

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

LLVM IR (-O2):
define float @getFormVol(float* nocapture readnone %0) {
ret float undef
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int FUTEX_UNLOCK_PI;
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/ *, int, int /*<<< orphan*/,
            int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int futex_unlock_pi(u_int32_t *uaddr, int opflags) {
  return syscall(SYS_futex, uaddr, FUTEX_UNLOCK_PI | opflags, 0, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<futex_unlock_pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
or     -0xc(%rbp),%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_unlock_pi>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    0x2ec2(%rip),%rax
or     (%rax),%edx
movl   $0x0,(%rsp)
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SYS_futex = global i32 0
@FUTEX_UNLOCK_PI = global i32 0
define i32 @futex_unlock_pi(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @SYS_futex
%6 = load i32*, i32** %3
%7 = load i32, i32* @FUTEX_UNLOCK_PI
%8 = load i32, i32* %4
%9 = or i32 %7, %8
%10 = call i32 @syscall(i32 %5, i32* %6, i32 %9, i32 0, i32* null, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
@SYS_futex = global i32 0
@FUTEX_UNLOCK_PI = global i32 0
define i32 @futex_unlock_pi(i32* %0, i32 %1) {
%3 = load i32, i32* @SYS_futex
%4 = load i32, i32* @FUTEX_UNLOCK_PI
%5 = or i32 %4, %1
%6 = tail call i32 @syscall(i32 %3, i32* %0, i32 %5, i32 0, i32* null, i32* null, i32 0)
ret i32 %6
}
/* Variables and functions */
double atan(double);
double intr_wrap_015(double p1) { return atan(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_015>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define double @intr_wrap_015(double %0) {
%2 = tail call double @atan(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ Z_Free(void *);
void FS_FreeFile(void *buffer) { Z_Free(buffer); }


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

x86 assembly (clang, -O2):
<FS_FreeFile>:
jmp    1030 <Z_Free@plt>

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

LLVM IR (-O2):
define void @FS_FreeFile(i8* %0) {
%2 = tail call i32 @Z_Free(i8* %0)
ret void
}
int test4(int g, int h) { return g ^ (h & g); }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    -0x4(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
mov    %esi,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @test4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = and i32 %6, %7
%9 = xor i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test4(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
char tolower(char);
char *strlwr(char *s) {
  while (*s) {
    *s = tolower(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strlwr+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <strlwr+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @strlwr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void zraiseFunctionNameNotDefined(const char *fname) {
  printf("Error: Function name \"%s\" is not defined.\n", fname);
}


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

x86 assembly (clang, -O2):
<zraiseFunctionNameNotDefined>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Error: Function name \22%s\22 is not defined.\0A\00"
define void @zraiseFunctionNameNotDefined(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Error: Function name \22%s\22 is not defined.\0A\00"
define void @zraiseFunctionNameNotDefined(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_MultiplyVec3f_init(void) {
  _hmt_register_covercase("HMM_MultiplyVec3f", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_MultiplyVec3f_init>:
lea    0xee9(%rip),%rdi
lea    0xef4(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"HMM_MultiplyVec3f\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyVec3f_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"HMM_MultiplyVec3f\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_MultiplyVec3f_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void kbdEnable(void) {
  unsigned int *p;
  p = (unsigned int *)0xF0200000;
  *p = 2;
}


x86 assembly (clang, -O0):
<kbdEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf0200000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbdEnable>:
mov    $0xf0200000,%eax
movl   $0x2,(%rax)
ret

LLVM IR (-O0):
define void @kbdEnable() {
%1 = alloca i32*
store i32* inttoptr (i64 4028628992 to i32*), i32** %1
%2 = load i32*, i32** %1
store i32 2, i32* %2
ret void
}

LLVM IR (-O2):
define void @kbdEnable() {
store i32 2, i32* inttoptr (i64 4028628992 to i32*)
ret void
}
int fun780() { return 780; }


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

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

LLVM IR (-O0):
define i32 @fun780() {
ret i32 780
}

LLVM IR (-O2):
define i32 @fun780() {
ret i32 780
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printErr(char const *);
void fatal(char const *str) {
  printErr(str);
  exit(1);
}


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

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

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

LLVM IR (-O2):
define void @fatal(i8* %0) {
%2 = tail call i32 @printErr(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *strpbrk(char *, char *);
char *compatibleRegionName(char *regionInput) {
  char *p = strpbrk(regionInput, ":");
  *p = '-';
  return regionInput;
}


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

x86 assembly (clang, -O2):
<compatibleRegionName>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3a,%esi
call   1030 <strchr@plt>
movb   $0x2d,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c":\00"
define i8* @compatibleRegionName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strpbrk(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
store i8 45, i8* %6
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
define i8* @compatibleRegionName(i8* returned %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 58)
store i8 45, i8* %2
ret i8* %0
}
int main(int ac, char **av) { return 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
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
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct packed_double {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ packed_double_nbo(struct packed_double *);
void packed_double_to_host(struct packed_double *pd) { packed_double_nbo(pd); }


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

x86 assembly (clang, -O2):
<packed_double_to_host>:
jmp    1030 <packed_double_nbo@plt>

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

LLVM IR (-O2):
%struct.packed_double = type { i32 }
define void @packed_double_to_host(%struct.packed_double* %0) {
%2 = tail call i32 @packed_double_nbo(%struct.packed_double* %0)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
int test(void) {
  int sockfd = 4;
  struct sockaddr addr;
  socklen_t addrlen;
  return accept(sockfd, &addr, &addrlen);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <accept@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
mov    $0x4,%edi
call   1030 <accept@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca %struct.sockaddr
%3 = alloca i32
store i32 4, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @accept(i32 %4, %struct.sockaddr* %2, i32* %3)
ret i32 %5
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca %struct.sockaddr
%2 = alloca i32
%3 = bitcast %struct.sockaddr* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @accept(i32 4, %struct.sockaddr* %1, i32* %2)
ret i32 %5
}
int get_checksum(char *s) {
  return ((s[0] - '0') * 100) + ((s[1] - '0') * 10) + (s[2] - '0');
}


x86 assembly (clang, -O0):
<get_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0x64,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_checksum>:
movsbl (%rdi),%eax
imul   $0x64,%eax,%eax
movsbl 0x1(%rdi),%ecx
lea    (%rcx,%rcx,4),%ecx
movsbl 0x2(%rdi),%edx
lea    (%rax,%rcx,2),%eax
add    %edx,%eax
add    $0xffffeb30,%eax
ret

LLVM IR (-O0):
define i32 @get_checksum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 48
%8 = mul nsw i32 %7, 100
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
%14 = mul nsw i32 %13, 10
%15 = add nsw i32 %8, %14
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %19, 48
%21 = add nsw i32 %15, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_checksum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = mul nsw i32 %3, 100
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = mul nsw i32 %7, 10
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = add nsw i32 %4, -5328
%13 = add nsw i32 %12, %8
%14 = add nsw i32 %13, %11
ret i32 %14
}
void YF32_ISR(void) {}


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

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

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

LLVM IR (-O2):
define void @YF32_ISR() {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ pid_t;

/* Variables and functions */
uint32_t proc_info_hash(const pid_t pid) { return (uint32_t)pid % (32769); }


x86 assembly (clang, -O0):
<proc_info_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x8001,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_info_hash>:
movslq %edi,%rax
imul   $0x3fff8001,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2d,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0xf,%edx
add    %ecx,%edx
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @proc_info_hash(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = srem i32 %4, 32769
ret i32 %5
}

LLVM IR (-O2):
define i32 @proc_info_hash(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = srem i32 %2, 32769
ret i32 %3
}
void stdio_usb_init() {}


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

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

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

LLVM IR (-O2):
define void @stdio_usb_init() {
ret void
}
/* Variables and functions */
char *find(char *str, char needle) {
  if (needle == *str)
    return str;
  else
    return NULL;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    112e <find+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1136 <find+0x36>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
xor    %eax,%eax
cmp    %sil,(%rdi)
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @find(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
%5 = select i1 %4, i8* %0, i8* null
ret i8* %5
}
/* Variables and functions */
unsigned long random();
unsigned long xt_core_random_unsigned_long(unsigned long range) {
  return random() % range;
}


x86 assembly (clang, -O0):
<xt_core_random_unsigned_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    %rdx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xt_core_random_unsigned_long>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <random@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1131 <xt_core_random_unsigned_long+0x21>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @xt_core_random_unsigned_long(i64 %0) {
%2 = tail call i64 (...) @random()
%3 = urem i64 %2, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ VDP_fadeTo(int /*<<< orphan*/, int, unsigned short const *,
                              unsigned short, unsigned char);
void VDP_fadeAllTo(const unsigned short *pal, unsigned short numframe,
                   unsigned char async) {
  VDP_fadeTo(0, 63, pal, numframe, async);
}


x86 assembly (clang, -O0):
<VDP_fadeAllTo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xa(%rbp),%ax
xor    %edi,%edi
mov    $0x3f,%esi
movzwl %ax,%ecx
movzbl -0xb(%rbp),%r8d
call   1030 <VDP_fadeTo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VDP_fadeAllTo>:
mov    %edx,%r8d
mov    %esi,%ecx
mov    %rdi,%rdx
xor    %edi,%edi
mov    $0x3f,%esi
jmp    1030 <VDP_fadeTo@plt>

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

LLVM IR (-O2):
define void @VDP_fadeAllTo(i16* %0, i16 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @VDP_fadeTo(i32 0, i32 63, i16* %0, i16 zeroext %1, i8 zeroext %2)
ret void
}
void _glp_put_err_msg(const char *msg) {}


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

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

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

LLVM IR (-O2):
define void @_glp_put_err_msg(i8* nocapture %0) {
ret void
}
int sprint_symbol(char *buffer, unsigned long addr) {
  *buffer = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<sprint_symbol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_symbol>:
movb   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sprint_symbol(i8* nocapture writeonly %0, i64 %1) {
store i8 0, i8* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ html(char *);
int /*<<< orphan*/ htmlf(char *, int, char const *);
void html_status(int code, const char *msg, int more_headers) {
  htmlf("Status: %d %s\n", code, msg);
  if (!more_headers)
    html("\n");
}


x86 assembly (clang, -O0):
<html_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec0(%rip),%rdi
call   1040 <htmlf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    115b <html_status+0x3b>
lea    0xeb7(%rip),%rdi
call   1030 <html@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_status>:
push   %rbx
mov    %edx,%ebx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xed1(%rip),%rdi
call   1040 <htmlf@plt>
test   %ebx,%ebx
je     113a <html_status+0x1a>
pop    %rbx
ret
lea    0xecc(%rip),%rdi
pop    %rbx
jmp    1030 <html@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Status: %d %s\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @html_status(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = call i32 @htmlf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %3
%13 = call i32 @html(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Status: %d %s\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @html_status(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @htmlf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%5 = icmp eq i32 %2, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @html(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_channelstate_callback(char *name, int32_t channel_id,
                                  int32_t parent, char *description,
                                  uint32_t *links, uint32_t n_links,
                                  uint32_t *links_add, uint32_t n_links_add,
                                  uint32_t *links_remove,
                                  uint32_t n_links_remove, int32_t temporary,
                                  int32_t position, void *user_data) {
  printf("Obtained channel state\n");
}


x86 assembly (clang, -O0):
<mumble_channelstate_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"Obtained channel state\0A\00"
define void @mumble_channelstate_callback(i8* %0, i32 %1, i32 %2, i8* %3, i32* %4, i32 %5, i32* %6, i32 %7, i32* %8, i32 %9, i32 %10, i32 %11, i8* %12) {
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i32*
%19 = alloca i32
%20 = alloca i32*
%21 = alloca i32
%22 = alloca i32*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i8*
store i8* %0, i8** %14
store i32 %1, i32* %15
store i32 %2, i32* %16
store i8* %3, i8** %17
store i32* %4, i32** %18
store i32 %5, i32* %19
store i32* %6, i32** %20
store i32 %7, i32* %21
store i32* %8, i32** %22
store i32 %9, i32* %23
store i32 %10, i32* %24
store i32 %11, i32* %25
store i8* %12, i8** %26
%27 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Obtained channel state\00"
define void @mumble_channelstate_callback(i8* nocapture readnone %0, i32 %1, i32 %2, i8* nocapture readnone %3, i32* nocapture readnone %4, i32 %5, i32* nocapture readnone %6, i32 %7, i32* nocapture readnone %8, i32 %9, i32 %10, i32 %11, i8* nocapture readnone %12) {
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
float gammln(float xx) {}


x86 assembly (clang, -O0):
<gammln>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @gammln(float %0) {
ret float undef
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gmtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
void c_format_http_time(time_t src, char *dest) {
  struct tm t;
  gmtime_r(&src, &t);
  strftime(dest, 40, "%a, %d %b %Y %H:%M:%S GMT", &t);
}


x86 assembly (clang, -O0):
<c_format_http_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gmtime_r@plt>
mov    -0x10(%rbp),%rdi
mov    $0x28,%esi
lea    0xeb4(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_format_http_time>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
call   1030 <gmtime_r@plt>
lea    0xeb9(%rip),%rdx
mov    %rbx,%rdi
mov    $0x28,%esi
mov    %r14,%rcx
call   1040 <strftime@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [26 x i8] c"%a, %d %b %Y %H:%M:%S GMT\00"
define void @c_format_http_time(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.tm
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 @gmtime_r(i32* %3, %struct.tm* %5)
%7 = load i8*, i8** %4
%8 = call i32 @strftime(i8* %7, i32 40, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [26 x i8] c"%a, %d %b %Y %H:%M:%S GMT\00"
define void @c_format_http_time(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.tm
store i32 %0, i32* %3
%5 = bitcast %struct.tm* %4 to i8*
%6 = call i32 @gmtime_r(i32* %3, %struct.tm* %4)
%7 = call i32 @strftime(i8* %1, i32 40, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret void
}
/* Type definitions */
union bpf_attr {
  int bpf_fd;
  int /*<<< orphan*/ pathname;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_OBJ_PIN;
int /*<<< orphan*/ bzero(union bpf_attr *, int);
int /*<<< orphan*/ ptr_to_u64(void *);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_obj_pin(int fd, const char *pathname) {
  union bpf_attr attr;
  bzero(&attr, sizeof(attr));
  attr.pathname = ptr_to_u64((void *)pathname);
  attr.bpf_fd = fd;
  return sys_bpf(BPF_OBJ_PIN, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_obj_pin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   1050 <bzero@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ptr_to_u64@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_obj_pin>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %rsi,%rdi
call   1040 <ptr_to_u64@plt>
mov    %ebx,0x8(%rsp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_OBJ_PIN = global i32 0
define i32 @bpf_obj_pin(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %union.bpf_attr
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 @bzero(%union.bpf_attr* %5, i32 4)
%7 = load i8*, i8** %4
%8 = call i32 @ptr_to_u64(i8* %7)
%9 = bitcast %union.bpf_attr* %5 to i32*
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = bitcast %union.bpf_attr* %5 to i32*
store i32 %10, i32* %11
%12 = load i32, i32* @BPF_OBJ_PIN
%13 = call i32 @sys_bpf(i32 %12, %union.bpf_attr* %5, i32 4)
ret i32 %13
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_OBJ_PIN = global i32 0
define i32 @bpf_obj_pin(i32 %0, i8* %1) {
%3 = alloca %union.bpf_attr
%4 = bitcast %union.bpf_attr* %3 to i8*
%5 = tail call i32 @ptr_to_u64(i8* %1)
%6 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %3, i64 0, i32 0
store i32 %0, i32* %6
%7 = load i32, i32* @BPF_OBJ_PIN
%8 = call i32 @sys_bpf(i32 %7, %union.bpf_attr* %3, i32 4)
ret i32 %8
}
/* Variables and functions */
float CLOCKS_PER_SEC;
scalar_t__ clock();
float start_clock() { return (float)clock() / CLOCKS_PER_SEC; }


x86 assembly (clang, -O0):
<start_clock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec1(%rip),%rax
divss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_clock>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
divss  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global float 0.000000e+00
define float @start_clock() {
%1 = call i64 (...) @clock()
%2 = sitofp i64 %1 to float
%3 = load float, float* @CLOCKS_PER_SEC
%4 = fdiv float %2, %3
ret float %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global float 0.000000e+00
define float @start_clock() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to float
%3 = load float, float* @CLOCKS_PER_SEC
%4 = fdiv float %2, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void Usage(char *programName) {
  fprintf(stderr, "%s usage: %s -[o] -[c] [input file name]\n", programName,
          programName);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"%s usage: %s -[o] -[c] [input file name]\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"%s usage: %s -[o] -[c] [input file name]\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
void INT_Excep_CAN0_RXF0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CAN0_RXF0() {
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ abort();
int test(int);
main() {
  int x = INT_MAX;
  if (test(x) != x)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <test@plt>
cmp    -0x8(%rbp),%eax
je     1153 <main+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1040 <test@plt>
cmp    %ebx,%eax
jne    1139 <main+0x19>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @INT_MAX
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @test(i32 %4)
%6 = load i32, i32* %2
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @INT_MAX
%2 = tail call i32 @test(i32 %1)
%3 = icmp eq i32 %2, %1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}
/* Variables and functions */
scalar_t__ islower(char);
unsigned toupper(char c) {
  if (islower(c)) {
    return c - 'a' + 'A';
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1143 <toupper+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    114a <toupper+0x3a>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @toupper(i8 signext %0) {
%2 = tail call i64 @islower(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -32
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_ruby_comments() {
  test_parser_verify_parse(test_parser_sourcefile("ruby", " #comment"), "ruby",
                           "", "#comment", 0);
}


x86 assembly (clang, -O0):
<test_ruby_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec7(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ruby_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed0(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ruby\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_ruby_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"ruby\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_ruby_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mob_spawn(int);
int mob_delayspawn(int tid, unsigned int tick, int m, int n) {
  mob_spawn(m);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @mob_delayspawn(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @mob_spawn(i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handle_37(int /*<<< orphan*/);
int gen_37() {
  handle_37(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_37>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_37@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_37() {
%1 = call i32 @handle_37(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_37() {
%1 = tail call i32 @handle_37(i32 0)
ret i32 0
}