xunge/DecIR huggingface dataset:
int gtp_kernel_tunnel_del(struct pdp_t *pdp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pdp_t = type opaque
define i32 @gtp_kernel_tunnel_del(%struct.pdp_t* nocapture readnone %0) {
ret i32 0
}
void num() {
  extern int x, y;
  int a = 15, b = 10;
  x = a - b;
  y = a + b;
}


x86 assembly (clang, -O0):
<num>:
push   %rbp
mov    %rsp,%rbp
movl   $0xf,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<num>:
mov    0x2ed1(%rip),%rax
movl   $0x5,(%rax)
mov    0x2ed4(%rip),%rax
movl   $0x19,(%rax)
ret

LLVM IR (-O0):
@x = external global i32
@y = external global i32
define void @num() {
%1 = alloca i32
%2 = alloca i32
store i32 15, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = sub nsw i32 %3, %4
store i32 %5, i32* @x
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
store i32 %8, i32* @y
ret void
}

LLVM IR (-O2):
@x = external global i32
@y = external global i32
define void @num() {
store i32 5, i32* @x
store i32 25, i32* @y
ret void
}
/* Type definitions */
struct gpio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gpio_mode(struct gpio *, int, int);
void gpio_timer(void) {
  gpio_mode((struct gpio *)0x40010800, 15, 3 | 8);
  gpio_mode((struct gpio *)0x40010800, 1, 3 | 8);
  gpio_mode((struct gpio *)0x40010800, 2, 3 | 8);
  gpio_mode((struct gpio *)0x40010800, 3, 3 | 8);
}


x86 assembly (clang, -O0):
<gpio_timer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40010800,%edi
mov    $0xf,%esi
mov    $0xb,%edx
call   1030 <gpio_mode@plt>
mov    $0x40010800,%edi
mov    $0x1,%esi
mov    $0xb,%edx
call   1030 <gpio_mode@plt>
mov    $0x40010800,%edi
mov    $0x2,%esi
mov    $0xb,%edx
call   1030 <gpio_mode@plt>
mov    $0x40010800,%edi
mov    $0x3,%esi
mov    $0xb,%edx
call   1030 <gpio_mode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_timer>:
push   %rax
mov    $0x40010800,%edi
mov    $0xf,%esi
mov    $0xb,%edx
call   1030 <gpio_mode@plt>
mov    $0x40010800,%edi
mov    $0x1,%esi
mov    $0xb,%edx
call   1030 <gpio_mode@plt>
mov    $0x40010800,%edi
mov    $0x2,%esi
mov    $0xb,%edx
call   1030 <gpio_mode@plt>
mov    $0x40010800,%edi
mov    $0x3,%esi
mov    $0xb,%edx
pop    %rax
jmp    1030 <gpio_mode@plt>

LLVM IR (-O0):
%struct.gpio = type { i32 }
define void @gpio_timer() {
%1 = call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073809408 to %struct.gpio*), i32 15, i32 11)
%2 = call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073809408 to %struct.gpio*), i32 1, i32 11)
%3 = call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073809408 to %struct.gpio*), i32 2, i32 11)
%4 = call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073809408 to %struct.gpio*), i32 3, i32 11)
ret void
}

LLVM IR (-O2):
%struct.gpio = type { i32 }
define void @gpio_timer() {
%1 = tail call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073809408 to %struct.gpio*), i32 15, i32 11)
%2 = tail call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073809408 to %struct.gpio*), i32 1, i32 11)
%3 = tail call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073809408 to %struct.gpio*), i32 2, i32 11)
%4 = tail call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073809408 to %struct.gpio*), i32 3, i32 11)
ret void
}
int main(int argc, char **argv) {
  int x = 46;
  int y = 4;
  return x - y;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 42
}
/* Variables and functions */
int rand();
int get_rand_int() { return rand(); }


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

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

