xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char *otp_decrypt(unsigned char *, size_t *, unsigned char const *,
                           size_t, unsigned char const *,
                           unsigned char const *);
unsigned char *crypt_decrypt_otp(unsigned char *out, size_t *out_len,
                                 const unsigned char *in, size_t in_len,
                                 const unsigned char *nonce,
                                 const unsigned char *key) {
  return otp_decrypt(out, out_len, in, in_len, nonce, key);
}


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

x86 assembly (clang, -O2):
<crypt_decrypt_otp>:
jmp    1030 <otp_decrypt@plt>

LLVM IR (-O0):
define i8* @crypt_decrypt_otp(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @otp_decrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_decrypt_otp(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @otp_decrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
int round_up_by_power_of_two(int x, int power_of_two) {
  return (x + power_of_two - 1) & ~(power_of_two - 1);
}


x86 assembly (clang, -O0):
<round_up_by_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up_by_power_of_two>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
neg    %esi
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @round_up_by_power_of_two(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 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = xor i32 %10, -1
%12 = and i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @round_up_by_power_of_two(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sub i32 0, %1
%6 = and i32 %4, %5
ret i32 %6
}
void av_mediacodec_render_buffer_at_time() {}


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

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

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

LLVM IR (-O2):
define void @av_mediacodec_render_buffer_at_time() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __assert_ptr_equals(char *, int, void *, int /*<<< orphan*/);
int /*<<< orphan*/ vm_lookup_native(char const *, char const *);
void assert_method_ptr_for(void *expected_ptr, const char *class_name,
                           const char *method_name) {
  __assert_ptr_equals("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/headius/jato/refs/"
                      "heads/master/test/unit/vm/natives-test.c",
                      42, (expected_ptr),
                      (vm_lookup_native(class_name, method_name)));
}


x86 assembly (clang, -O0):
<assert_method_ptr_for>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <vm_lookup_native@plt>
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
lea    0xeaa(%rip),%rdi
mov    $0x2a,%esi
call   1040 <__assert_ptr_equals@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_method_ptr_for>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <vm_lookup_native@plt>
lea    0xeca(%rip),%rdi
mov    $0x2a,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
jmp    1040 <__assert_ptr_equals@plt>

LLVM IR (-O0):
@.str = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/headius/jato/refs/heads/master/test/unit/vm/natives-test.c\00"
define void @assert_method_ptr_for(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @vm_lookup_native(i8* %8, i8* %9)
%11 = call i32 @__assert_ptr_equals(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0), i32 42, i8* %7, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/headius/jato/refs/heads/master/test/unit/vm/natives-test.c\00"
define void @assert_method_ptr_for(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @vm_lookup_native(i8* %1, i8* %2)
%5 = tail call i32 @__assert_ptr_equals(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0), i32 42, i8* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_int;
typedef scalar_t__ cl_command_queue;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clFinish(cl_command_queue command_queue) {
  unsigned int sys_args[1];
  sys_args[0] = (unsigned int)command_queue;
  return (cl_int)syscall(325, 1052, sys_args);
}


x86 assembly (clang, -O0):
<clFinish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdx
mov    $0x145,%edi
mov    $0x41c,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clFinish>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x145,%edi
mov    $0x41c,%esi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clFinish(i64 %0) {
%2 = alloca i64
%3 = alloca [1 x i32]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%8 = call i32 @syscall(i32 325, i32 1052, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @clFinish(i64 %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = trunc i64 %0 to i32
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 %4, i32* %5
%6 = call i32 @syscall(i32 325, i32 1052, i32* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void puts(char *str) {
  while (*str) {
    putchar(*str);
    str++;
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <puts+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <puts+0xc>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @puts(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 i32 @putchar(i8 signext %5)
%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
%12 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t ntoh24(const uint8_t *src) {
  return (uint32_t)src[0] << 16 | (uint32_t)src[1] << 8 | src[2];
}


x86 assembly (clang, -O0):
<ntoh24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0x8(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntoh24>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%eax
shl    $0x10,%ecx
shl    $0x8,%eax
or     %ecx,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ntoh24(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @ntoh24(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 16
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = or i32 %7, %9
ret i32 %10
}
/* Variables and functions */
size_t fwrite(char const *, int, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
size_t host_nputs(const char *str, size_t length) {
  return fwrite(str, 1, length, stderr);
}


x86 assembly (clang, -O0):
<host_nputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_nputs>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@stderr = global i32 0
define i64 @host_nputs(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
%6 = load i64, i64* %4
%7 = load i32, i32* @stderr
%8 = call i64 @fwrite(i8* %5, i32 1, i64 %6, i32 %7)
ret i64 %8
}

LLVM IR (-O2):
@stderr = global i32 0
define i64 @host_nputs(i8* %0, i64 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i64 @fwrite(i8* %0, i32 1, i64 %1, i32 %3)
ret i64 %4
}
void invert(unsigned *x, int p, int n) {
  *x = *x ^ (~(~0 << n) << (p - n + 1));
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
add    $0x1,%ecx
shl    %cl,%eax
mov    -0x14(%rbp),%ecx
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
shl    %cl,%eax
xor    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @invert(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32, i32* %6
%10 = shl i32 -1, %9
%11 = xor i32 %10, -1
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = sub nsw i32 %12, %13
%15 = add nsw i32 %14, 1
%16 = shl i32 %11, %15
%17 = xor i32 %8, %16
%18 = load i32*, i32** %4
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @invert(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = add i32 %1, 1
%8 = sub i32 %7, %2
%9 = shl i32 %6, %8
%10 = xor i32 %4, %9
store i32 %10, i32* %0
ret void
}
/* Type definitions */
struct pane {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __pane_check(int /*<<< orphan*/);
int /*<<< orphan*/ pane_root(struct pane *);
void pane_check(struct pane *p) { __pane_check(pane_root(p)); }


x86 assembly (clang, -O0):
<pane_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pane_root@plt>
mov    %eax,%edi
call   1040 <__pane_check@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pane_check>:
push   %rax
call   1030 <pane_root@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <__pane_check@plt>

LLVM IR (-O0):
%struct.pane = type { i32 }
define void @pane_check(%struct.pane* %0) {
%2 = alloca %struct.pane*
store %struct.pane* %0, %struct.pane** %2
%3 = load %struct.pane*, %struct.pane** %2
%4 = call i32 @pane_root(%struct.pane* %3)
%5 = call i32 @__pane_check(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.pane = type { i32 }
define void @pane_check(%struct.pane* %0) {
%2 = tail call i32 @pane_root(%struct.pane* %0)
%3 = tail call i32 @__pane_check(i32 %2)
ret void
}
/* Variables and functions */
int ceilf(float);
int __attribute__((always_)) fast_ceilf(float x) { return ceilf(x); }


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

x86 assembly (clang, -O2):
<fast_ceilf>:
jmp    1030 <ceilf@plt>

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

LLVM IR (-O2):
define i32 @fast_ceilf(float %0) {
%2 = tail call i32 @ceilf(float %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void handle_signal(int sig) {
  printf("received signal %d\n", sig);
  exit(0);
}


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

x86 assembly (clang, -O2):
<handle_signal>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"received signal %d\0A\00"
define void @handle_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"received signal %d\0A\00"
define void @handle_signal(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_ATTACH;
int /*<<< orphan*/ WUNTRACED;
scalar_t__ ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
                  int /*<<< orphan*/);
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
int ptrace_attach(pid_t pid) {
  if (ptrace(PTRACE_ATTACH, pid, NULL, 0) < 0) {
    return -1;
  }
  waitpid(pid, NULL, WUNTRACED);
  return 0;
}


x86 assembly (clang, -O0):
<ptrace_attach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
cmp    $0x0,%rax
jge    1158 <ptrace_attach+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <ptrace_attach+0x54>
mov    -0x8(%rbp),%edi
mov    0x2e76(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <waitpid@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_attach>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
mov    %ebp,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
test   %rax,%rax
js     1154 <ptrace_attach+0x34>
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
xor    %esi,%esi
call   1040 <waitpid@plt>
jmp    1159 <ptrace_attach+0x39>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@PTRACE_ATTACH = global i32 0
@WUNTRACED = global i32 0
define i32 @ptrace_attach(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* @PTRACE_ATTACH
%5 = load i32, i32* %3
%6 = call i64 @ptrace(i32 %4, i32 %5, i32* null, i32 0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = load i32, i32* @WUNTRACED
%12 = call i32 @waitpid(i32 %10, i32* null, i32 %11)
store i32 0, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@PTRACE_ATTACH = global i32 0
@WUNTRACED = global i32 0
define i32 @ptrace_attach(i32 %0) {
%2 = load i32, i32* @PTRACE_ATTACH
%3 = tail call i64 @ptrace(i32 %2, i32 %0, i32* null, i32 0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @WUNTRACED
%7 = tail call i32 @waitpid(i32 %0, i32* null, i32 %6)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ 0, %5 ], [ -1, %1 ]
ret i32 %9
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(scalar_t__ **, int *, int);
uint16_t ojp_ntohs(uint16_t val) {
  uint8_t bytes[2] = {0};
  memcpy(&bytes, &val, 2);
  return ((uint16_t)bytes[1] << 0) | ((uint16_t)bytes[0] << 8);
}


x86 assembly (clang, -O0):
<ojp_ntohs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
shl    $0x0,%eax
mov    -0x20(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ojp_ntohs>:
sub    $0x28,%rsp
mov    %edi,0xc(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    0x10(%rsp),%eax
shl    $0x8,%eax
or     0x18(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @ojp_ntohs(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i64]
store i32 %0, i32* %2
%4 = bitcast [2 x i64]* %3 to i8*
%5 = bitcast [2 x i64]* %3 to i64**
%6 = call i32 @memcpy(i64** %5, i32* %2, i32 2)
%7 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 0
%11 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @ojp_ntohs(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i64]
store i32 %0, i32* %2
%4 = bitcast [2 x i64]* %3 to i8*
%5 = bitcast [2 x i64]* %3 to i64**
%6 = call i32 @memcpy(i64** %5, i32* %2, i32 2)
%7 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %13, %9
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ print_cut_rod_solution(int *, int);
int main(int argc, const char *argv[]) {
  int p[11] = {0, 1, 5, 8, 9, 10, 17, 17, 20, 24, 30};
  print_cut_rod_solution(p, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x2c,%edx
call   1030 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x8,%esi
call   1040 <print_cut_rod_solution@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xf01(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <print_cut_rod_solution@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.p = [11 x i32] [i32 0, i32 1, i32 5, i32 8, i32 9, i32 10, i32 17, i32 17, i32 20, i32 24, i32 30]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [11 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [11 x i32]* %6 to i8*
%8 = getelementptr inbounds [11 x i32], [11 x i32]* %6, i64 0, i64 0
%9 = call i32 @print_cut_rod_solution(i32* %8, i32 8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.p = [11 x i32] [i32 0, i32 1, i32 5, i32 8, i32 9, i32 10, i32 17, i32 17, i32 20, i32 24, i32 30]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [11 x i32]
%4 = bitcast [11 x i32]* %3 to i8*
%5 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%6 = call i32 @print_cut_rod_solution(i32* %5, i32 8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_sha1;
int jksengine_digests_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
int jksengine_sha1_init(EVP_MD_CTX *ctx) {
  ;
  return (jksengine_digests_init(ctx, NID_sha1));
}


x86 assembly (clang, -O0):
<jksengine_sha1_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <jksengine_digests_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_sha1_init>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <jksengine_digests_init@plt>

LLVM IR (-O0):
@NID_sha1 = global i32 0
define i32 @jksengine_sha1_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @NID_sha1
%5 = call i32 @jksengine_digests_init(i32* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@NID_sha1 = global i32 0
define i32 @jksengine_sha1_init(i32* %0) {
%2 = load i32, i32* @NID_sha1
%3 = tail call i32 @jksengine_digests_init(i32* %0, i32 %2)
ret i32 %3
}
void ASN1_GENERALIZEDTIME_print(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_GENERALIZEDTIME_print() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ hexbyte(char const *);
void hex_to_bytes(const char *s, uint8_t *to) {
  for (; *s; s += 2)
    *to++ = (uint8_t)hexbyte(s);
}


x86 assembly (clang, -O0):
<hex_to_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <hex_to_bytes+0x4c>
mov    -0x8(%rbp),%rdi
call   1030 <hexbyte@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <hex_to_bytes+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_to_bytes>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     113a <hex_to_bytes+0x2a>
mov    %rsi,%rbx
mov    %rdi,%r14
nop
mov    %r14,%rdi
call   1030 <hexbyte@plt>
mov    %rax,(%rbx)
add    $0x8,%rbx
cmpb   $0x0,0x2(%r14)
lea    0x2(%r14),%r14
jne    1120 <hex_to_bytes+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @hex_to_bytes(i8* %0, i64* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64* [ %9, %5 ], [ %1, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = tail call i64 @hexbyte(i8* %7)
%9 = getelementptr inbounds i64, i64* %6, i64 1
store i64 %8, i64* %6
%10 = getelementptr inbounds i8, i8* %7, i64 2
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Internal_heap_unlink(char *, int, void *);
int /*<<< orphan*/ free(void *);
void myfree(char *file, int line, void *p) {
  Internal_heap_unlink(file, line, p);
  free(p);
}


x86 assembly (clang, -O0):
<myfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <Internal_heap_unlink@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfree>:
push   %rbx
mov    %rdx,%rbx
call   1040 <Internal_heap_unlink@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @myfree(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @Internal_heap_unlink(i8* %0, i32 %1, i8* %2)
%5 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ is_token(char const);
char *__skip_token(const char *s) {
  while (is_token(*s))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<__skip_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_token@plt>
cmp    $0x0,%rax
je     1143 <__skip_token+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <__skip_token+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__skip_token>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <is_token@plt>
test   %rax,%rax
jne    1120 <__skip_token+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @__skip_token(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @is_token(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int index;
  char s1[] = "helloworld";
  char s2[] = "lord";
  index = any(s1, s2);
  printf("%d\n", index);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x9(%rbp)
mov    0xeb7(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xeb2(%rip),%al
mov    %al,-0x14(%rbp)
lea    -0x13(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <any@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,0x8(%rsp)
movl   $0x646c72,0xf(%rsp)
movb   $0x0,0x4(%rsp)
movl   $0x64726f6c,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <any@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s1 = [11 x i8] c"helloworld\00"
@__const.main.s2 = [5 x i8] c"lord\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [11 x i8]
%4 = alloca [5 x i8]
store i32 0, i32* %1
%5 = bitcast [11 x i8]* %3 to i8*
%6 = bitcast [5 x i8]* %4 to i8*
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%9 = call i32 @any(i8* %7, i8* %8)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [11 x i8] c"helloworld\00"
@__const.main.s2 = [5 x i8] c"lord\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @any(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void uart0_interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @uart0_interrupt() {
ret void
}
void vera_mpx(m, buf, len) char *m, *buf;
int len;
{ print_vera_hex_string(m, buf, len); }


x86 assembly (clang, -O0):
<vera_mpx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <print_vera_hex_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vera_mpx(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @print_vera_hex_string to i32 (i8*, i8*, i32, ...)*)(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @vera_mpx(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @print_vera_hex_string to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 %2)
ret void
}
void foo252(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo252(i32 %0) {
ret void
}
void bitmap_set(unsigned char *bitmap, long idx) {
  unsigned int byte = idx / 8;
  unsigned int bit = idx & 7;
  bitmap[byte] |= 1 << bit;
}


x86 assembly (clang, -O0):
<bitmap_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7,%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_set>:
mov    %rsi,%rcx
lea    0x7(%rsi),%rax
test   %rsi,%rsi
cmovns %rsi,%rax
shr    $0x3,%rax
and    $0x7,%cl
mov    $0x1,%dl
shl    %cl,%dl
mov    %eax,%eax
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @bitmap_set(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = sdiv i64 %7, 8
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i64, i64* %4
%11 = and i64 %10, 7
%12 = trunc i64 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = shl i32 1, %13
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %20, %14
%22 = trunc i32 %21 to i8
store i8 %22, i8* %18
ret void
}

LLVM IR (-O2):
define void @bitmap_set(i8* nocapture %0, i64 %1) {
%3 = sdiv i64 %1, 8
%4 = trunc i64 %1 to i8
%5 = and i8 %4, 7
%6 = shl nuw i8 1, %5
%7 = and i64 %3, 4294967295
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = or i8 %9, %6
store i8 %10, i8* %8
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_v4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_v4_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void check_counter(int *ctr) { assert(*ctr != 0); }


x86 assembly (clang, -O0):
<check_counter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_counter>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
setne  %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @check_counter(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
define void @check_counter(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
void M68KDummyReset(void) {}


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

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

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

LLVM IR (-O2):
define void @M68KDummyReset() {
ret void
}
void outportw(unsigned int port, unsigned int value) {
  asm volatile("outw %%ax,%%dx;outb %%al,$0x80" ::"d"(port), "a"(value));
}


x86 assembly (clang, -O0):
<outportw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%eax
out    %ax,(%dx)
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<outportw>:
mov    %esi,%eax
mov    %edi,%edx
out    %ax,(%dx)
out    %al,$0x80
ret

LLVM IR (-O0):
define void @outportw(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
ret void
}

LLVM IR (-O2):
define void @outportw(i32 %0, i32 %1) {
tail call void asm sideeffect "outw %ax,%dx;outb %al,$$0x80", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void FPUFlushToZeroModeSet(uint32_t ui32Mode) {
  (*((volatile unsigned long *)(0xE000EF3C))) =
      ((*((volatile unsigned long *)(0xE000EF3C))) & ~(0x01000000)) | ui32Mode;
}


x86 assembly (clang, -O0):
<FPUFlushToZeroModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xe000ef3c,%eax
mov    (%rax),%rcx
and    $0xfffffffffeffffff,%rcx
mov    -0x8(%rbp),%rax
or     %rax,%rcx
mov    $0xe000ef3c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPUFlushToZeroModeSet>:
mov    %rdi,-0x8(%rsp)
mov    $0xe000ef3c,%eax
mov    $0xfffffffffeffffff,%rcx
and    (%rax),%rcx
or     -0x8(%rsp),%rcx
mov    %rcx,(%rax)
ret

LLVM IR (-O0):
define void @FPUFlushToZeroModeSet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 3758157628 to i64*)
%4 = and i64 %3, -16777217
%5 = load volatile i64, i64* %2
%6 = or i64 %4, %5
store volatile i64 %6, i64* inttoptr (i64 3758157628 to i64*)
ret void
}

LLVM IR (-O2):
define void @FPUFlushToZeroModeSet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 3758157628 to i64*)
%4 = and i64 %3, -16777217
%5 = load volatile i64, i64* %2
%6 = or i64 %4, %5
store volatile i64 %6, i64* inttoptr (i64 3758157628 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_fat(char const *);
void dump_fat_command(const char *path) { dump_fat(path); }


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

x86 assembly (clang, -O2):
<dump_fat_command>:
jmp    1030 <dump_fat@plt>

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

LLVM IR (-O2):
define void @dump_fat_command(i8* %0) {
%2 = tail call i32 @dump_fat(i8* %0)
ret void
}
int Operand_bt16_decode(unsigned int *valp) {
  *valp = *valp << 4;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_bt16_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x4,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_bt16_decode>:
shll   $0x4,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_bt16_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 4
store i32 %3, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PSInit(int *, char ***, int, int, int, int);
int test_module_init(int argc, char *argv[], int n) {
  PSInit(&argc, &argv, 3, n, n, n);
  return 0;
}


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

x86 assembly (clang, -O2):
<test_module_init>:
sub    $0x18,%rsp
mov    %edx,%ecx
mov    %edi,0xc(%rsp)
mov    %rsi,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
mov    %ecx,%r8d
mov    %ecx,%r9d
call   1030 <PSInit@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @test_module_init(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* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @PSInit(i32* %4, i8*** %5, i32 3, i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @test_module_init(i32 %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @PSInit(i32* %4, i8*** %5, i32 3, i32 %2, i32 %2, i32 %2)
ret i32 0
}
void SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface = [53 x i8] c"SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface\00"
define void @SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface = [53 x i8] c"SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface\00"
define void @SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface, i64 0, i64 0), i8* %0)
ret void
}
void foo065() {}


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

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

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

LLVM IR (-O2):
define void @foo065() {
ret void
}
int test_imm_D9uint32_reg(unsigned int val) {
  return ((val) & (0xD9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D9uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xd9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D9uint32_reg>:
test   $0xd9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D9uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 217
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_D9uint32_reg(i32 %0) {
%2 = and i32 %0, 217
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ draw(int, int);
void main() { draw(6, 7); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x7,%esi
call   1030 <draw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x6,%edi
mov    $0x7,%esi
jmp    1030 <draw@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @draw(i32 6, i32 7)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @draw(i32 6, i32 7)
ret void
}
unsigned int call_create(unsigned int descriptor, unsigned int pdescriptor,
                         char *name, unsigned int length) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @call_create(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @call_create(i32 %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
void pcp_def_serial_metrics(struct activity *a) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_def_serial_metrics(%struct.activity* nocapture %0) {
ret void
}
/* Variables and functions */
int *ivector(long, long);
int /*<<< orphan*/ set_ivector(int *, long, long, int);
int *ivector1(long nl, long nh) {
  int *v;
  v = ivector(nl, nh);
  set_ivector(v, nl, nh, 1);
  return v;
}


x86 assembly (clang, -O0):
<ivector1>:
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   1040 <ivector@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <set_ivector@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector1>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <ivector@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
call   1030 <set_ivector@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32* @ivector1(i64 %0, i64 %1) {
%3 = tail call i32* @ivector(i64 %0, i64 %1)
%4 = tail call i32 @set_ivector(i32* %3, i64 %0, i64 %1, i32 1)
ret i32* %3
}