xunge/DecIR huggingface dataset:
/* Type definitions */
struct nouveau_channel {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ OUT_RING(struct nouveau_channel *, int);
void BEGIN_NVC0(struct nouveau_channel *chan, int subc, int mthd, int size) {
  OUT_RING(chan, 0x20000000 | (size << 16) | (subc << 13) | (mthd >> 2));
}


x86 assembly (clang, -O0):
<BEGIN_NVC0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
shl    $0x10,%esi
or     $0x20000000,%esi
mov    -0xc(%rbp),%eax
shl    $0xd,%eax
or     %eax,%esi
mov    -0x10(%rbp),%eax
sar    $0x2,%eax
or     %eax,%esi
call   1030 <OUT_RING@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BEGIN_NVC0>:
shl    $0x10,%ecx
shl    $0xd,%esi
sar    $0x2,%edx
or     %edx,%esi
or     %ecx,%esi
or     $0x20000000,%esi
jmp    1030 <OUT_RING@plt>

LLVM IR (-O0):
%struct.nouveau_channel = type { i32 }
define void @BEGIN_NVC0(%struct.nouveau_channel* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.nouveau_channel*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.nouveau_channel* %0, %struct.nouveau_channel** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.nouveau_channel*, %struct.nouveau_channel** %5
%10 = load i32, i32* %8
%11 = shl i32 %10, 16
%12 = or i32 536870912, %11
%13 = load i32, i32* %6
%14 = shl i32 %13, 13
%15 = or i32 %12, %14
%16 = load i32, i32* %7
%17 = ashr i32 %16, 2
%18 = or i32 %15, %17
%19 = call i32 @OUT_RING(%struct.nouveau_channel* %9, i32 %18)
ret void
}

LLVM IR (-O2):
%struct.nouveau_channel = type { i32 }
define void @BEGIN_NVC0(%struct.nouveau_channel* %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %3, 16
%6 = shl i32 %1, 13
%7 = ashr i32 %2, 2
%8 = or i32 %6, %7
%9 = or i32 %8, %5
%10 = or i32 %9, 536870912
%11 = tail call i32 @OUT_RING(%struct.nouveau_channel* %0, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CallBack1(int, void *);
void XOPNotice(const char *noticePtr) { CallBack1(8, (void *)noticePtr); }


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

x86 assembly (clang, -O2):
<XOPNotice>:
mov    %rdi,%rsi
mov    $0x8,%edi
jmp    1030 <CallBack1@plt>

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

LLVM IR (-O2):
define void @XOPNotice(i8* %0) {
%2 = tail call i32 @CallBack1(i32 8, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closep(int *);
void sync_close_parent(int fd[2]) {
  if (fd[1] != -1)
    closep(&fd[1]);
}


x86 assembly (clang, -O0):
<sync_close_parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,0x4(%rax)
je     1137 <sync_close_parent+0x27>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1030 <closep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_close_parent>:
cmpl   $0xffffffff,0x4(%rdi)
je     111f <sync_close_parent+0xf>
add    $0x4,%rdi
jmp    1030 <closep@plt>
ret

LLVM IR (-O0):
define void @sync_close_parent(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = call i32 @closep(i32* %9)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @sync_close_parent(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @closep(i32* %2)
br label %7
7: ; preds = %5, %1
ret void
}
void scalar_swap(float a[restrict 1], float b[restrict 1]) {
  const float new_a = *b;
  const float new_b = *a;
  *a = new_a;
  *b = new_b;
}


x86 assembly (clang, -O0):
<scalar_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalar_swap>:
movss  (%rsi),%xmm0
movss  (%rdi),%xmm1
movss  %xmm0,(%rdi)
movss  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @scalar_swap(float* noalias %0, float* noalias %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
%6 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%7 = load float*, float** %4
%8 = load float, float* %7
store float %8, float* %5
%9 = load float*, float** %3
%10 = load float, float* %9
store float %10, float* %6
%11 = load float, float* %5
%12 = load float*, float** %3
store float %11, float* %12
%13 = load float, float* %6
%14 = load float*, float** %4
store float %13, float* %14
ret void
}

LLVM IR (-O2):
define void @scalar_swap(float* noalias nocapture %0, float* noalias nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
store float %3, float* %0
store float %4, float* %1
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ gotcha_printf();
int /*<<< orphan*/ gotcha_strlen();
int main(int argc, char **argv) {
  gotcha_strlen();
  gotcha_printf();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <gotcha_strlen@plt>
mov    $0x0,%al
call   1040 <gotcha_printf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <gotcha_strlen@plt>
xor    %eax,%eax
call   1040 <gotcha_printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @gotcha_strlen()
%7 = call i32 (...) @gotcha_printf()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @gotcha_strlen()
%4 = tail call i32 (...) @gotcha_printf()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void procInst(char *t, char *d) {
  printf("processingInstruction [%s] [%s]\n", t, d);
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"processingInstruction [%s] [%s]\0A\00"
define void @procInst(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"processingInstruction [%s] [%s]\0A\00"
define void @procInst(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
short find_pos(short *);
void move_up(short *puzzle) {
  short temp, pos = find_pos(puzzle);
  temp = puzzle[pos];
  puzzle[pos] = puzzle[pos - 4];
  puzzle[pos - 4] = temp;
}


x86 assembly (clang, -O0):
<move_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <find_pos@plt>
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movswq -0xc(%rbp),%rcx
mov    (%rax,%rcx,2),%ax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movswl -0xc(%rbp),%ecx
sub    $0x4,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,2),%dx
mov    -0x8(%rbp),%rax
movswq -0xc(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0xa(%rbp),%dx
mov    -0x8(%rbp),%rax
movswl -0xc(%rbp),%ecx
sub    $0x4,%ecx
movslq %ecx,%rcx
mov    %dx,(%rax,%rcx,2)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_up>:
push   %rbx
mov    %rdi,%rbx
call   1030 <find_pos@plt>
movswq %ax,%rax
movzwl -0x8(%rbx,%rax,2),%ecx
movzwl (%rbx,%rax,2),%edx
mov    %cx,(%rbx,%rax,2)
mov    %dx,-0x8(%rbx,%rax,2)
pop    %rbx
ret

LLVM IR (-O0):
define void @move_up(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = call signext i16 @find_pos(i16* %5)
store i16 %6, i16* %4
%7 = load i16*, i16** %2
%8 = load i16, i16* %4
%9 = sext i16 %8 to i64
%10 = getelementptr inbounds i16, i16* %7, i64 %9
%11 = load i16, i16* %10
store i16 %11, i16* %3
%12 = load i16*, i16** %2
%13 = load i16, i16* %4
%14 = sext i16 %13 to i32
%15 = sub nsw i32 %14, 4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i16, i16* %12, i64 %16
%18 = load i16, i16* %17
%19 = load i16*, i16** %2
%20 = load i16, i16* %4
%21 = sext i16 %20 to i64
%22 = getelementptr inbounds i16, i16* %19, i64 %21
store i16 %18, i16* %22
%23 = load i16, i16* %3
%24 = load i16*, i16** %2
%25 = load i16, i16* %4
%26 = sext i16 %25 to i32
%27 = sub nsw i32 %26, 4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i16, i16* %24, i64 %28
store i16 %23, i16* %29
ret void
}

LLVM IR (-O2):
define void @move_up(i16* %0) {
%2 = tail call signext i16 @find_pos(i16* %0)
%3 = sext i16 %2 to i64
%4 = getelementptr inbounds i16, i16* %0, i64 %3
%5 = load i16, i16* %4
%6 = add nsw i64 %3, -4
%7 = getelementptr inbounds i16, i16* %0, i64 %6
%8 = load i16, i16* %7
store i16 %8, i16* %4
store i16 %5, i16* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, void *,
               int /*<<< orphan*/ *);
int /*<<< orphan*/ mips_change_level(int);
int /*<<< orphan*/ mips_change_optname(int);
int getsockopt_portable(int s, int level, int optname, void *optval,
                        socklen_t *optlen) {
  return getsockopt(s, mips_change_level(level), mips_change_optname(optname),
                    optval, optlen);
}


x86 assembly (clang, -O0):
<getsockopt_portable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <mips_change_level@plt>
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <mips_change_optname@plt>
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1040 <getsockopt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsockopt_portable>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %edx,%ebp
mov    %edi,%r12d
mov    %esi,%edi
call   1030 <mips_change_level@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1050 <mips_change_optname@plt>
mov    %r12d,%edi
mov    %ebx,%esi
mov    %eax,%edx
mov    %r15,%rcx
mov    %r14,%r8
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <getsockopt@plt>

LLVM IR (-O0):
define i32 @getsockopt_portable(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 @mips_change_level(i32 %12)
%14 = load i32, i32* %8
%15 = call i32 @mips_change_optname(i32 %14)
%16 = load i8*, i8** %9
%17 = load i32*, i32** %10
%18 = call i32 @getsockopt(i32 %11, i32 %13, i32 %15, i8* %16, i32* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @getsockopt_portable(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = tail call i32 @mips_change_level(i32 %1)
%7 = tail call i32 @mips_change_optname(i32 %2)
%8 = tail call i32 @getsockopt(i32 %0, i32 %6, i32 %7, i8* %3, i32* %4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
__attribute__((__weak__, __always___)) void softboundcets_free(void *ptr) {
  free(ptr);
}


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

x86 assembly (clang, -O2):
<softboundcets_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define weak void @softboundcets_free(i8* %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
unsigned long get_XButtonReleasedEvent_window(void *_p) {
  return (unsigned long)((XButtonReleasedEvent *)_p)->window;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XButtonReleasedEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ perror(char *);
int bot_serial_bytes_available(int fd) {
  int available = 0;
  if (ioctl(fd, FIONREAD, &available) != 0) {
    perror("Problem getting num bytes available.");
    return -1;
  }
  return available;
}


x86 assembly (clang, -O0):
<bot_serial_bytes_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     1169 <bot_serial_bytes_available+0x49>
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <bot_serial_bytes_available+0x4f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_serial_bytes_available>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
test   %rax,%rax
jne    1147 <bot_serial_bytes_available+0x27>
mov    0x4(%rsp),%eax
pop    %rcx
ret
lea    0xeb2(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FIONREAD = global i32 0
@.str = [37 x i8] c"Problem getting num bytes available.\00"
define i32 @bot_serial_bytes_available(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @FIONREAD
%7 = call i64 @ioctl(i32 %5, i32 %6, i32* %4)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@FIONREAD = global i32 0
@.str = [37 x i8] c"Problem getting num bytes available.\00"
define i32 @bot_serial_bytes_available(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @FIONREAD
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ -1, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int get_cpu_num() { return sysconf(_SC_NPROCESSORS_ONLN); }


x86 assembly (clang, -O0):
<get_cpu_num>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpu_num>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @get_cpu_num() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @get_cpu_num() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void recurse(int count) {
  if (count > 5) {
    return;
  }
  printf("count : %d\n", count);
  recurse(count + 1);
  printf("Count = %d\n", count);
}


x86 assembly (clang, -O0):
<recurse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jle    113a <recurse+0x1a>
jmp    1163 <recurse+0x43>
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <recurse@plt>
mov    -0x4(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurse>:
cmp    $0x6,%edi
jl     1126 <recurse+0x6>
ret
push   %rbx
mov    %edi,%ebx
lea    0xed0(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    0x1(%rbx),%edi
call   1030 <recurse@plt>
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"count : %d\0A\00"
@.str.1 = [12 x i8] c"Count = %d\0A\00"
define void @recurse(i32 %0) {
%2 = icmp sgt i32 %0, 5
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = add nsw i32 %0, 1
tail call void @recurse(i32 %6)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %3
}
/* Variables and functions */
size_t dng_get_header_size() { return 65536; }


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

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

LLVM IR (-O0):
define i64 @dng_get_header_size() {
ret i64 65536
}

LLVM IR (-O2):
define i64 @dng_get_header_size() {
ret i64 65536
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char n, m;
  scanf("%c", &n);
  m = 'z' - (n - 'a');
  printf("\n%c \n", m);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x2(%rbp)
lea    0xeb3(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0x7(%rsp),%al
movsbl %al,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [6 x i8] c"\0A%c \0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Variables and functions */
double log(double);
double _p3dKittlerTresholding_log(double x) {
  if (x > 0.0)
    return log(x);
  else
    return 0.0;
}


x86 assembly (clang, -O0):
<_p3dKittlerTresholding_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1143 <_p3dKittlerTresholding_log+0x33>
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    114b <_p3dKittlerTresholding_log+0x3b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_p3dKittlerTresholding_log>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    111f <_p3dKittlerTresholding_log+0xf>
jmp    1030 <log@plt>
xorpd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @_p3dKittlerTresholding_log(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @log(double %7)
store double %8, double* %2
br label %10
9: ; preds = %1
store double 0.000000e+00, double* %2
br label %10
10: ; preds = %9, %6
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @_p3dKittlerTresholding_log(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @log(double %0)
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ 0.000000e+00, %1 ]
ret double %6
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *jt_safecalloc(size_t bytes, size_t num) {
  void *mem = calloc(bytes, num);
  if (!mem) {
    fprintf(stderr, "Out of memory!\n");
    exit(1);
  }
  return mem;
}


x86 assembly (clang, -O0):
<jt_safecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <jt_safecalloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jt_safecalloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <jt_safecalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory!\0A\00"
define i8* @jt_safecalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory!\0A\00"
define noalias i8* @jt_safecalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
void __attribute__((__always___)) kol_screen_wait_rr() {
  asm volatile("int $0x40" ::"a"(18), "b"(14));
}


x86 assembly (clang, -O0):
<kol_screen_wait_rr>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x12,%eax
mov    $0xe,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_screen_wait_rr>:
push   %rbx
mov    $0x12,%eax
mov    $0xe,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kol_screen_wait_rr() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 18, i32 14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
__attribute__((__used__)) void *checked_malloc(size_t size) {
  void *p = malloc(size);
  assert(p);
  memset(p, 0, size);
  return p;
}


x86 assembly (clang, -O0):
<checked_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%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):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i8* (i64)* @checked_malloc to i8*)], section "llvm.metadata"
define i8* @checked_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %3
%9 = load i64, i64* %2
%10 = call i32 @memset(i8* %8, i32 0, i64 %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i8* (i64)* @checked_malloc to i8*)], section "llvm.metadata"
define i8* @checked_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @assert(i8* %2)
%4 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
unsigned int spi_transfer8(volatile unsigned int *base, unsigned int val) {
  *(base + 1) = val;
  return *(base + 1);
}


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

x86 assembly (clang, -O2):
<spi_transfer8>:
mov    %esi,0x4(%rdi)
mov    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @spi_transfer8(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 1
store volatile i32 %5, i32* %7
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load volatile i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @spi_transfer8(i32* %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
ret i32 %4
}
/* Type definitions */
typedef int uintmax_t;

/* Variables and functions */
int /*<<< orphan*/ arr_malloc_size(int, int);
int /*<<< orphan*/ assert(int);
char *malloc_or_die(int /*<<< orphan*/);
char *int_as_hex_digit(const uintmax_t i) {
  assert(i < 16);
  char *const c = malloc_or_die(arr_malloc_size((2), sizeof(char)));
  c[0] = "0123456789ABCDEF"[i];
  c[1] = 0;
  return c;
}


x86 assembly (clang, -O0):
<int_as_hex_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <arr_malloc_size@plt>
mov    %eax,%edi
call   1050 <malloc_or_die@plt>
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
lea    0xe8f(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_as_hex_digit>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x10,%ebx
setl   %dil
call   1040 <assert@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <arr_malloc_size@plt>
mov    %eax,%edi
call   1050 <malloc_or_die@plt>
movslq %ebx,%rcx
lea    0xe9f(%rip),%rdx
mov    (%rcx,%rdx,1),%cl
mov    %cl,(%rax)
movb   $0x0,0x1(%rax)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define i8* @int_as_hex_digit(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 16
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i32 @arr_malloc_size(i32 2, i32 1)
%9 = call i8* @malloc_or_die(i32 %8)
store i8* %9, i8** %3
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 %13, i8* %15
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 0, i8* %17
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define i8* @int_as_hex_digit(i32 %0) {
%2 = icmp slt i32 %0, 16
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @arr_malloc_size(i32 2, i32 1)
%6 = tail call i8* @malloc_or_die(i32 %5)
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8 0, i8* %10
ret i8* %6
}
void null_scene_load() {}


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

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

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

LLVM IR (-O2):
define void @null_scene_load() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void t(int x) { fprintf(stderr, "%c%d\n", 't', x); }


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x74,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x74,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 116, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @t(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 116, i32 %0)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t compute_hash(uint32_t data) {
  uint64_t hash;
  hash = data;
  hash *= 0xB2D06057;
  hash >>= 16;
  hash *= 0xB2D06057;
  hash >>= 16;
  return hash;
}


x86 assembly (clang, -O0):
<compute_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
imul   $0xb2d06057,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x8(%rbp)
imul   $0xb2d06057,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_hash>:
imul   $0xb2d06057,%edi,%eax
sar    $0x10,%eax
imul   $0xb2d06057,%eax,%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @compute_hash(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = mul i32 %5, -1294966697
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = ashr i32 %7, 16
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = mul i32 %9, -1294966697
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = ashr i32 %11, 16
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @compute_hash(i32 %0) {
%2 = mul i32 %0, -1294966697
%3 = ashr i32 %2, 16
%4 = mul i32 %3, -1294966697
%5 = ashr i32 %4, 16
ret i32 %5
}
char *mkprints(src, len)
unsigned char *src;
unsigned int len;
{
  register char *dst = (char *)malloc(len * 4 + 1);
  mkprint(dst, src, len);
  return dst;
}


x86 assembly (clang, -O0):
<mkprints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1030 <mkprint@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkprints>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(,%r15,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1030 <mkprint@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mkprints(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = mul i32 %6, 4
%8 = add i32 %7, 1
%9 = zext i32 %8 to i64
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mkprint to i32 (i8*, i8*, i32, ...)*)(i8* %11, i8* %12, i32 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @mkprints(i8* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = or i32 %3, 1
%5 = zext i32 %4 to i64
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mkprint to i32 (i8*, i8*, i32, ...)*)(i8* %6, i8* %0, i32 %1)
ret i8* %6
}
void RTFileAioReqCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileAioReqCreate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_nop(void) { op_write1(0x00); }


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

x86 assembly (clang, -O2):
<op_enc_nop>:
xor    %edi,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_nop() {
%1 = call i32 @op_write1(i32 0)
ret void
}

LLVM IR (-O2):
define void @op_enc_nop() {
%1 = tail call i32 @op_write1(i32 0)
ret void
}
void ff_hevc_put_hevc_uni_pel_pixels48_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_pel_pixels48_10_sse4() {
ret void
}
/* Type definitions */
typedef uintptr_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ ptr_tag(void *);
void *tag_ptr(void *p, uint32_t tag) {
  assert((tag & ~((uintptr_t)0x3)) == 0 && ptr_tag(p) == 0);
  return (void *)(((uintptr_t)p) | (uintptr_t)tag);
}


x86 assembly (clang, -O0):
<tag_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
and    $0xfffffffffffffffc,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115a <tag_ptr+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <ptr_tag@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
or     -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag_ptr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x3,%rsi
ja     1143 <tag_ptr+0x23>
mov    %rbx,%rdi
call   1040 <ptr_tag@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
or     %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @tag_ptr(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, -4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i64 @ptr_tag(i8* %9)
%11 = icmp eq i64 %10, 0
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ false, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i8*, i8** %3
%17 = ptrtoint i8* %16 to i64
%18 = load i64, i64* %4
%19 = or i64 %17, %18
%20 = inttoptr i64 %19 to i8*
ret i8* %20
}

LLVM IR (-O2):
define i8* @tag_ptr(i8* %0, i64 %1) {
%3 = icmp ult i64 %1, 4
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i64 @ptr_tag(i8* %0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 0, %2 ], [ %7, %4 ]
%10 = tail call i32 @assert(i32 %9)
%11 = ptrtoint i8* %0 to i64
%12 = or i64 %11, %1
%13 = inttoptr i64 %12 to i8*
ret i8* %13
}
void pause_handler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @pause_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void kmem_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<kmem_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @kmem_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
long labs(long x) { return x >= 0 ? x : -x; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     1120 <labs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sge i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int gob_encode_unsigned_int(char *, size_t, size_t);
int gob_start_array(char *buf, size_t buf_size, size_t size) {
  return gob_encode_unsigned_int(buf, buf_size, size);
}


x86 assembly (clang, -O0):
<gob_start_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <gob_encode_unsigned_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gob_start_array>:
jmp    1030 <gob_encode_unsigned_int@plt>

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

LLVM IR (-O2):
define i32 @gob_start_array(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @gob_encode_unsigned_int(i8* %0, i64 %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void perror_exit(char *error_message) {
  printf("error: %s\n", error_message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<perror_exit>:
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):
<perror_exit>:
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 = [11 x i8] c"error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @perror_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 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 = [11 x i8] c"error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @perror_exit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 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 */
int /*<<< orphan*/ exit(int);
void realExit(int status) { exit(status); }


x86 assembly (clang, -O0):
<realExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<realExit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @realExit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
void main_thread_bootstrap() {}


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

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

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

LLVM IR (-O2):
define void @main_thread_bootstrap() {
ret void
}
int cmp_int(const void *a, const void *b) { return *(int *)a - *(int *)b; }


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

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

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

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x94() {
  Assert_real((isbdigit(148) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              745, ("isbdigit should be 0 for 0x94"));
}


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

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

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

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