xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __softboundmpx_abort();
__attribute__((__weak__, __always___)) void
__softboundmpx_spatial_call_dereference_check(void *base, void *bound,
                                              void *ptr) {
  if ((base != bound) && (ptr != base)) {
    __softboundmpx_abort();
  }
}


x86 assembly (clang, -O0):
<__softboundmpx_spatial_call_dereference_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1147 <__softboundmpx_spatial_call_dereference_check+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1147 <__softboundmpx_spatial_call_dereference_check+0x37>
mov    $0x0,%al
call   1030 <__softboundmpx_abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__softboundmpx_spatial_call_dereference_check>:
cmp    %rsi,%rdi
je     1121 <__softboundmpx_spatial_call_dereference_check+0x11>
cmp    %rdi,%rdx
je     1121 <__softboundmpx_spatial_call_dereference_check+0x11>
xor    %eax,%eax
jmp    1030 <__softboundmpx_abort@plt>
ret

LLVM IR (-O0):
define weak void @__softboundmpx_spatial_call_dereference_check(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 = icmp ne i8* %7, %8
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = load i8*, i8** %4
%13 = icmp ne i8* %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 (...) @__softboundmpx_abort()
br label %16
16: ; preds = %14, %10, %3
ret void
}

LLVM IR (-O2):
define weak void @__softboundmpx_spatial_call_dereference_check(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %0, %1
%5 = icmp eq i8* %2, %0
%6 = or i1 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 (...) @__softboundmpx_abort()
br label %9
9: ; preds = %7, %3
ret void
}
void rfc822_timezone(char *s, void *t) {}


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

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

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