LLVM IR (-O0):
define i32 @get_rand_int() {
%1 = call i32 (...) @rand()
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_rand_int() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
int encode_arm_immediate(unsigned int v) {
  unsigned int a, i;
  for (i = 0; i < 32; i += 2)
    if ((a = (v << i | v >> (32 - i))) <= 0xff)
      return (a | (i << 7));
  return (-1);
}


x86 assembly (clang, -O0):
<encode_arm_immediate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x20,-0x10(%rbp)
jae    1165 <encode_arm_immediate+0x65>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
sub    -0x10(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
cmp    $0xff,%eax
ja     1152 <encode_arm_immediate+0x52>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x7,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <encode_arm_immediate+0x6c>
jmp    1157 <encode_arm_immediate+0x57>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    110e <encode_arm_immediate+0xe>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @encode_arm_immediate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %5
br label %6
6: ; preds = %25, %1
%7 = load i32, i32* %5
%8 = icmp ult i32 %7, 32
br i1 %8, label %9, label %28
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = sub i32 32, %14
%16 = lshr i32 %13, %15
%17 = or i32 %12, %16
store i32 %17, i32* %4
%18 = icmp ule i32 %17, 255
br i1 %18, label %19, label %24
19: ; preds = %9
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = shl i32 %21, 7
%23 = or i32 %20, %22
store i32 %23, i32* %2
br label %29
24: ; preds = %9
br label %25
25: ; preds = %24
%26 = load i32, i32* %5
%27 = add i32 %26, 2
store i32 %27, i32* %5
br label %6
28: ; preds = %6
store i32 -1, i32* %2
br label %29
29: ; preds = %28, %19
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @encode_arm_immediate(i32 %0) {
ret i32 -1
}
void g_param_spec_boxed() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int _fds_cmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int _fds_check(fd_set *fds, int nfds) {
  fd_set empty;
  FD_ZERO(&empty);
  return _fds_cmp(fds, &empty, nfds);
}


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

x86 assembly (clang, -O2):
<_fds_check>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1040 <FD_ZERO@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <_fds_cmp@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @_fds_check(i32* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @FD_ZERO(i32* %3)
%6 = call i32 @_fds_cmp(i32* %0, i32* %3, i32 %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ pr(char *, int, char, char);
int main(int argc, char *argv[]) {
  int i = 0x04030201;
  char *p = (char *)(&i);
  pr("i=%0X, p[0]=%d, p[3]=%d\n", i, p[0], p[3]);
  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)
movl   $0x4030201,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
lea    0xeb7(%rip),%rdi
movsbl %cl,%edx
movsbl 0x3(%rax),%ecx
call   1030 <pr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4030201,%esi
mov    $0x1,%edx
mov    $0x4,%ecx
call   1030 <pr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"i=%0X, p[0]=%d, p[3]=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 67305985, i32* %6
%8 = bitcast i32* %6 to i8*
store i8* %8, i8** %7
%9 = load i32, i32* %6
%10 = load i8*, i8** %7
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = load i8*, i8** %7
%14 = getelementptr inbounds i8, i8* %13, i64 3
%15 = load i8, i8* %14
%16 = call i32 @pr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9, i8 signext %12, i8 signext %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"i=%0X, p[0]=%d, p[3]=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @pr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 67305985, i8 signext 1, i8 signext 4)
ret i32 0
}
int test_imm_20uint16_mem(unsigned short *val) {
  return ((*val) & (0x20 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_20uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x20,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_20uint16_mem>:
testb  $0x20,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_20uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 32
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ff_hevc_put_hevc_uni_qpel_h64_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h64_10_avx2() {
ret void
}
/* Variables and functions */
int check_alias(const unsigned char *in, size_t in_len,
                const unsigned char *out) {
  if (out <= in)
    return 1;
  if (in + in_len <= out)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_alias>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     112a <check_alias+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <check_alias+0x4f>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
ja     1148 <check_alias+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <check_alias+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_alias>:
cmp    %rdi,%rdx
setbe  %al
add    %rdi,%rsi
cmp    %rdx,%rsi
setbe  %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @check_alias(i8* readnone %0, i64 %1, i8* readnone %2) {
%4 = icmp ule i8* %2, %0
%5 = getelementptr inbounds i8, i8* %0, i64 %1
%6 = icmp ule i8* %5, %2
%7 = select i1 %4, i1 true, i1 %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
unsigned char vx86_NBSB_Read8(int, unsigned char);
unsigned char sb_Read8(unsigned char offset) {
  return vx86_NBSB_Read8(2, offset);
}


x86 assembly (clang, -O0):
<sb_Read8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
movzbl -0x1(%rbp),%esi
call   1030 <vx86_NBSB_Read8@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_Read8>:
mov    %edi,%esi
mov    $0x2,%edi
jmp    1030 <vx86_NBSB_Read8@plt>

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

LLVM IR (-O2):
define zeroext i8 @sb_Read8(i8 zeroext %0) {
%2 = tail call zeroext i8 @vx86_NBSB_Read8(i32 2, i8 zeroext %0)
ret i8 %2
}
double det_2d(double *mat) { return mat[0] * mat[3] - mat[1] * mat[2]; }


x86 assembly (clang, -O0):
<det_2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<det_2d>:
movsd  0x10(%rdi),%xmm1
mulsd  0x8(%rdi),%xmm1
movsd  (%rdi),%xmm0
mulsd  0x18(%rdi),%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @det_2d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 3
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 2
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = fneg double %15
%17 = call double @llvm.fmuladd.f64(double %5, double %8, double %16)
ret double %17
}

LLVM IR (-O2):
define double @det_2d(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 3
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = fneg double %6
%10 = fmul double %8, %9
%11 = tail call double @llvm.fmuladd.f64(double %2, double %4, double %10)
ret double %11
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *substr(char *orig, int start, int length) {
  char *ret = (char *)malloc(sizeof(char) * length);
  strncpy(ret, orig + start, length);
  ret[length] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movslq -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%r14
movslq %edx,%rbx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
movslq %r15d,%rsi
add    %r14,%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x0(%rbp,%rbx,1)
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @substr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i32, i32* %6
%20 = call i32 @strncpy(i8* %14, i8* %18, i32 %19)
%21 = load i8*, i8** %7
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
%25 = load i8*, i8** %7
ret i8* %25
}

LLVM IR (-O2):
define i8* @substr(i8* %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = tail call i64 @malloc(i32 %2)
%6 = inttoptr i64 %5 to i8*
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @strncpy(i8* %6, i8* %8, i32 %2)
%10 = getelementptr inbounds i8, i8* %6, i64 %4
store i8 0, i8* %10
ret i8* %6
}
/* Variables and functions */
float circular_io(float, float, float);
float circular_f_io(float step, float max_steps, float max_val) {
  return circular_io(step, max_steps, max_val);
}


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

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

LLVM IR (-O0):
define float @circular_f_io(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @circular_io(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @circular_f_io(float %0, float %1, float %2) {
%4 = tail call float @circular_io(float %0, float %1, float %2)
ret float %4
}
int jac_chain_nm9_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 56;
  return 0;
}


x86 assembly (clang, -O0):
<jac_chain_nm9_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <jac_chain_nm9_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <jac_chain_nm9_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <jac_chain_nm9_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <jac_chain_nm9_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x38,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm9_work>:
test   %rdi,%rdi
je     110b <jac_chain_nm9_work+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <jac_chain_nm9_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <jac_chain_nm9_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <jac_chain_nm9_work+0x2c>
movl   $0x38,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @jac_chain_nm9_work(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** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 2, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 56, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @jac_chain_nm9_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 56, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
void gtk_drag_begin() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeWakeLow(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000000);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000001, 0x00000108);
}


x86 assembly (clang, -O0):
<GPIOPinTypeWakeLow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
mov    $0x108,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeWakeLow>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edx,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x108,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeWakeLow(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 @GPIODirModeSet(i32 %5, i32 %6, i32 0)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @GPIOPadConfigSet(i32 %8, i32 %9, i32 1, i32 264)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeWakeLow(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 0)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 1, i32 264)
ret void
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};

/* Variables and functions */
struct Cyc_List_List *Cyc_RemoveCasts_remove_casts(struct Cyc_List_List *);
struct Cyc_List_List *Cyc_do_castremove(int ignore, struct Cyc_List_List *tds) {
  struct Cyc_List_List *_T0;
  _T0 = Cyc_RemoveCasts_remove_casts(tds);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_do_castremove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Cyc_RemoveCasts_remove_casts@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_do_castremove>:
mov    %rsi,%rdi
jmp    1030 <Cyc_RemoveCasts_remove_casts@plt>

LLVM IR (-O0):
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_castremove(i32 %0, %struct.Cyc_List_List* %1) {
%3 = alloca i32
%4 = alloca %struct.Cyc_List_List*
%5 = alloca %struct.Cyc_List_List*
store i32 %0, i32* %3
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %4
%6 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%7 = call %struct.Cyc_List_List* @Cyc_RemoveCasts_remove_casts(%struct.Cyc_List_List* %6)
store %struct.Cyc_List_List* %7, %struct.Cyc_List_List** %5
%8 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %5
ret %struct.Cyc_List_List* %8
}

LLVM IR (-O2):
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_castremove(i32 %0, %struct.Cyc_List_List* %1) {
%3 = tail call %struct.Cyc_List_List* @Cyc_RemoveCasts_remove_casts(%struct.Cyc_List_List* %1)
ret %struct.Cyc_List_List* %3
}
void DrawBall(unsigned char x, unsigned char y) {}


x86 assembly (clang, -O0):
<DrawBall>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @DrawBall(i8 zeroext %0, i8 zeroext %1) {
ret void
}
void BasicSearchInit(void) {}


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

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

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

LLVM IR (-O2):
define void @BasicSearchInit() {
ret void
}
/* Variables and functions */
unsigned long atomic_decrement_val(unsigned long volatile *);
unsigned long atomic_dec_ulong_nv(volatile unsigned long *target) {
  return atomic_decrement_val(target) - 1;
}


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

x86 assembly (clang, -O2):
<atomic_dec_ulong_nv>:
push   %rax
call   1030 <atomic_decrement_val@plt>
add    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @atomic_dec_ulong_nv(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = call i64 @atomic_decrement_val(i64* %3)
%5 = sub i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @atomic_dec_ulong_nv(i64* %0) {
%2 = tail call i64 @atomic_decrement_val(i64* %0)
%3 = add i64 %2, -1
ret i64 %3
}
void lcdc_palette_change(int data, unsigned char *palette) {
  palette[0] = data & 0x03;
  palette[1] = (data >> 2) & 0x03;
  palette[2] = (data >> 4) & 0x03;
  palette[3] = data >> 6;
}


x86 assembly (clang, -O0):
<lcdc_palette_change>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
and    $0x3,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0x3,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
sar    $0x6,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcdc_palette_change>:
mov    %edi,%eax
and    $0x3,%al
mov    %al,(%rsi)
mov    %edi,%eax
shr    $0x2,%al
and    $0x3,%al
mov    %al,0x1(%rsi)
mov    %edi,%eax
shr    $0x4,%al
and    $0x3,%al
mov    %al,0x2(%rsi)
shr    $0x6,%edi
mov    %dil,0x3(%rsi)
ret

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

LLVM IR (-O2):
define void @lcdc_palette_change(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
%4 = and i8 %3, 3
store i8 %4, i8* %1
%5 = lshr i8 %3, 2
%6 = and i8 %5, 3
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = lshr i8 %3, 4
%9 = and i8 %8, 3
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = lshr i32 %0, 6
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %12, i8* %13
ret void
}
/* Variables and functions */
double frexp(double, int *);
int /*<<< orphan*/ printf(char *, double, double, int);
int main() {
  double x = 1024, fraction;
  int e;
  fraction = frexp(x, &e);
  printf("x = %.2lf = %.2lf * 2^%d\n", x, fraction, e);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x1c(%rbp),%rdi
call   1040 <frexp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x1c(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
lea    0x4(%rsp),%rdi
call   1040 <frexp@plt>
movaps %xmm0,%xmm1
mov    0x4(%rsp),%esi
lea    0xec7(%rip),%rdi
movsd  0xeb7(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"x = %.2lf = %.2lf * 2^%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store i32 0, i32* %1
store double 1.024000e+03, double* %2
%5 = load double, double* %2
%6 = call double @frexp(double %5, i32* %4)
store double %6, double* %3
%7 = load double, double* %2
%8 = load double, double* %3
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %7, double %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"x = %.2lf = %.2lf * 2^%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call double @frexp(double 1.024000e+03, i32* %1)
%4 = load i32, i32* %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double 1.024000e+03, double %3, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
void strcpy_null_src(char *x) { strcpy(x, 0); }


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

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

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

LLVM IR (-O2):
define void @strcpy_null_src(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i32 0)
ret void
}
void rf12_spiInit() { ; }


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

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

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

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

/* Variables and functions */
int pkey_custom_check(EVP_PKEY *pkey) { return 0xbeef; }


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

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

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

LLVM IR (-O2):
define i32 @pkey_custom_check(i32* nocapture readnone %0) {
ret i32 48879
}
void b43_rfkill_exit(struct b43_wldev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.b43_wldev = type opaque
define void @b43_rfkill_exit(%struct.b43_wldev* nocapture %0) {
ret void
}
char *compareString(char *strcomp1, char *strcomp2) {
  char *verdict;
  if (strcomp1 == strcomp2) {
    verdict = "True\n";
  } else {
    verdict = "False\n";
  }
  return verdict;
}


x86 assembly (clang, -O0):
<compareString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    112a <compareString+0x2a>
lea    0xedf(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1135 <compareString+0x35>
lea    0xed5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareString>:
cmp    %rsi,%rdi
lea    0xef6(%rip),%rcx
lea    0xef5(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"True\0A\00"
@.str.1 = [7 x i8] c"False\0A\00"
define i8* @compareString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = icmp eq i8* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %5
br label %11
10: ; preds = %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %5
br label %11
11: ; preds = %10, %9
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
@.str = [6 x i8] c"True\0A\00"
@.str.1 = [7 x i8] c"False\0A\00"
define i8* @compareString(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}
/* Type definitions */
struct uint64 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct uint64 *);
void uint64_delete(struct uint64 *uint64) { free(uint64); }


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

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

LLVM IR (-O2):
%struct.uint64 = type { i32 }
define void @uint64_delete(%struct.uint64* nocapture %0) {
%2 = tail call i32 @free(%struct.uint64* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ setsid();
int /*<<< orphan*/ stderr;
void spawn(const char *arg0, char **args) {
  setsid();
  execv(*args, args);
  fprintf(stderr, "%s: execvp %s", arg0, *args);
  perror(" failed");
  exit(1);
}


x86 assembly (clang, -O0):
<spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <setsid@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <execv@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xe6e(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xe70(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<spawn>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <setsid@plt>
mov    (%rbx),%rdi
mov    %rbx,%rsi
call   1070 <execv@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rcx
lea    0xe81(%rip),%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
lea    0xe80(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"%s: execvp %s\00"
@.str.1 = [8 x i8] c" failed\00"
define void @spawn(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = call i32 (...) @setsid()
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
%8 = load i8**, i8*** %4
%9 = call i32 @execv(i8* %7, i8** %8)
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %3
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %13)
%15 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"%s: execvp %s\00"
@.str.1 = [8 x i8] c" failed\00"
define void @spawn(i8* %0, i8** %1) {
%3 = tail call i32 (...) @setsid()
%4 = load i8*, i8** %1
%5 = tail call i32 @execv(i8* %4, i8** %1)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %1
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %7)
%9 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ im_a_minion_02();
void testFuncStatementComplexIf(void) {
  int int1 = 1U;
  int int2 = 2U;
  int int3 = 3U;
  int int4 = 4U;
  if (int4 > int3)
    if (int3 > int2)
      if (int2 > int1)
        if (int2 > int1)
          im_a_minion_02();
}


x86 assembly (clang, -O0):
<testFuncStatementComplexIf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    117a <testFuncStatementComplexIf+0x6a>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1175 <testFuncStatementComplexIf+0x65>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1170 <testFuncStatementComplexIf+0x60>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    116b <testFuncStatementComplexIf+0x5b>
mov    $0x0,%al
call   1030 <im_a_minion_02@plt>
jmp    1170 <testFuncStatementComplexIf+0x60>
jmp    1175 <testFuncStatementComplexIf+0x65>
jmp    117a <testFuncStatementComplexIf+0x6a>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testFuncStatementComplexIf() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
store i32 4, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %25
8: ; preds = %0
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i32, i32* %2
%14 = load i32, i32* %1
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i32, i32* %2
%18 = load i32, i32* %1
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 (...) @im_a_minion_02()
br label %22
22: ; preds = %20, %16
br label %23
23: ; preds = %22, %12
br label %24
24: ; preds = %23, %8
br label %25
25: ; preds = %24, %0
ret void
}

LLVM IR (-O2):
define void @testFuncStatementComplexIf() {
%1 = tail call i32 (...) @im_a_minion_02()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int ndigits_in_hex(uint64_t ui64Val) {
  int iDigits = ui64Val ? 0 : 1;
  while (ui64Val) {
    ui64Val >>= 4;
    ++iDigits;
  }
  return iDigits;
}


x86 assembly (clang, -O0):
<ndigits_in_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113b <ndigits_in_hex+0x3b>
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111a <ndigits_in_hex+0x1a>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndigits_in_hex>:
test   %edi,%edi
je     111e <ndigits_in_hex+0x1e>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    $0x4,%ecx
add    $0x1,%eax
cmp    $0xf,%edi
mov    %ecx,%edi
ja     1110 <ndigits_in_hex+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ndigits_in_hex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 1
store i32 %7, i32* %3
br label %8
8: ; preds = %11, %1
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %2
%13 = ashr i32 %12, 4
store i32 %13, i32* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %8
16: ; preds = %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @ndigits_in_hex(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 4
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 16
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_logbl();
scalar_t__ logbl(long double);
void test_logbl(long double ld) {
  if (logbl(ld) != logbl(ld))
    link_failure_logbl();
}


x86 assembly (clang, -O0):
<test_logbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <logbl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <logbl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_logbl+0x43>
mov    $0x0,%al
call   1030 <link_failure_logbl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_logbl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <logbl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <logbl@plt>
cmp    %rax,%rbx
jne    1151 <test_logbl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_logbl@plt>

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

LLVM IR (-O2):
define void @test_logbl(x86_fp80 %0) {
%2 = tail call i64 @logbl(x86_fp80 %0)
%3 = tail call i64 @logbl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_logbl()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
float BASS_GetCPU();
float SSP_GetCPU() { return BASS_GetCPU(); }


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

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

LLVM IR (-O0):
define float @SSP_GetCPU() {
%1 = call float (...) @BASS_GetCPU()
ret float %1
}

LLVM IR (-O2):
define float @SSP_GetCPU() {
%1 = tail call float (...) @BASS_GetCPU()
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ concb();
int /*<<< orphan*/ conres();
int /*<<< orphan*/ doexit(int /*<<< orphan*/);
stptrap() {
  conres();
  doexit(0);
  concb();
}


x86 assembly (clang, -O0):
<stptrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <conres@plt>
xor    %edi,%edi
call   1030 <doexit@plt>
mov    $0x0,%al
call   1050 <concb@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stptrap>:
push   %rax
xor    %eax,%eax
call   1040 <conres@plt>
xor    %edi,%edi
call   1030 <doexit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <concb@plt>

LLVM IR (-O0):
define i32 @stptrap() {
%1 = alloca i32
%2 = call i32 (...) @conres()
%3 = call i32 @doexit(i32 0)
%4 = call i32 (...) @concb()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @stptrap() {
%1 = tail call i32 (...) @conres()
%2 = tail call i32 @doexit(i32 0)
%3 = tail call i32 (...) @concb()
ret i32 undef
}
void GE2D_Init() {}


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

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

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

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