xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void ok() {
  char *p = malloc(20);
  p[0] = 5;
  p[19] = 9;
  free(p);
}


x86 assembly (clang, -O0):
<ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x5,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x9,0x13(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ok>:
push   %rax
mov    $0x14,%edi
call   1040 <malloc@plt>
movb   $0x5,(%rax)
movb   $0x9,0x13(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ok() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 20)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 5, i8* %4
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 19
store i8 9, i8* %6
%7 = load i8*, i8** %1
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @ok() {
%1 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
store i8 5, i8* %1
%2 = getelementptr inbounds i8, i8* %1, i64 19
store i8 9, i8* %2
%3 = tail call i32 @free(i8* %1)
ret void
}
int queue_max_size(void) { return 32; }


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

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

LLVM IR (-O0):
define i32 @queue_max_size() {
ret i32 32
}

LLVM IR (-O2):
define i32 @queue_max_size() {
ret i32 32
}
int fun1251() { return 1251; }


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

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

LLVM IR (-O0):
define i32 @fun1251() {
ret i32 1251
}

LLVM IR (-O2):
define i32 @fun1251() {
ret i32 1251
}
/* Variables and functions */
bool nrfx_usbd_errata_166(void) { return (1 && true); }


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

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

LLVM IR (-O0):
define i32 @nrfx_usbd_errata_166() {
ret i32 1
}

LLVM IR (-O2):
define i32 @nrfx_usbd_errata_166() {
ret i32 1
}
float phi1(float mu, float psi) { return (1.0 - mu) * (1.0 - psi); }


x86 assembly (clang, -O0):
<phi1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
subsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xecc(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<phi1>:
unpcklps %xmm1,%xmm0
cvtps2pd %xmm0,%xmm0
movapd 0xef2(%rip),%xmm1
subpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @phi1(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fsub double 1.000000e+00, %6
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = fsub double 1.000000e+00, %9
%11 = fmul double %7, %10
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
define float @phi1(float %0, float %1) {
%3 = insertelement <2 x float> poison, float %0, i64 0
%4 = insertelement <2 x float> %3, float %1, i64 1
%5 = fpext <2 x float> %4 to <2 x double>
%6 = fsub <2 x double> <double 1.000000e+00, double 1.000000e+00>, %5
%7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%8 = fmul <2 x double> %6, %7
%9 = extractelement <2 x double> %8, i64 0
%10 = fptrunc double %9 to float
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
extern void r6000_asid_setup(void) { panic("r6000_asid_setup: implement me"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"r6000_asid_setup: implement me\00"
define void @r6000_asid_setup() {
%1 = call i32 @panic(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"r6000_asid_setup: implement me\00"
define void @r6000_asid_setup() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int errno;
int outside_errno(void) { return errno; }


x86 assembly (clang, -O0):
<outside_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<outside_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @outside_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @outside_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sgen(char *, char *, char *);
void cgincgb(char *s) { sgen("%s\t%s", "incb", s); }


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

x86 assembly (clang, -O2):
<cgincgb>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <sgen@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s\09%s\00"
@.str.1 = [5 x i8] c"incb\00"
define void @cgincgb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sgen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s\09%s\00"
@.str.1 = [5 x i8] c"incb\00"
define void @cgincgb(i8* %0) {
%2 = tail call i32 @sgen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct buffer {
  int dummy;
};
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ buffer_size(struct buffer *);
int /*<<< orphan*/ buffer_start(struct buffer *);
scalar_t__ write_in_full(int, int /*<<< orphan*/, scalar_t__);
ssize_t buffer_write(struct buffer *self, int fd) {
  ssize_t count, nr;
  count = buffer_size(self);
  nr = write_in_full(fd, buffer_start(self), count);
  if (nr != count)
    return -1;
  return nr;
}


x86 assembly (clang, -O0):
<buffer_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <buffer_size@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <buffer_start@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%esi
mov    -0x20(%rbp),%rdx
call   1030 <write_in_full@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     1188 <buffer_write+0x58>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1190 <buffer_write+0x60>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_write>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1050 <buffer_size@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1040 <buffer_start@plt>
mov    %r14d,%edi
mov    %eax,%esi
mov    %rbp,%rdx
call   1030 <write_in_full@plt>
cmp    %rbp,%rax
mov    $0xffffffffffffffff,%rcx
cmovne %rcx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i64 @buffer_write(%struct.buffer* %0, i32 %1) {
%3 = alloca i64
%4 = alloca %struct.buffer*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
store %struct.buffer* %0, %struct.buffer** %4
store i32 %1, i32* %5
%8 = load %struct.buffer*, %struct.buffer** %4
%9 = call i64 @buffer_size(%struct.buffer* %8)
store i64 %9, i64* %6
%10 = load i32, i32* %5
%11 = load %struct.buffer*, %struct.buffer** %4
%12 = call i32 @buffer_start(%struct.buffer* %11)
%13 = load i64, i64* %6
%14 = call i64 @write_in_full(i32 %10, i32 %12, i64 %13)
store i64 %14, i64* %7
%15 = load i64, i64* %7
%16 = load i64, i64* %6
%17 = icmp ne i64 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %2
store i64 -1, i64* %3
br label %21
19: ; preds = %2
%20 = load i64, i64* %7
store i64 %20, i64* %3
br label %21
21: ; preds = %19, %18
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i64 @buffer_write(%struct.buffer* %0, i32 %1) {
%3 = tail call i64 @buffer_size(%struct.buffer* %0)
%4 = tail call i32 @buffer_start(%struct.buffer* %0)
%5 = tail call i64 @write_in_full(i32 %1, i32 %4, i64 %3)
%6 = icmp eq i64 %5, %3
%7 = select i1 %6, i64 %5, i64 -1
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_rwlock_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_rwlock_init(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_rwlock_rdlock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_rwlock_unlock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_rwlock_wrlock(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  pthread_rwlock_t lock;
  pthread_rwlock_init(&lock, NULL);
  pthread_rwlock_rdlock(&lock);
  pthread_rwlock_unlock(&lock);
  pthread_rwlock_wrlock(&lock);
  pthread_rwlock_unlock(&lock);
  pthread_rwlock_destroy(&lock);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <pthread_rwlock_init@plt>
lea    -0x14(%rbp),%rdi
call   1050 <pthread_rwlock_rdlock@plt>
lea    -0x14(%rbp),%rdi
call   1070 <pthread_rwlock_unlock@plt>
lea    -0x14(%rbp),%rdi
call   1030 <pthread_rwlock_wrlock@plt>
lea    -0x14(%rbp),%rdi
call   1070 <pthread_rwlock_unlock@plt>
lea    -0x14(%rbp),%rdi
call   1040 <pthread_rwlock_destroy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <pthread_rwlock_init@plt>
mov    %rbx,%rdi
call   1050 <pthread_rwlock_rdlock@plt>
mov    %rbx,%rdi
call   1070 <pthread_rwlock_unlock@plt>
mov    %rbx,%rdi
call   1030 <pthread_rwlock_wrlock@plt>
mov    %rbx,%rdi
call   1070 <pthread_rwlock_unlock@plt>
mov    %rbx,%rdi
call   1040 <pthread_rwlock_destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @pthread_rwlock_init(i32* %6, i32* null)
%8 = call i32 @pthread_rwlock_rdlock(i32* %6)
%9 = call i32 @pthread_rwlock_unlock(i32* %6)
%10 = call i32 @pthread_rwlock_wrlock(i32* %6)
%11 = call i32 @pthread_rwlock_unlock(i32* %6)
%12 = call i32 @pthread_rwlock_destroy(i32* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @pthread_rwlock_init(i32* %3, i32* null)
%6 = call i32 @pthread_rwlock_rdlock(i32* %3)
%7 = call i32 @pthread_rwlock_unlock(i32* %3)
%8 = call i32 @pthread_rwlock_wrlock(i32* %3)
%9 = call i32 @pthread_rwlock_unlock(i32* %3)
%10 = call i32 @pthread_rwlock_destroy(i32* %3)
ret i32 0
}
int mx50_revision(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @mx50_revision() {
ret i32 0
}

LLVM IR (-O2):
define i32 @mx50_revision() {
ret i32 0
}
int et_list_lock(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @et_list_lock() {
ret i32 0
}

LLVM IR (-O2):
define i32 @et_list_lock() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func1() { printf("func1()\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"func1()\00"
define void @func1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
int log_open_with_buffer(const char *filename, int size) { return -5; }


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

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

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

LLVM IR (-O2):
define i32 @log_open_with_buffer(i8* nocapture readnone %0, i32 %1) {
ret i32 -5
}
void foo() {
  char a, b;
  a = b + 5;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsbl -0x2(%rbp),%eax
add    $0x5,%eax
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i8
%2 = alloca i8
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, 5
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Type definitions */
typedef int uint16_t;
struct p4_header {
  int dummy;
};

/* Variables and functions */
struct p4_header *unpack_p4_header(char *buffer, uint16_t offset) {
  return (struct p4_header *)(buffer + offset);
}


x86 assembly (clang, -O0):
<unpack_p4_header>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_p4_header>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
%struct.p4_header = type { i32 }
define %struct.p4_header* @unpack_p4_header(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to %struct.p4_header*
ret %struct.p4_header* %9
}

LLVM IR (-O2):
%struct.p4_header = type { i32 }
define %struct.p4_header* @unpack_p4_header(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to %struct.p4_header*
ret %struct.p4_header* %5
}
/* Variables and functions */
double DProbNormal(int /*<<< orphan*/);
int /*<<< orphan*/ DRanNormalPolar();
double DRanQuanNormal(void) { return DProbNormal(DRanNormalPolar()); }


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

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

LLVM IR (-O0):
define double @DRanQuanNormal() {
%1 = call i32 (...) @DRanNormalPolar()
%2 = call double @DProbNormal(i32 %1)
ret double %2
}

LLVM IR (-O2):
define double @DRanQuanNormal() {
%1 = tail call i32 (...) @DRanNormalPolar()
%2 = tail call double @DProbNormal(i32 %1)
ret double %2
}
int allaction2action(int completeaction) { return (completeaction)&3; }


x86 assembly (clang, -O0):
<allaction2action>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<allaction2action>:
mov    %edi,%eax
and    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @allaction2action(i32 %0) {
%2 = and i32 %0, 3
ret i32 %2
}
int sysc_detect(struct pci_access *a) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pci_access = type opaque
define i32 @sysc_detect(%struct.pci_access* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ cd_present();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void dcd_check(void) {
  if (!cd_present()) {
    fprintf(stderr, "No disc in drive %s, aborting.\n", "/dev/cdrom");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<dcd_check>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cd_present@plt>
cmp    $0x0,%eax
jne    116e <dcd_check+0x3e>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
lea    0xec5(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcd_check>:
push   %rax
xor    %eax,%eax
call   1040 <cd_present@plt>
test   %eax,%eax
je     113e <dcd_check+0xe>
pop    %rax
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
lea    0xecb(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"No disc in drive %s, aborting.\0A\00"
@.str.1 = [11 x i8] c"/dev/cdrom\00"
@EXIT_FAILURE = global i32 0
define void @dcd_check() {
%1 = call i32 (...) @cd_present()
%2 = icmp ne i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"No disc in drive %s, aborting.\0A\00"
@.str.1 = [11 x i8] c"/dev/cdrom\00"
@EXIT_FAILURE = global i32 0
define void @dcd_check() {
%1 = tail call i32 (...) @cd_present()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
ret void
}
/* Type definitions */
struct ath_hal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ath_hal_enable_cck_weak_det(struct ath_hal *,
                                               int /*<<< orphan*/);
void ath_hal_restore_default_cck_weak_det(struct ath_hal *ah) {
  ath_hal_enable_cck_weak_det(ah, 0);
}


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

x86 assembly (clang, -O2):
<ath_hal_restore_default_cck_weak_det>:
xor    %esi,%esi
jmp    1030 <ath_hal_enable_cck_weak_det@plt>

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

LLVM IR (-O2):
%struct.ath_hal = type { i32 }
define void @ath_hal_restore_default_cck_weak_det(%struct.ath_hal* %0) {
%2 = tail call i32 @ath_hal_enable_cck_weak_det(%struct.ath_hal* %0, i32 0)
ret void
}
/* Variables and functions */
int aft3dsurfmeshrefiner(int *, double *, int *, int *, int *, int, int, int);
int surface_refine_(int *nV, double *vertex, int *nF, int *face,
                    int *facematerial, int *pmaxnV, int *pmaxnF) {
  return aft3dsurfmeshrefiner(nV, vertex, nF, face, facematerial, *pmaxnV,
                              *pmaxnF, 1);
}


x86 assembly (clang, -O0):
<surface_refine_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
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),%rax
mov    (%rax),%r9d
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
movl   $0x1,0x8(%rsp)
call   1030 <aft3dsurfmeshrefiner@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<surface_refine_>:
push   %rax
mov    0x10(%rsp),%rax
mov    (%r9),%r9d
mov    (%rax),%eax
push   $0x1
push   %rax
call   1030 <aft3dsurfmeshrefiner@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @surface_refine_(i32* %0, double* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
store i32* %0, i32** %8
store double* %1, double** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%15 = load i32*, i32** %8
%16 = load double*, double** %9
%17 = load i32*, i32** %10
%18 = load i32*, i32** %11
%19 = load i32*, i32** %12
%20 = load i32*, i32** %13
%21 = load i32, i32* %20
%22 = load i32*, i32** %14
%23 = load i32, i32* %22
%24 = call i32 @aft3dsurfmeshrefiner(i32* %15, double* %16, i32* %17, i32* %18, i32* %19, i32 %21, i32 %23, i32 1)
ret i32 %24
}

LLVM IR (-O2):
define i32 @surface_refine_(i32* %0, double* %1, i32* %2, i32* %3, i32* %4, i32* nocapture %5, i32* nocapture %6) {
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = tail call i32 @aft3dsurfmeshrefiner(i32* %0, double* %1, i32* %2, i32* %3, i32* %4, i32 %8, i32 %9, i32 1)
ret i32 %10
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t get_consumer_port(size_t consumer_index) {
  return 10000 + consumer_index;
}


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

x86 assembly (clang, -O2):
<get_consumer_port>:
lea    0x2710(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_consumer_port(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = add i32 %2, 10000
ret i32 %3
}
int is_num(char c) { return (c >= '0' && c <= '9') ? 1 : 0; }


x86 assembly (clang, -O0):
<is_num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_num+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_num>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_num(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_num(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void die(const char *err) {
  fputs(err, stderr);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int binarise(unsigned char);
size_t binarisebyte(unsigned char num) {
  return (num == 0 || num == 1 ? num : ((num % 2) + 10 * binarise(num / 2)));
}


x86 assembly (clang, -O0):
<binarisebyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
je     1138 <binarisebyte+0x28>
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    1144 <binarisebyte+0x34>
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <binarisebyte+0x64>
movzbl -0x1(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
movzbl %al,%edi
call   1030 <binarise@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binarisebyte>:
cmp    $0x2,%dil
jb     1130 <binarisebyte+0x20>
push   %rbx
mov    %edi,%ebx
and    $0x1,%ebx
shr    %dil
movzbl %dil,%edi
call   1030 <binarise@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%edi
or     %ebx,%edi
pop    %rbx
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @binarisebyte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
br label %24
13: ; preds = %6
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = srem i32 %15, 2
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = sdiv i32 %18, 2
%20 = trunc i32 %19 to i8
%21 = call i32 @binarise(i8 zeroext %20)
%22 = mul nsw i32 10, %21
%23 = add nsw i32 %16, %22
br label %24
24: ; preds = %13, %10
%25 = phi i32 [ %12, %10 ], [ %23, %13 ]
%26 = sext i32 %25 to i64
ret i64 %26
}

LLVM IR (-O2):
define i64 @binarisebyte(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = icmp ult i8 %0, 2
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = and i32 %2, 1
%6 = lshr i8 %0, 1
%7 = tail call i32 @binarise(i8 zeroext %6)
%8 = mul nsw i32 %7, 10
%9 = or i32 %8, %5
br label %10
10: ; preds = %1, %4
%11 = phi i32 [ %9, %4 ], [ %2, %1 ]
%12 = sext i32 %11 to i64
ret i64 %12
}
void g_signal_chain_from_overridden() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_chain_from_overridden() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lnp_hexdump(char *, unsigned char *, unsigned int);
void lnp_raw_hexdump(unsigned char *data, unsigned length, int isvalid) {
  lnp_hexdump("[RAW ]", data, length);
}


x86 assembly (clang, -O0):
<lnp_raw_hexdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed0(%rip),%rdi
call   1030 <lnp_hexdump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnp_raw_hexdump>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <lnp_hexdump@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"[RAW ]\00"
define void @lnp_raw_hexdump(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 @lnp_hexdump(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"[RAW ]\00"
define void @lnp_raw_hexdump(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @lnp_hexdump(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
void XSetClipRectangles() {}


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

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

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

LLVM IR (-O2):
define void @XSetClipRectangles() {
ret void
}
/* Variables and functions */
void *sb_file_load(char const *, unsigned int);
unsigned int sb_file_size(char const *);
void *sb_file_load2(char const *filename, unsigned *size) {
  *size = sb_file_size(filename);
  return sb_file_load(filename, *size);
}


x86 assembly (clang, -O0):
<sb_file_load2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sb_file_size@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <sb_file_load@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_file_load2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <sb_file_size@plt>
mov    %eax,(%r14)
mov    %rbx,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <sb_file_load@plt>

LLVM IR (-O0):
define i8* @sb_file_load2(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = call i32 @sb_file_size(i8* %5)
%7 = load i32*, i32** %4
store i32 %6, i32* %7
%8 = load i8*, i8** %3
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = call i8* @sb_file_load(i8* %8, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @sb_file_load2(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @sb_file_size(i8* %0)
store i32 %3, i32* %1
%4 = tail call i8* @sb_file_load(i8* %0, i32 %3)
ret i8* %4
}
int fn2(int a, int b, int m) {
  int tem1 = a & ~m;
  int tem2 = m & b;
  return tem1 | tem2;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
mov    %esi,%eax
xor    %edi,%eax
and    %edx,%eax
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @fn2(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = and i32 %4, %0
%6 = and i32 %2, %1
%7 = or i32 %5, %6
ret i32 %7
}
const char *Lock_Brief(void) { return "Exclusive Resource"; }


x86 assembly (clang, -O0):
<Lock_Brief>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lock_Brief>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Exclusive Resource\00"
define i8* @Lock_Brief() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"Exclusive Resource\00"
define i8* @Lock_Brief() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
unsigned long __arch_copy_from_user(void *to, void *from, unsigned long n) {
  unsigned long a;
  return a;
}


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

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

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

LLVM IR (-O2):
define i64 @__arch_copy_from_user(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i64 undef
}
/* Type definitions */
struct Home {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Home *);
void destroyHome(struct Home *home) { free(home); }


x86 assembly (clang, -O0):
<destroyHome>:
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):
<destroyHome>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.Home = type { i32 }
define void @destroyHome(%struct.Home* nocapture %0) {
%2 = tail call i32 @free(%struct.Home* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arradd(int *, int *, int *, int);
int main(void) {
  int arr1[4] = {2, 4, 5, 8}, arr2[4] = {1, 0, 4, 6}, arr3[4];
  arradd(arr1, arr2, arr3, 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <arradd@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
lea    0x20(%rsp),%rdx
mov    $0x4,%ecx
call   1030 <arradd@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.arr1 = [4 x i32] [i32 2, i32 4, i32 5, i32 8]
@__const.main.arr2 = [4 x i32] [i32 1, i32 0, i32 4, i32 6]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca [4 x i32]
%4 = alloca [4 x i32]
store i32 0, i32* %1
%5 = bitcast [4 x i32]* %2 to i8*
%6 = bitcast [4 x i32]* %3 to i8*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%10 = call i32 @arradd(i32* %7, i32* %8, i32* %9, i32 4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr1 = [4 x i32] [i32 2, i32 4, i32 5, i32 8]
@__const.main.arr2 = [4 x i32] [i32 1, i32 0, i32 4, i32 6]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32]
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %1 to i8*
%5 = bitcast [4 x i32]* %2 to i8*
%6 = bitcast [4 x i32]* %3 to i8*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%10 = call i32 @arradd(i32* %7, i32* %8, i32* %9, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_level(int /*<<< orphan*/);
int log_level_compare(int /*<<< orphan*/, int);
int log_err_enable() { return log_level_compare(log_level(0), 4); }


x86 assembly (clang, -O0):
<log_err_enable>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <log_level@plt>
mov    %eax,%edi
mov    $0x4,%esi
call   1040 <log_level_compare@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_err_enable>:
push   %rax
xor    %edi,%edi
call   1030 <log_level@plt>
mov    %eax,%edi
mov    $0x4,%esi
pop    %rax
jmp    1040 <log_level_compare@plt>

LLVM IR (-O0):
define i32 @log_err_enable() {
%1 = call i32 @log_level(i32 0)
%2 = call i32 @log_level_compare(i32 %1, i32 4)
ret i32 %2
}

LLVM IR (-O2):
define i32 @log_err_enable() {
%1 = tail call i32 @log_level(i32 0)
%2 = tail call i32 @log_level_compare(i32 %1, i32 4)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ vp8_variance(unsigned char *, int, unsigned char *, int, int,
                                int, unsigned int *, int *);
unsigned int vp8_variance16x16_c(unsigned char *src_ptr, int source_stride,
                                 unsigned char *ref_ptr, int recon_stride,
                                 unsigned int *sse) {
  unsigned int var;
  int avg;
  vp8_variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var,
               &avg);
  *sse = var;
  return (var - ((avg * avg) >> 8));
}


x86 assembly (clang, -O0):
<vp8_variance16x16_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x10,%r9d
lea    -0x2c(%rbp),%r10
lea    -0x30(%rbp),%rax
mov    %r9d,%r8d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <vp8_variance@plt>
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%eax
mov    -0x30(%rbp),%ecx
imul   -0x30(%rbp),%ecx
sar    $0x8,%ecx
sub    %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_variance16x16_c>:
push   %rbx
sub    $0x10,%rsp
mov    %r8,%rbx
lea    0x8(%rsp),%rax
lea    0xc(%rsp),%r10
mov    $0x10,%r8d
mov    $0x10,%r9d
push   %rax
push   %r10
call   1030 <vp8_variance@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
mov    0x8(%rsp),%ecx
imul   %ecx,%ecx
shr    $0x8,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @vp8_variance16x16_c(i8* %0, i32 %1, i8* %2, i32 %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = call i32 @vp8_variance(i8* %13, i32 %14, i8* %15, i32 %16, i32 16, i32 16, i32* %11, i32* %12)
%18 = load i32, i32* %11
%19 = load i32*, i32** %10
store i32 %18, i32* %19
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %12
%23 = mul nsw i32 %21, %22
%24 = ashr i32 %23, 8
%25 = sub i32 %20, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @vp8_variance16x16_c(i8* %0, i32 %1, i8* %2, i32 %3, i32* nocapture writeonly %4) {
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %6 to i8*
%9 = bitcast i32* %7 to i8*
%10 = call i32 @vp8_variance(i8* %0, i32 %1, i8* %2, i32 %3, i32 16, i32 16, i32* %6, i32* %7)
%11 = load i32, i32* %6
store i32 %11, i32* %4
%12 = load i32, i32* %7
%13 = mul nsw i32 %12, %12
%14 = lshr i32 %13, 8
%15 = sub i32 %11, %14
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_25519_carry(uintptr_t, uintptr_t);
void fiat_25519_carry(uint32_t out1[10], const uint32_t arg1[10]) {
  internal_fiat_25519_carry((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_25519_carry>:
jmp    1030 <internal_fiat_25519_carry@plt>

LLVM IR (-O0):
define void @fiat_25519_carry(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_25519_carry(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_25519_carry(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_25519_carry(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  unsigned char t[4];
  t[0] = -1;
  t[1] = -1;
  t[2] = -1;
  t[3] = -1;
  unsigned char *z1 = t;
  void *z2 = z1;
  unsigned int *pi = z2;
  if (*pi != -1) {
    printf("UNSAFE\n");
    goto ERROR;
  }
  printf("SAFE\n");
  return (0);
ERROR:
  return (-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xff,-0x8(%rbp)
movb   $0xff,-0x7(%rbp)
movb   $0xff,-0x6(%rbp)
movb   $0xff,-0x5(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     1165 <main+0x55>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <main+0x6d>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1184 <main+0x74>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [5 x i8] c"SAFE\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int func2(void) {}


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

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

LLVM IR (-O0):
define i32 @func2() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func2() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strnrtrim(char *, int /*<<< orphan*/);
char *strrtrim(char *str) {
  strnrtrim(str, strlen(str));
  return (str);
}


x86 assembly (clang, -O0):
<strrtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <strnrtrim@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrtrim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <strnrtrim@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strrtrim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @strnrtrim(i8* %3, i32 %5)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
define i8* @strrtrim(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @strnrtrim(i8* %0, i32 %2)
ret i8* %0
}
/* Variables and functions */
float roundf(float);
float __ocl_round_float(float src) { return roundf(src); }


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

x86 assembly (clang, -O2):
<__ocl_round_float>:
jmp    1030 <roundf@plt>

LLVM IR (-O0):
define float @__ocl_round_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.round.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @__ocl_round_float(float %0) {
%2 = tail call float @llvm.round.f32(float %0)
ret float %2
}