LLVM IR (-O2):
define void @rfc822_timezone(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int nop() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @nop() {
ret i32 1
}
int pram_init_acl(struct inode *inode, struct inode *dir) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define i32 @pram_init_acl(%struct.inode* %0, %struct.inode* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %3
store %struct.inode* %1, %struct.inode** %4
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @pram_init_acl(%struct.inode* nocapture readnone %0, %struct.inode* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ memcmp(char *, char *, int);
int read(int, char *, int);
void verify_fd(int xfd) {
  assert(-1 != xfd);
  char buf[5];
  assert(sizeof buf == read(xfd, buf, sizeof buf));
  assert(0 == memcmp(buf, "12345", sizeof buf));
}


x86 assembly (clang, -O0):
<verify_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%eax
cmp    -0x4(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x5,%edx
call   1030 <read@plt>
movslq %eax,%rcx
mov    $0x5,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x9(%rbp),%rdi
lea    0xe7c(%rip),%rsi
mov    $0x5,%edx
call   1040 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_fd>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0xffffffff,%ebx
setne  %dil
call   1050 <assert@plt>
lea    0x3(%rsp),%r14
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x5,%edx
call   1030 <read@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe93(%rip),%rsi
mov    %r14,%rdi
mov    $0x5,%edx
call   1040 <memcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"12345\00"
define void @verify_fd(i32 %0) {
%2 = alloca [5 x i8]
%3 = icmp ne i32 %0, -1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = call i32 @read(i32 %0, i8* %6, i32 5)
%8 = icmp eq i32 %7, 5
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = call i64 @memcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mod3();
void mod2(void) { mod3(); }


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

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

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

LLVM IR (-O2):
define void @mod2() {
%1 = tail call i32 (...) @mod3()
ret void
}
void handle_ALRM(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_ALRM(i32 %0) {
ret void
}
/* Variables and functions */
char *ft_strnew(int);
void get_buff(const int fd, char **buff_p, char *(*buff_sp)[8192]) {
  if (!(*buff_sp)[fd])
    (*buff_sp)[fd] = ft_strnew(32);
  *buff_p = (*buff_sp)[fd];
}


x86 assembly (clang, -O0):
<get_buff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    114f <get_buff+0x3f>
mov    $0x20,%edi
call   1030 <ft_strnew@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_buff>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
movslq %edi,%rbx
mov    (%rdx,%rbx,8),%rax
test   %rax,%rax
jne    1135 <get_buff+0x25>
mov    %rdx,%r15
mov    $0x20,%edi
call   1030 <ft_strnew@plt>
mov    %rax,(%r15,%rbx,8)
mov    %rax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @get_buff(i32 %0, i8** %1, [8192 x i8*]* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8192 x i8*]*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store [8192 x i8*]* %2, [8192 x i8*]** %6
%7 = load [8192 x i8*]*, [8192 x i8*]** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [8192 x i8*], [8192 x i8*]* %7, i64 0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %19, label %13
13: ; preds = %3
%14 = call i8* @ft_strnew(i32 32)
%15 = load [8192 x i8*]*, [8192 x i8*]** %6
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [8192 x i8*], [8192 x i8*]* %15, i64 0, i64 %17
store i8* %14, i8** %18
br label %19
19: ; preds = %13, %3
%20 = load [8192 x i8*]*, [8192 x i8*]** %6
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [8192 x i8*], [8192 x i8*]* %20, i64 0, i64 %22
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %5
store i8* %24, i8** %25
ret void
}

LLVM IR (-O2):
define void @get_buff(i32 %0, i8** nocapture writeonly %1, [8192 x i8*]* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [8192 x i8*], [8192 x i8*]* %2, i64 0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i8* @ft_strnew(i32 32)
store i8* %9, i8** %5
br label %10
10: ; preds = %8, %3
%11 = phi i8* [ %9, %8 ], [ %6, %3 ]
store i8* %11, i8** %1
ret void
}
int warp_signumf(float val) { return (0 < val) - (val < 0); }


x86 assembly (clang, -O0):
<warp_signumf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<warp_signumf>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @warp_signumf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float 0.000000e+00, %3
%5 = zext i1 %4 to i32
%6 = load float, float* %2
%7 = fcmp olt float %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @warp_signumf(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = fcmp olt float %0, 0.000000e+00
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct workqueue_struct {
  int dummy;
};
struct work_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
bool queue_work(struct workqueue_struct *wq, struct work_struct *work) {
  assert(0);
  return true;
}


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

x86 assembly (clang, -O2):
<queue_work>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.workqueue_struct = type { i32 }
%struct.work_struct = type { i32 }
define i32 @queue_work(%struct.workqueue_struct* %0, %struct.work_struct* %1) {
%3 = alloca %struct.workqueue_struct*
%4 = alloca %struct.work_struct*
store %struct.workqueue_struct* %0, %struct.workqueue_struct** %3
store %struct.work_struct* %1, %struct.work_struct** %4
%5 = call i32 @assert(i32 0)
ret i32 1
}

LLVM IR (-O2):
%struct.workqueue_struct = type { i32 }
%struct.work_struct = type { i32 }
define i32 @queue_work(%struct.workqueue_struct* nocapture readnone %0, %struct.work_struct* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ gbEmuDeinit();
void retro_unload_game() { gbEmuDeinit(); }


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

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

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

LLVM IR (-O2):
define void @retro_unload_game() {
%1 = tail call i32 (...) @gbEmuDeinit()
ret void
}
double ease_out_cubic(double t) {
  double p = t - 1;
  return p * p * p + 1;
}


x86 assembly (clang, -O0):
<ease_out_cubic>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ease_out_cubic>:
addsd  0xef8(%rip),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
addsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ease_out_cubic(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 1.000000e+00
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double %8, double %9, double 1.000000e+00)
ret double %10
}

LLVM IR (-O2):
define double @ease_out_cubic(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = fmul double %2, %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double %2, double 1.000000e+00)
ret double %4
}
/* Variables and functions */
int __builtin_ptx_read_pm0();
int __builtin_ptx_read_pm1();
int __builtin_ptx_read_pm2();
int __builtin_ptx_read_pm3();
__attribute__((device)) int read_pms() {
  int a = __builtin_ptx_read_pm0();
  int b = __builtin_ptx_read_pm1();
  int c = __builtin_ptx_read_pm2();
  int d = __builtin_ptx_read_pm3();
  return a + b + c + d;
}


x86 assembly (clang, -O0):
<read_pms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__builtin_ptx_read_pm0@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__builtin_ptx_read_pm1@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__builtin_ptx_read_pm2@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <__builtin_ptx_read_pm3@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pms>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <__builtin_ptx_read_pm0@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <__builtin_ptx_read_pm1@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <__builtin_ptx_read_pm2@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <__builtin_ptx_read_pm3@plt>
add    %r14d,%ebp
add    %ebx,%ebp
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_pms() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @__builtin_ptx_read_pm0()
store i32 %5, i32* %1
%6 = call i32 (...) @__builtin_ptx_read_pm1()
store i32 %6, i32* %2
%7 = call i32 (...) @__builtin_ptx_read_pm2()
store i32 %7, i32* %3
%8 = call i32 (...) @__builtin_ptx_read_pm3()
store i32 %8, i32* %4
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_pms() {
%1 = tail call i32 (...) @__builtin_ptx_read_pm0()
%2 = tail call i32 (...) @__builtin_ptx_read_pm1()
%3 = tail call i32 (...) @__builtin_ptx_read_pm2()
%4 = tail call i32 (...) @__builtin_ptx_read_pm3()
%5 = add nsw i32 %2, %1
%6 = add nsw i32 %5, %3
%7 = add nsw i32 %6, %4
ret i32 %7
}
void I400ToI400() {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @I400ToI400() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIDEO_BlackOut();
int /*<<< orphan*/ write16(int, int /*<<< orphan*/);
void VIDEO_Shutdown(void) {
  VIDEO_BlackOut();
  write16(((0xCC002000) + 0x02), 0);
}


x86 assembly (clang, -O0):
<VIDEO_Shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VIDEO_BlackOut@plt>
mov    $0xcc002002,%edi
xor    %esi,%esi
call   1040 <write16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIDEO_Shutdown>:
push   %rax
xor    %eax,%eax
call   1030 <VIDEO_BlackOut@plt>
mov    $0xcc002002,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <write16@plt>

LLVM IR (-O0):
define void @VIDEO_Shutdown() {
%1 = call i32 (...) @VIDEO_BlackOut()
%2 = call i32 @write16(i32 -872407038, i32 0)
ret void
}

LLVM IR (-O2):
define void @VIDEO_Shutdown() {
%1 = tail call i32 (...) @VIDEO_BlackOut()
%2 = tail call i32 @write16(i32 -872407038, i32 0)
ret void
}
float EaseBackIn(float t, float b, float c, float d) {
  float s = 1.70158f;
  float postFix = t /= d;
  return (c * (postFix)*t * ((s + 1.0f) * t - s) + b);
}


x86 assembly (clang, -O0):
<EaseBackIn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  0xee4(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xeac(%rip),%xmm2
addss  -0x14(%rbp),%xmm2
movss  -0x4(%rbp),%xmm3
movss  -0x14(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm3,%xmm2
addss  %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<EaseBackIn>:
divss  %xmm3,%xmm0
mulss  %xmm0,%xmm2
mulss  %xmm0,%xmm2
mulss  0xeec(%rip),%xmm0
addss  0xee8(%rip),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @EaseBackIn(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
store float 0x3FFB39AC00000000, float* %9
%11 = load float, float* %8
%12 = load float, float* %5
%13 = fdiv float %12, %11
store float %13, float* %5
store float %13, float* %10
%14 = load float, float* %7
%15 = load float, float* %10
%16 = fmul float %14, %15
%17 = load float, float* %5
%18 = fmul float %16, %17
%19 = load float, float* %9
%20 = fadd float %19, 1.000000e+00
%21 = load float, float* %5
%22 = load float, float* %9
%23 = fneg float %22
%24 = call float @llvm.fmuladd.f32(float %20, float %21, float %23)
%25 = load float, float* %6
%26 = call float @llvm.fmuladd.f32(float %18, float %24, float %25)
ret float %26
}

LLVM IR (-O2):
define float @EaseBackIn(float %0, float %1, float %2, float %3) {
%5 = fdiv float %0, %3
%6 = fmul float %5, %2
%7 = fmul float %5, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float 0x40059CD600000000, float 0xBFFB39AC00000000)
%9 = tail call float @llvm.fmuladd.f32(float %7, float %8, float %1)
ret float %9
}
int is_opt_human_readable(int options) { return options & 0x1; }


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

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

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

LLVM IR (-O2):
define i32 @is_opt_human_readable(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
void gpio_toggle_red_led(void) {}


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

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

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

LLVM IR (-O2):
define void @gpio_toggle_red_led() {
ret void
}
void WpeNullFunction(void) {}


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

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

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

LLVM IR (-O2):
define void @WpeNullFunction() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ add_header(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
void convert_track_mode_2_2336(uint8_t *sector, uint32_t adr) {
  add_header(sector, adr, 2);
}


x86 assembly (clang, -O0):
<convert_track_mode_2_2336>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x2,%edx
call   1030 <add_header@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_track_mode_2_2336>:
mov    $0x2,%edx
jmp    1030 <add_header@plt>

LLVM IR (-O0):
define void @convert_track_mode_2_2336(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 = call i32 @add_header(i32* %5, i32 %6, i32 2)
ret void
}

LLVM IR (-O2):
define void @convert_track_mode_2_2336(i32* %0, i32 %1) {
%3 = tail call i32 @add_header(i32* %0, i32 %1, i32 2)
ret void
}
int t(int a, int b) {
  if (a > 0)
    if (b > 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112f <t+0x2f>
cmpl   $0x0,-0xc(%rbp)
jle    112a <t+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1136 <t+0x36>
jmp    112f <t+0x2f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
test   %edi,%edi
setle  %al
test   %esi,%esi
setle  %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @t(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
%4 = icmp slt i32 %1, 1
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int *, int);
int main(void) {
  int marbles[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int answer = 0;
  answer = sum(marbles, 10);
  printf("answer=%lu \n", answer);
  printf("the size of marbles is %zd \n", sizeof marbles);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <sum@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <sum@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.marbles = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [13 x i8] c"answer=%lu \0A\00"
@.str.1 = [29 x i8] c"the size of marbles is %zd \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
store i32 0, i32* %3
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @sum(i32* %5, i32 10)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 40)
ret i32 0
}

LLVM IR (-O2):
@__const.main.marbles = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [13 x i8] c"answer=%lu \0A\00"
@.str.1 = [29 x i8] c"the size of marbles is %zd \0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @sum(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 40)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ scanf(char *, int *);
int *set_a(int n) {
  int i, *a;
  a = (int *)malloc(n * sizeof(int));
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  return a;
}


x86 assembly (clang, -O0):
<set_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117a <set_a+0x5a>
mov    -0x10(%rbp),%rsi
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe99(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <set_a+0x25>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_a>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,4),%edi
call   1030 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1165 <set_a+0x45>
mov    %ebx,%r12d
lea    0xeb9(%rip),%r15
mov    %r14,%rbx
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r12
jne    1150 <set_a+0x30>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32* @set_a(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = getelementptr inbounds i32, i32* %4, i64 %9
%11 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %10)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %1
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ write(char *);
int one() {
  write("1\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<one>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"1\0A\00"
define i32 @one() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void page_fault(void) { panic("exception(fault): page fault"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"exception(fault): page fault\00"
define void @page_fault() {
%1 = call i32 @panic(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"exception(fault): page fault\00"
define void @page_fault() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct _stor_lookup_next_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _stor_lookup_next_req *);
void stor_lookup_next_req_free(struct _stor_lookup_next_req *ptr) {
  osapi_free(ptr);
}


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

x86 assembly (clang, -O2):
<stor_lookup_next_req_free>:
jmp    1030 <osapi_free@plt>

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

LLVM IR (-O2):
%struct._stor_lookup_next_req = type { i32 }
define void @stor_lookup_next_req_free(%struct._stor_lookup_next_req* %0) {
%2 = tail call i32 @osapi_free(%struct._stor_lookup_next_req* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void USBHostMode(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x40050000);
  (*((volatile uint8_t *)(ui32Base + 0x0000041C))) = 0x00000002;
}


x86 assembly (clang, -O0):
<USBHostMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x41c,%eax
cltq
movl   $0x2,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostMode>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
movl   $0x2,0x41c(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @USBHostMode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074069504
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1052
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 2, i32* %10
ret void
}

LLVM IR (-O2):
define void @USBHostMode(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 1052
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 2, i32* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegReadWord(int /*<<< orphan*/, int);
uint16_t wiznetGetSocketRXWritePointer(uint8_t socket) {
  return wiznetRegReadWord(socket, (0x0000 + 0x002A));
}


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

x86 assembly (clang, -O2):
<wiznetGetSocketRXWritePointer>:
mov    $0x2a,%esi
jmp    1030 <wiznetRegReadWord@plt>

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

LLVM IR (-O2):
define i32 @wiznetGetSocketRXWritePointer(i32 %0) {
%2 = tail call i32 @wiznetRegReadWord(i32 %0, i32 42)
ret i32 %2
}
void gtk_window_activate_key() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_activate_key() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_IOERR_SHMLOCK;
int memShmLock(sqlite3_file *pFile, int offset, int n, int flags) {
  return SQLITE_IOERR_SHMLOCK;
}


x86 assembly (clang, -O0):
<memShmLock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@SQLITE_IOERR_SHMLOCK = global i32 0
define i32 @memShmLock(i32* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @SQLITE_IOERR_SHMLOCK
ret i32 %5
}
/* Variables and functions */
double pow(int, int);
int is_equal(double a, double b) { return (a - b <= pow(10, -2)); }


x86 assembly (clang, -O0):
<is_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0xa,%edi
mov    $0xfffffffe,%esi
call   1030 <pow@plt>
movsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_equal>:
push   %rax
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    $0xa,%edi
mov    $0xfffffffe,%esi
call   1030 <pow@plt>
xor    %eax,%eax
ucomisd (%rsp),%xmm0
setae  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_equal(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call double @pow(i32 10, i32 -2)
%9 = fcmp ole double %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_equal(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @pow(i32 10, i32 -2)
%5 = fcmp ole double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) {}


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

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

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

LLVM IR (-O2):
%struct.o2net_send_tracking = type opaque
define void @o2net_set_nst_sock_time(%struct.o2net_send_tracking* nocapture %0) {
ret void
}
float rintf(float x) { return __builtin_rintf(x); }


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

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

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

LLVM IR (-O2):
define float @rintf(float %0) {
%2 = tail call float @llvm.rint.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ da_inst(char *, int /*<<< orphan*/ *, int);
void nop() { da_inst("nop", NULL, 2); }


x86 assembly (clang, -O0):
<nop>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%edx
call   1030 <da_inst@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nop>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0x2,%edx
jmp    1030 <da_inst@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"nop\00"
define void @nop() {
%1 = tail call i32 @da_inst(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* null, i32 2)
ret void
}
double test4(double a) { return __builtin_copysign(a, -1.0); }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
orps   0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @test4(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.copysign.f64(double %3, double -1.000000e+00)
ret double %4
}

LLVM IR (-O2):
define double @test4(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fneg double %2
ret double %3
}
unsigned long ReadNumber(void) { return 0x009a0000L; }


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

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

LLVM IR (-O0):
define i64 @ReadNumber() {
ret i64 10092544
}

LLVM IR (-O2):
define i64 @ReadNumber() {
ret i64 10092544
}
unsigned xrop3_249_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk2 = ~stk2;
  stk1 = T | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_249_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_249_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %eax,%edx
xor    $0xffffff00,%edx
mov    %ecx,%edi
or     %edx,%edi
and    %eax,%edi
not    %ecx
and    %edx,%ecx
not    %eax
and    %esi,%eax
or     %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_249_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %7
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = and i32 %30, %31
%33 = load i32, i32* %8
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = or i32 %32, %36
%38 = load i32, i32* %7
%39 = load i32, i32* %6
%40 = xor i32 %39, -1
%41 = and i32 %38, %40
%42 = load i32, i32* %5
%43 = and i32 %41, %42
%44 = or i32 %37, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_249_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -256
%8 = or i32 %6, %7
%9 = and i32 %8, %4
%10 = xor i32 %6, -1
%11 = and i32 %7, %10
%12 = xor i32 %4, -1
%13 = and i32 %12, %5
%14 = or i32 %11, %13
%15 = or i32 %14, %9
ret i32 %15
}
int int_equal(int *a, int *b) { return *a == *b; }


x86 assembly (clang, -O0):
<int_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_equal>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @int_equal(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @int_equal(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char *strrchr(char *, char);
char *dirnoext(char *pszFileName) {
  char *pchLastFS, *pchLastBS;
  pchLastFS = strrchr(pszFileName, '.');
  pchLastBS = strrchr(pszFileName, '\\');
  if (pchLastFS > pchLastBS)
    (*pchLastFS) = '\0';
  return (pszFileName);
}


x86 assembly (clang, -O0):
<dirnoext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1155 <dirnoext+0x45>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirnoext>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
cmp    %rax,%r14
jbe    113a <dirnoext+0x2a>
movb   $0x0,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @dirnoext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %3
%7 = load i8*, i8** %2
%8 = call i8* @strrchr(i8* %7, i8 signext 92)
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = icmp ugt i8* %9, %10
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8 0, i8* %13
br label %14
14: ; preds = %12, %1
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @dirnoext(i8* returned %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 92)
%4 = icmp ugt i8* %2, %3
br i1 %4, label %5, label %6
5: ; preds = %1
store i8 0, i8* %2
br label %6
6: ; preds = %5, %1
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void chm_dofooter(FILE *fp) { fprintf(fp, "</ul></BODY></HTML>\n"); }


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

x86 assembly (clang, -O2):
<chm_dofooter>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"</ul></BODY></HTML>\0A\00"
define void @chm_dofooter(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"</ul></BODY></HTML>\0A\00"
define void @chm_dofooter(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 20, i64 1, i32* %0)
ret void
}
void reserve_ds_buffers(void) {}


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

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

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

LLVM IR (-O2):
define void @reserve_ds_buffers() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct nl_session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ task_req(int, struct nl_session *, char);
uint64_t get_process_taskstat_io(int pid, struct nl_session *nls, char field) {
  return task_req(pid, nls, field);
}


x86 assembly (clang, -O0):
<get_process_taskstat_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movsbl -0x11(%rbp),%edx
call   1030 <task_req@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_process_taskstat_io>:
jmp    1030 <task_req@plt>

LLVM IR (-O0):
%struct.nl_session = type { i32 }
define i32 @get_process_taskstat_io(i32 %0, %struct.nl_session* %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca %struct.nl_session*
%6 = alloca i8
store i32 %0, i32* %4
store %struct.nl_session* %1, %struct.nl_session** %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = load %struct.nl_session*, %struct.nl_session** %5
%9 = load i8, i8* %6
%10 = call i32 @task_req(i32 %7, %struct.nl_session* %8, i8 signext %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.nl_session = type { i32 }
define i32 @get_process_taskstat_io(i32 %0, %struct.nl_session* %1, i8 signext %2) {
%4 = tail call i32 @task_req(i32 %0, %struct.nl_session* %1, i8 signext %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void error(char *msg) {
  perror(msg);
  exit(1);
}


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

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

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

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}