xunge/DecIR huggingface dataset:
void mem_put_le16_as_int(void *vmem, int val) {
  unsigned char *mem = (unsigned char *)vmem;
  mem[0] = (val >> 0) & 0xff;
  mem[1] = (val >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<mem_put_le16_as_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_put_le16_as_int>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @mem_put_le16_as_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = ashr i32 %7, 0
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
ret void
}

LLVM IR (-O2):
define void @mem_put_le16_as_int(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
int XPlanesOfScreen() {}


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

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

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

LLVM IR (-O2):
define i32 @XPlanesOfScreen() {
ret i32 undef
}
unsigned int LongSwap(unsigned int i) {
  unsigned char b1, b2, b3, b4;
  b1 = i & 255;
  b2 = (i >> 8) & 255;
  b3 = (i >> 16) & 255;
  b4 = (i >> 24) & 255;
  return ((int)b1 << 24) + ((int)b2 << 16) + ((int)b3 << 8) + b4;
}


x86 assembly (clang, -O0):
<LongSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,-0x8(%rbp)
movzbl -0x5(%rbp),%eax
shl    $0x18,%eax
movzbl -0x6(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
movzbl -0x7(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
movzbl -0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LongSwap>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @LongSwap(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i32, i32* %2
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
store i8 %13, i8* %4
%14 = load i32, i32* %2
%15 = lshr i32 %14, 16
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
store i8 %17, i8* %5
%18 = load i32, i32* %2
%19 = lshr i32 %18, 24
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
store i8 %21, i8* %6
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = shl i32 %23, 24
%25 = load i8, i8* %4
%26 = zext i8 %25 to i32
%27 = shl i32 %26, 16
%28 = add nsw i32 %24, %27
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = shl i32 %30, 8
%32 = add nsw i32 %28, %31
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = add nsw i32 %32, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @LongSwap(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ AF_NETLINK;
int /*<<< orphan*/ NETLINK_NETFILTER;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int nf_socket() {
  int fd;
  fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER);
  if (fd < 0)
    perror("socket()");
  return fd;
}


x86 assembly (clang, -O0):
<nf_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
call   1040 <socket@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1161 <nf_socket+0x41>
lea    0xea4(%rip),%rdi
call   1030 <perror@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nf_socket>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
call   1040 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
js     114b <nf_socket+0x2b>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeae(%rip),%rdi
call   1030 <perror@plt>
jmp    1147 <nf_socket+0x27>

LLVM IR (-O0):
@AF_NETLINK = global i32 0
@SOCK_RAW = global i32 0
@NETLINK_NETFILTER = global i32 0
@.str = [9 x i8] c"socket()\00"
define i32 @nf_socket() {
%1 = alloca i32
%2 = load i32, i32* @AF_NETLINK
%3 = load i32, i32* @SOCK_RAW
%4 = load i32, i32* @NETLINK_NETFILTER
%5 = call i32 @socket(i32 %2, i32 %3, i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@AF_NETLINK = global i32 0
@SOCK_RAW = global i32 0
@NETLINK_NETFILTER = global i32 0
@.str = [9 x i8] c"socket()\00"
define i32 @nf_socket() {
%1 = load i32, i32* @AF_NETLINK
%2 = load i32, i32* @SOCK_RAW
%3 = load i32, i32* @NETLINK_NETFILTER
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ maint_flush_range(unsigned long, unsigned long);
int /*<<< orphan*/ outer_flush_range(unsigned long, unsigned long);
void flush_dcache_range(unsigned long start, unsigned long end) {
  maint_flush_range(start, end);
  outer_flush_range(start, end);
}


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

x86 assembly (clang, -O2):
<flush_dcache_range>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <maint_flush_range@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <outer_flush_range@plt>

LLVM IR (-O0):
define void @flush_dcache_range(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @maint_flush_range(i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i32 @outer_flush_range(i64 %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @flush_dcache_range(i64 %0, i64 %1) {
%3 = tail call i32 @maint_flush_range(i64 %0, i64 %1)
%4 = tail call i32 @outer_flush_range(i64 %0, i64 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_vfs;

/* Variables and functions */
void *scmDlOpen(sqlite3_vfs *pVfs, const char *zPath) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @scmDlOpen(i32* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
int number(void) { return (10); }


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

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

LLVM IR (-O0):
define i32 @number() {
ret i32 10
}

LLVM IR (-O2):
define i32 @number() {
ret i32 10
}
float DistributionGGX(float roughness, float NdotH) {
  float a = roughness * roughness;
  float a2 = a * a;
  float d = (NdotH * a2 - NdotH) * NdotH + 1;
  return a2 / (3.141592654f * d * d);
}


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

x86 assembly (clang, -O2):
<DistributionGGX>:
mulss  %xmm0,%xmm0
mulss  %xmm0,%xmm0
movaps %xmm1,%xmm2
mulss  %xmm0,%xmm2
subss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
addss  0xee1(%rip),%xmm2
movss  0xedd(%rip),%xmm1
mulss  %xmm2,%xmm1
mulss  %xmm2,%xmm1
divss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @DistributionGGX(float %0, float %1) {
%3 = fmul float %0, %0
%4 = fmul float %3, %3
%5 = fneg float %1
%6 = tail call float @llvm.fmuladd.f32(float %1, float %4, float %5)
%7 = tail call float @llvm.fmuladd.f32(float %6, float %1, float 1.000000e+00)
%8 = fmul float %7, 0x400921FB60000000
%9 = fmul float %7, %8
%10 = fdiv float %4, %9
ret float %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mpga_get_mpeg25(const uint8_t *p_mpga) { return !(p_mpga[1] & 0x10); }


x86 assembly (clang, -O0):
<mpga_get_mpeg25>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_get_mpeg25>:
xor    %eax,%eax
testb  $0x10,0x4(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @mpga_get_mpeg25(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, 16
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @mpga_get_mpeg25(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = lshr i32 %3, 4
%5 = and i32 %4, 1
%6 = xor i32 %5, 1
ret i32 %6
}
void foo340() {}


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

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

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

LLVM IR (-O2):
define void @foo340() {
ret void
}
void MI(int n) {}


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

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

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

LLVM IR (-O2):
define void @MI(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void hyfy_log(const char *msg) { printf("%s\n", msg); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @hyfy_log(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double oddhs_rhs(const int size) { return ((double)(size / 2)); }


x86 assembly (clang, -O0):
<oddhs_rhs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<oddhs_rhs>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @oddhs_rhs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @oddhs_rhs(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = sitofp i32 %2 to double
ret double %3
}
int test_imm_A5uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xA5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A5uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 165
%7 = icmp ne i64 %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_A5uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 708669603840
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main() {
  asm("pmuludq %mm1, %mm0");
  asm("paddq %mm1, %mm0");
  asm("psubq %mm1, %mm0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pmuludq %mm1,%mm0
paddq  %mm1,%mm0
psubq  %mm1,%mm0
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
pmuludq %mm1,%mm0
paddq  %mm1,%mm0
psubq  %mm1,%mm0
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "pmuludq %mm1, %mm0", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "paddq %mm1, %mm0", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "psubq %mm1, %mm0", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
void __DELETE_java_io_IOException(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_io_IOException(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 @__DELETE_java_io_IOException(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int my_tablen(char **tab) {
  int i;
  i = 0;
  while (tab[i])
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<my_tablen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <my_tablen+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_tablen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_tablen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <my_tablen+0x10>
ret

LLVM IR (-O0):
define i32 @my_tablen(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i8**, i8*** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @my_tablen(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hook() { printf("in hook\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"in hook\00"
define void @hook() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap_uint32(uint32_t p) {
  p = ((p << 8) & 0xFF00FF00) | ((p >> 8) & 0xFF00FF);
  return (p << 16) | (p >> 16);
}


x86 assembly (clang, -O0):
<swap_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00ff00,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00ff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_uint32>:
bswap  %edi
ror    $0x10,%edi
mov    %edi,%eax
shl    $0x10,%eax
sar    $0x10,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @swap_uint32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, -16711936
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 16711935
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = shl i32 %10, 16
%12 = load i32, i32* %2
%13 = ashr i32 %12, 16
%14 = or i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @swap_uint32(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, -16711936
%4 = lshr i32 %0, 8
%5 = and i32 %4, 16711935
%6 = or i32 %3, %5
%7 = shl i32 %6, 16
%8 = ashr i32 %6, 16
%9 = or i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func2(void) {
  printf("\n Inside func2 \n");
  int i = 0;
  for (; i < 0xffffffaa; i++)
    ;
  return;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0xffffffaa,-0x4(%rbp)
jae    1148 <func2+0x38>
jmp    113a <func2+0x2a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112b <func2+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>

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

LLVM IR (-O2):
@str = [16 x i8] c"\0A Inside func2 \00"
define void @func2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
unreachable
}
undot() {}


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

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

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

LLVM IR (-O2):
define i32 @undot() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_CONT;
int /*<<< orphan*/ perror(char *);
scalar_t__ ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
                  int /*<<< orphan*/);
int ptrace_continue(pid_t pid) {
  if (ptrace(PTRACE_CONT, pid, NULL, 0) < 0) {
    perror("ptrace_cont");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ptrace_continue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
cmp    $0x0,%rax
jge    1164 <ptrace_continue+0x44>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <ptrace_continue+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_continue>:
push   %rbx
mov    %edi,%esi
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
test   %rax,%rax
js     1140 <ptrace_continue+0x20>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%ebx
jmp    113c <ptrace_continue+0x1c>

LLVM IR (-O0):
@PTRACE_CONT = global i32 0
@.str = [12 x i8] c"ptrace_cont\00"
define i32 @ptrace_continue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* @PTRACE_CONT
%5 = load i32, i32* %3
%6 = call i64 @ptrace(i32 %4, i32 %5, i32* null, i32 0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@PTRACE_CONT = global i32 0
@.str = [12 x i8] c"ptrace_cont\00"
define i32 @ptrace_continue(i32 %0) {
%2 = load i32, i32* @PTRACE_CONT
%3 = tail call i64 @ptrace(i32 %2, i32 %0, i32* null, i32 0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ errno;
char *strerror(int /*<<< orphan*/);
char *cu_err() { return strerror(errno); }


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

x86 assembly (clang, -O2):
<cu_err>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <strerror@plt>

LLVM IR (-O0):
@errno = global i32 0
define i8* @cu_err() {
%1 = load i32, i32* @errno
%2 = call i8* @strerror(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@errno = global i32 0
define i8* @cu_err() {
%1 = load i32, i32* @errno
%2 = tail call i8* @strerror(i32 %1)
ret i8* %2
}
void reboot() {
  asm volatile("cli");
  asm volatile("mov $0xFE, %al");
  asm volatile("out %al, $0x64");
  asm volatile("halt:jmp halt");
}


x86 assembly (clang, -O0):
<reboot>:
push   %rbp
mov    %rsp,%rbp
cli
mov    $0xfe,%al
out    %al,$0x64

x86 assembly (clang, -O2):
<reboot>:
cli
mov    $0xfe,%al
out    %al,$0x64

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

LLVM IR (-O2):
define void @reboot() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "mov $$0xFE, %al", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "out %al, $$0x64", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "halt:jmp halt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initArrays();
int /*<<< orphan*/ print();
int main() {
  initArrays();
  print();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initArrays@plt>
mov    $0x0,%al
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initArrays@plt>
xor    %eax,%eax
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initArrays()
%3 = call i32 (...) @print()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initArrays()
%2 = tail call i32 (...) @print()
ret i32 0
}
int foo(int x) { return 3 * x; }


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

x86 assembly (clang, -O2):
<foo>:
lea    (%rdi,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, 3
ret i32 %2
}
char *skip_blanks(char *str) {
  while (((*str == ' ') || (*str == '\t'))) {
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<skip_blanks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip_blanks+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip_blanks+0x3d>
jmp    114e <skip_blanks+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_blanks+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_blanks>:
mov    %rdi,%rax
jmp    1114 <skip_blanks+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_blanks+0x10>
cmp    $0x9,%cl
je     1110 <skip_blanks+0x10>
ret

LLVM IR (-O0):
define i8* @skip_blanks(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ true, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @skip_blanks(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
char *GetEnv(char *, int /*<<< orphan*/);
char *homedir(void) {
  char *home = GetEnv("HOME", 0);
  if (home)
    return home;
  return home;
}


x86 assembly (clang, -O0):
<homedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
xor    %esi,%esi
call   1030 <GetEnv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1142 <homedir+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114a <homedir+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
define i8* @homedir() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @GetEnv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i8*, i8** %2
store i8* %7, i8** %1
br label %10
8: ; preds = %0
%9 = load i8*, i8** %2
store i8* %9, i8** %1
br label %10
10: ; preds = %8, %6
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
define i8* @homedir() {
%1 = tail call i8* @GetEnv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
ret i8* %1
}
char *langRomTypeExtRam32() { return "32kB External RAM"; }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"32kB External RAM\00"
define i8* @langRomTypeExtRam32() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"32kB External RAM\00"
define i8* @langRomTypeExtRam32() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __get_unaligned_be16(int /*<<< orphan*/ const *);
uint16_t get_unaligned_be16(const void *p) {
  return __get_unaligned_be16((const uint8_t *)p);
}


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

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

LLVM IR (-O0):
define i32 @get_unaligned_be16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @__get_unaligned_be16(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_unaligned_be16(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @__get_unaligned_be16(i32* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mayinit_vpp(void const **);
int /*<<< orphan*/ use_vp(void *);
void call_to_mayinit_and_call_use_good() {
  void *obj[10];
  mayinit_vpp((const void **)obj);
  use_vp(obj[0]);
}


x86 assembly (clang, -O0):
<call_to_mayinit_and_call_use_good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
call   1030 <mayinit_vpp@plt>
mov    -0x50(%rbp),%rdi
call   1040 <use_vp@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_to_mayinit_and_call_use_good>:
sub    $0x58,%rsp
mov    %rsp,%rdi
call   1030 <mayinit_vpp@plt>
mov    (%rsp),%rdi
call   1040 <use_vp@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
define void @call_to_mayinit_and_call_use_good() {
%1 = alloca [10 x i8*]
%2 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%3 = call i32 @mayinit_vpp(i8** %2)
%4 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @use_vp(i8* %5)
ret void
}

LLVM IR (-O2):
define void @call_to_mayinit_and_call_use_good() {
%1 = alloca [10 x i8*]
%2 = bitcast [10 x i8*]* %1 to i8*
%3 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%4 = call i32 @mayinit_vpp(i8** %3)
%5 = load i8*, i8** %3
%6 = call i32 @use_vp(i8* %5)
ret void
}
int main(void) {
  (1 || 2 ? 0 : 'a');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int yaffs_n_handles_reldir(int /*<<< orphan*/, char const *);
int yaffs_n_handles(const char *path) {
  return yaffs_n_handles_reldir((0), path);
}


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

x86 assembly (clang, -O2):
<yaffs_n_handles>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_n_handles_reldir@plt>

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

LLVM IR (-O2):
define i32 @yaffs_n_handles(i8* %0) {
%2 = tail call i32 @yaffs_n_handles_reldir(i32 0, i8* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ avoid_os_sort(double *, int);
int /*<<< orphan*/ os_indices_sort_realnums(double *, int, int *);
int /*<<< orphan*/ spr_indices_sort_realnums(double *, int, int *);
void indices_sort_realnums(double *farr, int size, int *indices) {
  if (avoid_os_sort(farr, size))
    spr_indices_sort_realnums(farr, size, indices);
  else
    os_indices_sort_realnums(farr, size, indices);
}


x86 assembly (clang, -O0):
<indices_sort_realnums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <avoid_os_sort@plt>
cmp    $0x0,%rax
je     116e <indices_sort_realnums+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <spr_indices_sort_realnums@plt>
jmp    117e <indices_sort_realnums+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <os_indices_sort_realnums@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indices_sort_realnums>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <avoid_os_sort@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
test   %rax,%rax
je     1157 <indices_sort_realnums+0x27>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <spr_indices_sort_realnums@plt>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <os_indices_sort_realnums@plt>

LLVM IR (-O0):
define void @indices_sort_realnums(double* %0, i32 %1, i32* %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32*
store double* %0, double** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load double*, double** %4
%8 = load i32, i32* %5
%9 = call i64 @avoid_os_sort(double* %7, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load double*, double** %4
%13 = load i32, i32* %5
%14 = load i32*, i32** %6
%15 = call i32 @spr_indices_sort_realnums(double* %12, i32 %13, i32* %14)
br label %21
16: ; preds = %3
%17 = load double*, double** %4
%18 = load i32, i32* %5
%19 = load i32*, i32** %6
%20 = call i32 @os_indices_sort_realnums(double* %17, i32 %18, i32* %19)
br label %21
21: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
define void @indices_sort_realnums(double* %0, i32 %1, i32* %2) {
%4 = tail call i64 @avoid_os_sort(double* %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @spr_indices_sort_realnums(double* %0, i32 %1, i32* %2)
br label %10
8: ; preds = %3
%9 = tail call i32 @os_indices_sort_realnums(double* %0, i32 %1, i32* %2)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *tmalloc(size_t n) {
  void *p = malloc(n);
  if (!p && n != 0) {
    endwin();
    fprintf(stderr, "Error: Out of memory!\n");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<tmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1199 <tmalloc+0x59>
cmpq   $0x0,-0x8(%rbp)
je     1199 <tmalloc+0x59>
mov    $0x0,%al
call   1050 <endwin@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    0xe7a(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rbx,%rbx
je     1153 <tmalloc+0x13>
test   %rax,%rax
je     1155 <tmalloc+0x15>
pop    %rbx
ret
xor    %eax,%eax
call   1050 <endwin@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Error: Out of memory!\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @tmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = tail call i32 (...) @endwin()
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
ret i8* %2
}
int byte_row_euc(int byte) {
  if (byte >= 0xa1 && byte < 0xff)
    return byte - 0xa1;
  else if (byte >= 0x8fa1 && byte < 0x8fff)
    return byte - 0x8fa1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<byte_row_euc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa1,-0x8(%rbp)
jl     1131 <byte_row_euc+0x31>
cmpl   $0xff,-0x8(%rbp)
jge    1131 <byte_row_euc+0x31>
mov    -0x8(%rbp),%eax
sub    $0xa1,%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <byte_row_euc+0x62>
cmpl   $0x8fa1,-0x8(%rbp)
jl     115b <byte_row_euc+0x5b>
cmpl   $0x8fff,-0x8(%rbp)
jge    115b <byte_row_euc+0x5b>
mov    -0x8(%rbp),%eax
sub    $0x8fa1,%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <byte_row_euc+0x62>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_row_euc>:
lea    -0x8fa1(%rdi),%ecx
cmp    $0x5e,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
lea    -0xa1(%rdi),%ecx
cmp    $0x5e,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @byte_row_euc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 161
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 255
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 161
store i32 %11, i32* %2
br label %22
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 36769
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 36863
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 36769
store i32 %20, i32* %2
br label %22
21: ; preds = %15, %12
store i32 -1, i32* %2
br label %22
22: ; preds = %21, %18, %9
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @byte_row_euc(i32 %0) {
%2 = add i32 %0, -161
%3 = icmp ult i32 %2, 94
%4 = add i32 %0, -36769
%5 = icmp ult i32 %4, 94
%6 = select i1 %5, i32 %4, i32 -1
%7 = select i1 %3, i32 %2, i32 %6
ret i32 %7
}
unsigned int ADCInit(unsigned int ADC_Clk) {
  (*(volatile unsigned long *)(0xE0034000 + 0x00)) =
      (0x01) | ((((12000000 * 5) / 4) * 1 / ADC_Clk - 1) << 8) | (1 << 16) |
      (0 << 17) | (1 << 21) | (0 << 22) | (0 << 24) | (0 << 27);
  (*(volatile unsigned long *)(0xE0060000 + 0x00)) =
      (0x01 << 0) | ((((12000000 * 5) / 4) * 1 / ADC_Clk - 1) << 8) |
      (0 << 16) | (0 << 17) | (1 << 21) | (0 << 22) | (0 << 24) | (0 << 27);
  return ((1));
}


x86 assembly (clang, -O0):
<ADCInit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xe4e1c0,%eax
xor    %edx,%edx
divl   -0x4(%rbp)
sub    $0x1,%eax
shl    $0x8,%eax
or     $0x1,%eax
or     $0x10000,%eax
or     $0x0,%eax
or     $0x200000,%eax
or     $0x0,%eax
or     $0x0,%eax
or     $0x0,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0xe0034000,%eax
mov    %rcx,(%rax)
mov    $0xe4e1c0,%eax
xor    %edx,%edx
divl   -0x4(%rbp)
sub    $0x1,%eax
shl    $0x8,%eax
or     $0x1,%eax
or     $0x0,%eax
or     $0x0,%eax
or     $0x200000,%eax
or     $0x0,%eax
or     $0x0,%eax
or     $0x0,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0xe0060000,%eax
mov    %rcx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCInit>:
mov    $0xe4e1c0,%eax
xor    %edx,%edx
div    %edi
shl    $0x8,%eax
add    $0xffffff00,%eax
mov    %eax,%ecx
or     $0x210001,%ecx
mov    $0xe0034000,%edx
mov    %rcx,(%rdx)
or     $0x200001,%eax
mov    %rax,0x2c000(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ADCInit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = udiv i32 15000000, %3
%5 = sub i32 %4, 1
%6 = shl i32 %5, 8
%7 = or i32 1, %6
%8 = or i32 %7, 65536
%9 = or i32 %8, 0
%10 = or i32 %9, 2097152
%11 = or i32 %10, 0
%12 = or i32 %11, 0
%13 = or i32 %12, 0
%14 = zext i32 %13 to i64
store volatile i64 %14, i64* inttoptr (i64 3758309376 to i64*)
%15 = load i32, i32* %2
%16 = udiv i32 15000000, %15
%17 = sub i32 %16, 1
%18 = shl i32 %17, 8
%19 = or i32 1, %18
%20 = or i32 %19, 0
%21 = or i32 %20, 0
%22 = or i32 %21, 2097152
%23 = or i32 %22, 0
%24 = or i32 %23, 0
%25 = or i32 %24, 0
%26 = zext i32 %25 to i64
store volatile i64 %26, i64* inttoptr (i64 3758489600 to i64*)
ret i32 1
}

LLVM IR (-O2):
define i32 @ADCInit(i32 %0) {
%2 = udiv i32 15000000, %0
%3 = shl nuw i32 %2, 8
%4 = add i32 %3, -256
%5 = or i32 %4, 2162689
%6 = zext i32 %5 to i64
store volatile i64 %6, i64* inttoptr (i64 3758309376 to i64*)
%7 = or i32 %4, 2097153
%8 = zext i32 %7 to i64
store volatile i64 %8, i64* inttoptr (i64 3758489600 to i64*)
ret i32 1
}
/* Variables and functions */
scalar_t__ memcmp(double const *, unsigned char const **, int);
int is_mv_double(const double *d) {
  const unsigned char u[sizeof(double)] = {0xFF, 0xFF, 0xFF, 0xFF,
                                           0xFF, 0xFF, 0xFF, 0xFF};
  return (memcmp(d, &u, sizeof(double)) == 0);
}


x86 assembly (clang, -O0):
<is_mv_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_mv_double>:
push   %rax
movq   $0xffffffffffffffff,(%rsp)
ff
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.is_mv_double.u = [8 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF"
define i32 @is_mv_double(double* %0) {
%2 = alloca double*
%3 = alloca [8 x i8]
store double* %0, double** %2
%4 = bitcast [8 x i8]* %3 to i8*
%5 = load double*, double** %2
%6 = bitcast [8 x i8]* %3 to i8**
%7 = call i64 @memcmp(double* %5, i8** %6, i32 8)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_mv_double(double* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 -1, i64* %2
%4 = bitcast i64* %2 to i8**
%5 = call i64 @memcmp(double* %0, i8** %4, i32 8)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
__attribute__((always_)) size_t swoole_size_align(size_t size, int pagesize) {
  return size + (pagesize - (size % pagesize));
}


x86 assembly (clang, -O0):
<swoole_size_align>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rsi
xor    %edx,%edx
div    %rsi
mov    -0x18(%rbp),%rax
sub    %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swoole_size_align>:
movslq %esi,%rcx
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1119 <swoole_size_align+0x19>
mov    %rdi,%rax
xor    %edx,%edx
div    %rcx
jmp    111f <swoole_size_align+0x1f>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
add    %rdi,%rcx
sub    %rdx,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @swoole_size_align(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = load i64, i64* %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = urem i64 %8, %10
%12 = sub i64 %7, %11
%13 = add i64 %5, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @swoole_size_align(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = urem i64 %0, %3
%5 = add i64 %3, %0
%6 = sub i64 %5, %4
ret i64 %6
}