xunge/DecIR huggingface dataset:
/* Variables and functions */
long long __builtin_ppc_get_timebase();
long long test_builtin_ppc_get_timebase() {
  return __builtin_ppc_get_timebase();
}


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

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

LLVM IR (-O0):
define i64 @test_builtin_ppc_get_timebase() {
%1 = call i64 (...) @__builtin_ppc_get_timebase()
ret i64 %1
}

LLVM IR (-O2):
define i64 @test_builtin_ppc_get_timebase() {
%1 = tail call i64 (...) @__builtin_ppc_get_timebase()
ret i64 %1
}
/* Variables and functions */
unsigned int random();
unsigned int q_random() { return random(); }


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

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

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

LLVM IR (-O2):
define i32 @q_random() {
%1 = tail call i32 (...) @random()
ret i32 %1
}
void outw(int port, unsigned short value) {
  __asm__ __volatile__("outw %w0, %w1" : : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x6(%rbp),%ax
mov    -0x4(%rbp),%edx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%eax
mov    %edi,%edx
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @outw(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w}, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %1, i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int(dirfd)(DIR *dir) {
  (void)dir;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @dirfd(i32* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
bool kmem_debugging() { return false; }


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

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

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

LLVM IR (-O2):
define i32 @kmem_debugging() {
ret i32 0
}
unsigned char i2c_rep_start(unsigned char address) { return 0; }


x86 assembly (clang, -O0):
<i2c_rep_start>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @i2c_rep_start(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @i2c_rep_start(i8 zeroext %0) {
ret i8 0
}
int get_ss(void) {
  int r;
  asm volatile("mov %%ss, %0" : "=r"(r));
  return r;
}


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

x86 assembly (clang, -O2):
<get_ss>:
mov    %ss,%eax
ret

LLVM IR (-O0):
define i32 @get_ss() {
%1 = alloca i32
%2 = call i32 asm sideeffect "mov %ss, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_ss() {
%1 = tail call i32 asm sideeffect "mov %ss, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
int isnum(char chr) { return chr >= '0' && chr <= '9'; }


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

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

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

LLVM IR (-O2):
define i32 @isnum(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int rand();
int random_number(int min, int max) {
  int result = rand() % (max - min + 1);
  return result + min;
}


x86 assembly (clang, -O0):
<random_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_number>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_number(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 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @random_number(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Type definitions */
struct fid_stx {
  int dummy;
};
struct fid_domain {
  int dummy;
};
struct fi_tx_attr {
  int dummy;
};

/* Variables and functions */
int gnix_stx_open(struct fid_domain *, struct fi_tx_attr *, struct fid_stx **,
                  void *);
int fi_stx_context(struct fid_domain *domain, struct fi_tx_attr *attr,
                   struct fid_stx **stx, void *context) {
  return gnix_stx_open(domain, attr, stx, context);
}


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

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

LLVM IR (-O0):
%struct.fid_domain = type { i32 }
%struct.fi_tx_attr = type { i32 }
%struct.fid_stx = type { i32 }
define i32 @fi_stx_context(%struct.fid_domain* %0, %struct.fi_tx_attr* %1, %struct.fid_stx** %2, i8* %3) {
%5 = alloca %struct.fid_domain*
%6 = alloca %struct.fi_tx_attr*
%7 = alloca %struct.fid_stx**
%8 = alloca i8*
store %struct.fid_domain* %0, %struct.fid_domain** %5
store %struct.fi_tx_attr* %1, %struct.fi_tx_attr** %6
store %struct.fid_stx** %2, %struct.fid_stx*** %7
store i8* %3, i8** %8
%9 = load %struct.fid_domain*, %struct.fid_domain** %5
%10 = load %struct.fi_tx_attr*, %struct.fi_tx_attr** %6
%11 = load %struct.fid_stx**, %struct.fid_stx*** %7
%12 = load i8*, i8** %8
%13 = call i32 @gnix_stx_open(%struct.fid_domain* %9, %struct.fi_tx_attr* %10, %struct.fid_stx** %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.fid_domain = type { i32 }
%struct.fi_tx_attr = type { i32 }
%struct.fid_stx = type { i32 }
define i32 @fi_stx_context(%struct.fid_domain* %0, %struct.fi_tx_attr* %1, %struct.fid_stx** %2, i8* %3) {
%5 = tail call i32 @gnix_stx_open(%struct.fid_domain* %0, %struct.fi_tx_attr* %1, %struct.fid_stx** %2, i8* %3)
ret i32 %5
}
/* Type definitions */
struct sockaddr_storage {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
scalar_t__ getpeername(int, struct sockaddr *, int *);
bool net_is_connected(int sock) {
  struct sockaddr_storage addr;
  socklen_t len = sizeof(addr);
  return (getpeername(sock, (struct sockaddr *)&addr, &len) == 0);
}


x86 assembly (clang, -O0):
<net_is_connected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <getpeername@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_is_connected>:
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <getpeername@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @net_is_connected(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_storage
%4 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %4
%5 = load i32, i32* %2
%6 = bitcast %struct.sockaddr_storage* %3 to %struct.sockaddr*
%7 = call i64 @getpeername(i32 %5, %struct.sockaddr* %6, i32* %4)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @net_is_connected(i32 %0) {
%2 = alloca %struct.sockaddr_storage
%3 = alloca i32
%4 = bitcast %struct.sockaddr_storage* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_storage* %2 to %struct.sockaddr*
%7 = call i64 @getpeername(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
char *str_cp_tr(int (*tr)(int), char *dst, const char *src) {
  while ((*dst = (char)tr((unsigned char)*src++)))
    ++dst;
  return dst;
}


x86 assembly (clang, -O0):
<str_cp_tr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movzbl (%rcx),%edi
call   *%rax
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     114b <str_cp_tr+0x4b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <str_cp_tr+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cp_tr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
movzbl (%rdx),%edi
call   *%r14
mov    %al,(%r15)
test   %al,%al
je     114b <str_cp_tr+0x4b>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%r15),%r12
movzbl (%rbx),%edi
call   *%r14
mov    %al,0x1(%r15)
add    $0x1,%rbx
mov    %r12,%r15
test   %al,%al
jne    1130 <str_cp_tr+0x30>
jmp    114e <str_cp_tr+0x4e>
mov    %r15,%r12
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @str_cp_tr(i32 (i32)* nocapture %0, i8* writeonly %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = tail call i32 %0(i32 %5)
%7 = trunc i32 %6 to i8
store i8 %7, i8* %1
%8 = icmp eq i8 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %3, %9
%10 = phi i8* [ %12, %9 ], [ %2, %3 ]
%11 = phi i8* [ %13, %9 ], [ %1, %3 ]
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = getelementptr inbounds i8, i8* %11, i64 1
%14 = load i8, i8* %12
%15 = zext i8 %14 to i32
%16 = tail call i32 %0(i32 %15)
%17 = trunc i32 %16 to i8
store i8 %17, i8* %13
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %9
19: ; preds = %9, %3
%20 = phi i8* [ %1, %3 ], [ %13, %9 ]
ret i8* %20
}
float Fzero(x)
float x;
{
  if (x < 1.e-7)
    return 1.;
  x = sqrt(x);
  return .5 * 1.7724538509055160272981674 / x * erf(x);
}


x86 assembly (clang, -O0):
<Fzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xebe(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    115e <Fzero+0x3e>
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11b2 <Fzero+0x92>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe82(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1040 <erf@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fzero>:
push   %rax
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed7(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    1141 <Fzero+0x21>
movss  0xec1(%rip),%xmm0
pop    %rax
ret
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     114f <Fzero+0x2f>
sqrtss %xmm0,%xmm0
jmp    1154 <Fzero+0x34>
call   1030 <sqrtf@plt>
cvtss2sd %xmm0,%xmm0
movsd  0xeb0(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
call   1040 <erf@plt>
mulsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Fzero(double %0) {
%2 = alloca float
%3 = alloca float
%4 = fptrunc double %0 to float
store float %4, float* %3
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fcmp olt double %6, 0x3E7AD7F29ABCAF48
br i1 %7, label %8, label %9
8: ; preds = %1
store float 1.000000e+00, float* %2
br label %22
9: ; preds = %1
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = call double @sqrt(double %11)
%13 = fptrunc double %12 to float
store float %13, float* %3
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = fdiv double 0x3FEC5BF891B4EF6B, %15
%17 = load float, float* %3
%18 = fpext float %17 to double
%19 = call double @erf(double %18)
%20 = fmul double %16, %19
%21 = fptrunc double %20 to float
store float %21, float* %2
br label %22
22: ; preds = %9, %8
%23 = load float, float* %2
ret float %23
}

LLVM IR (-O2):
define float @Fzero(double %0) {
%2 = fptrunc double %0 to float
%3 = fpext float %2 to double
%4 = fcmp olt double %3, 0x3E7AD7F29ABCAF48
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = tail call float @sqrtf(float %2)
%7 = fpext float %6 to double
%8 = fdiv double 0x3FEC5BF891B4EF6B, %7
%9 = tail call double @erf(double %7)
%10 = fmul double %9, %8
%11 = fptrunc double %10 to float
br label %12
12: ; preds = %1, %5
%13 = phi float [ %11, %5 ], [ 1.000000e+00, %1 ]
ret float %13
}
/* Variables and functions */
int _tb_rand(int, int);
int tb_rand(int min, int max) { return _tb_rand(min, max); }


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

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

LLVM IR (-O0):
define i32 @tb_rand(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 @_tb_rand(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @tb_rand(i32 %0, i32 %1) {
%3 = tail call i32 @_tb_rand(i32 %0, i32 %1)
ret i32 %3
}
int getByte(int x, int n) {
  int mask = 255;
  int shift = (n) << 3;
  return mask & (x >> shift);
}


x86 assembly (clang, -O0):
<getByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xff,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getByte>:
lea    0x0(,%rsi,8),%ecx
sar    %cl,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @getByte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 255, i32* %5
%7 = load i32, i32* %4
%8 = shl i32 %7, 3
store i32 %8, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %6
%12 = ashr i32 %10, %11
%13 = and i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @getByte(i32 %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = ashr i32 %0, %3
%5 = and i32 %4, 255
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ xorSwap(int *, int *);
int main() {
  int a, b;
  a = 10;
  b = 45;
  printf("Values before Swap\n a=%d,b=%d\n", a, b);
  xorSwap(&a, &b);
  printf("Values after Swap\n a=%d,b=%d\n", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x2d,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <xorSwap@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
movl   $0x2d,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0x2d,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <xorSwap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Values before Swap\0A a=%d,b=%d\0A\00"
@.str.1 = [30 x i8] c"Values after Swap\0A a=%d,b=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
store i32 45, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = call i32 @xorSwap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Values before Swap\0A a=%d,b=%d\0A\00"
@.str.1 = [30 x i8] c"Values after Swap\0A a=%d,b=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %1
store i32 45, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 10, i32 45)
%6 = call i32 @xorSwap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
char *strstr(char *, char const *);
bool starts_with(char *s, const char *prefix) {
  if (strstr(s, prefix) == s) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
cmp    -0x10(%rbp),%rax
jne    1143 <starts_with+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <starts_with+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @starts_with(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *, char const *, unsigned int);
void report_cache(const char *pfx, unsigned long cpuid) {
  unsigned num_words = cpuid & 0xff;
  unsigned num_lines = (cpuid >> 8) & 0xffff;
  printk("%s Line Size: %u\n", pfx, num_words * 4);
  printk("%s Size:      %u\n", pfx, num_lines * num_words * 4);
}


x86 assembly (clang, -O0):
<report_cache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
and    $0xffff,%rax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
shl    $0x2,%edx
lea    0xeb1(%rip),%rdi
call   1030 <printk@plt>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
imul   -0x14(%rbp),%edx
shl    $0x2,%edx
lea    0xea9(%rip),%rdi
call   1030 <printk@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_cache>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
movzbl %sil,%ebp
mov    %esi,%eax
shr    $0x8,%eax
movzwl %ax,%r14d
shl    $0x2,%ebp
lea    0xed2(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <printk@plt>
imul   %r14d,%ebp
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printk@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s Line Size: %u\0A\00"
@.str.1 = [18 x i8] c"%s Size: %u\0A\00"
define void @report_cache(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = and i64 %7, 255
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i64, i64* %4
%11 = lshr i64 %10, 8
%12 = and i64 %11, 65535
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = mul i32 %15, 4
%17 = call i32 @printk(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %16)
%18 = load i8*, i8** %3
%19 = load i32, i32* %6
%20 = load i32, i32* %5
%21 = mul i32 %19, %20
%22 = mul i32 %21, 4
%23 = call i32 @printk(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %18, i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s Line Size: %u\0A\00"
@.str.1 = [18 x i8] c"%s Size: %u\0A\00"
define void @report_cache(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = lshr i32 %3, 8
%5 = and i32 %4, 65535
%6 = shl i32 %3, 2
%7 = and i32 %6, 1020
%8 = tail call i32 @printk(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %7)
%9 = mul nuw nsw i32 %7, %5
%10 = tail call i32 @printk(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %9)
ret void
}
/* Type definitions */
struct module {
  int dummy;
};

/* Variables and functions */
int init_module(char const *, struct module const *);
int sys_init_module(const char *name, const struct module *info) {
  return init_module(name, info);
}


x86 assembly (clang, -O0):
<sys_init_module>:
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 <init_module@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.module = type { i32 }
define i32 @sys_init_module(i8* %0, %struct.module* %1) {
%3 = alloca i8*
%4 = alloca %struct.module*
store i8* %0, i8** %3
store %struct.module* %1, %struct.module** %4
%5 = load i8*, i8** %3
%6 = load %struct.module*, %struct.module** %4
%7 = call i32 @init_module(i8* %5, %struct.module* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.module = type { i32 }
define i32 @sys_init_module(i8* %0, %struct.module* %1) {
%3 = tail call i32 @init_module(i8* %0, %struct.module* %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t next_seq(uint32_t num) {
  if (num & 1) {
    return 3 * num + 1;
  } else {
    return num / 2;
  }
}


x86 assembly (clang, -O0):
<next_seq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1125 <next_seq+0x25>
imul   $0x3,-0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <next_seq+0x33>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_seq>:
test   $0x1,%dil
jne    1110 <next_seq+0x10>
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret
lea    (%rdi,%rdi,2),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @next_seq(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = mul nsw i32 %0, 3
%6 = add nsw i32 %5, 1
br label %9
7: ; preds = %1
%8 = sdiv i32 %0, 2
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ %8, %7 ]
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ val;
typedef int __u32;

/* Variables and functions */
__u32 ___swab32(__u32 val) {
  return ((__u32)((((__u32)(val) & (__u32)0x000000ffUL) << 24) |
                  (((__u32)(val) & (__u32)0x0000ff00UL) << 8) |
                  (((__u32)(val) & (__u32)0x00ff0000UL) >> 8) |
                  (((__u32)(val) & (__u32)0xff000000UL) >> 24)));
}


x86 assembly (clang, -O0):
<___swab32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
sar    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<___swab32>:
mov    %edi,%eax
and    $0xffffff,%eax
bswap  %eax
sar    $0x18,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @___swab32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = ashr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @___swab32(i32 %0) {
%2 = and i32 %0, 16777215
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = ashr i32 %0, 24
%5 = or i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_subb_direct(FILE *stream, uint8_t direct) {
  fprintf(stream,
          "SUBB  A, "
          "0x%02X"
          "                   ",
          direct);
}


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

x86 assembly (clang, -O2):
<fprint_subb_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"SUBB A, 0x%02X \00"
define void @fprint_subb_direct(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 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"SUBB A, 0x%02X \00"
define void @fprint_subb_direct(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int strlen(char *);
void pw_wipe(char *pass) {
  int i;
  if (!pass)
    return;
  i = strlen(pass);
  while (i)
    pass[--i] = 0;
  free(pass);
}


x86 assembly (clang, -O0):
<pw_wipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <pw_wipe+0x1c>
jmp    1174 <pw_wipe+0x54>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116b <pw_wipe+0x4b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1148 <pw_wipe+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pw_wipe>:
test   %rdi,%rdi
je     1160 <pw_wipe+0x30>
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
test   %eax,%eax
je     1157 <pw_wipe+0x27>
lea    -0x1(%rax),%ecx
movslq %ecx,%rdi
sub    %rcx,%rdi
add    %rbx,%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @pw_wipe(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = add i32 %4, -1
%8 = sext i32 %7 to i64
%9 = zext i32 %7 to i64
%10 = sub nsw i64 %8, %9
%11 = getelementptr i8, i8* %0, i64 %10
%12 = zext i32 %4 to i64
br label %13
13: ; preds = %6, %3
%14 = tail call i32 @free(i8* %0)
br label %15
15: ; preds = %1, %13
ret void
}
void wifi_rsp_tcpip_tcp_connect(
    const struct wifi_msg_tcpip_tcp_connect_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_tcpip_tcp_connect_rsp_t = type opaque
define void @wifi_rsp_tcpip_tcp_connect(%struct.wifi_msg_tcpip_tcp_connect_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ solve(int);
int main() {
  int p;
  scanf("%d", &p);
  printf("%ld\n", solve(p));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <solve@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <solve@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @solve(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @solve(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void clear(void) {
  char *mem = (char *)(0xb8000);
  while (*mem != 0) {
    *mem = 0;
    mem++;
  }
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb8000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1135 <clear+0x35>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110d <clear+0xd>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
cmpb   $0x0,0xb8000
je     111d <clear+0x1d>
mov    $0xb8001,%eax
nop
movb   $0x0,-0x1(%rax)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1110 <clear+0x10>
ret

LLVM IR (-O0):
define void @clear() {
%1 = alloca i8*
store i8* inttoptr (i64 753664 to i8*), i8** %1
br label %2
2: ; preds = %7, %0
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %1
store i8 0, i8* %8
%9 = load i8*, i8** %1
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @clear() {
%1 = load i8, i8* inttoptr (i64 753664 to i8*)
%2 = icmp eq i8 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i8* [ %5, %3 ], [ inttoptr (i64 753664 to i8*), %0 ]
store i8 0, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void i(char *q) { free(q); }


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

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

LLVM IR (-O2):
define void @i(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
long long int _f_llrintf(float x) {
  long long int _result;
  asm("fistpll %0" : "=m"(_result) : "t"(x) : "st");
  return _result;
}


x86 assembly (clang, -O0):
<_f_llrintf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
flds   -0x14(%rbp)
fistpll -0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_f_llrintf>:
movss  %xmm0,-0xc(%rsp)
flds   -0xc(%rsp)
fistpll -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @_f_llrintf(float %0) {
%2 = alloca float
%3 = alloca i64
store float %0, float* %2
%4 = load float, float* %2
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @_f_llrintf(float %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverse(char *);
int /*<<< orphan*/ stdin;
int main(void) {
  char sentence[80];
  printf("Enter a line of text:\n");
  fgets(sentence, 80, stdin);
  printf("\nThe line printed backward is:\n");
  reverse(sentence);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <reverse@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter a line of text:\0A\00"
@stdin = global i32 0
@.str.1 = [32 x i8] c"\0AThe line printed backward is:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 80, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%9 = call i32 @reverse(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [22 x i8] c"Enter a line of text:\00"
@str.2 = [31 x i8] c"\0AThe line printed backward is:\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 80, i32 %4)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
%7 = call i32 @reverse(i8* %2)
ret i32 0
}
/* Variables and functions */
long double rintl(long double);
long double test1l(long double x) { return rintl(x); }


x86 assembly (clang, -O0):
<test1l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <rintl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1l>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <rintl@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define x86_fp80 @test1l(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.rint.f80(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("喂！\n您好！\n\n再见！\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"\E5\96\82\EF\BC\81\0A\E6\82\A8\E5\A5\BD\EF\BC\81\0A\0A\E5\86\8D\E8\A7\81\EF\BC\81\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"\E5\96\82\EF\BC\81\0A\E6\82\A8\E5\A5\BD\EF\BC\81\0A\0A\E5\86\8D\E8\A7\81\EF\BC\81\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  struct {
    int node;
    int type;
  } lastglob[1] = {{0, 1}};
  if (lastglob[0].node != 0 || lastglob[0].type != 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    114e <main+0x2e>
cmpl   $0x1,-0xc(%rbp)
je     1155 <main+0x35>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
%struct.anon = type { i32, i32 }
@__const.main.lastglob = [1 x %struct.anon] [%struct.anon { i32 0, i32 1 }]
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x %struct.anon]
store i32 0, i32* %1
%3 = bitcast [1 x %struct.anon]* %2 to i8*
%4 = getelementptr inbounds [1 x %struct.anon], [1 x %struct.anon]* %2, i64 0, i64 0
%5 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %0
%9 = getelementptr inbounds [1 x %struct.anon], [1 x %struct.anon]* %2, i64 0, i64 0
%10 = getelementptr inbounds %struct.anon, %struct.anon* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %8, %0
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %8
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct expr {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ expr_print_list(int /*<<< orphan*/ *, struct expr *,
                                   int /*<<< orphan*/);
void expr_print(FILE *file, struct expr *e) { expr_print_list(file, e, 0); }


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

x86 assembly (clang, -O2):
<expr_print>:
xor    %edx,%edx
jmp    1030 <expr_print_list@plt>

LLVM IR (-O0):
%struct.expr = type { i32 }
define void @expr_print(i32* %0, %struct.expr* %1) {
%3 = alloca i32*
%4 = alloca %struct.expr*
store i32* %0, i32** %3
store %struct.expr* %1, %struct.expr** %4
%5 = load i32*, i32** %3
%6 = load %struct.expr*, %struct.expr** %4
%7 = call i32 @expr_print_list(i32* %5, %struct.expr* %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.expr = type { i32 }
define void @expr_print(i32* %0, %struct.expr* %1) {
%3 = tail call i32 @expr_print_list(i32* %0, %struct.expr* %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ smash_tilde(char *);
char *strdup(char const *);
char *smash_tilde_copy(const char *str) {
  char *result = strdup(str);
  smash_tilde(result);
  return result;
}


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

x86 assembly (clang, -O2):
<smash_tilde_copy>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <smash_tilde@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @smash_tilde_copy(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i32 @smash_tilde(i8* %2)
ret i8* %2
}
void gameover_update() {}


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

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

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

LLVM IR (-O2):
define void @gameover_update() {
ret void
}
/* Variables and functions */
void pgtrace_active(void) {}


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

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

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

LLVM IR (-O2):
define void @pgtrace_active() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char *, int);
int main(void) {
  asprintf("%d", 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
call   1030 <asprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @asprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @asprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
int addThree(int x, int y) { return x + 3; }


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

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

LLVM IR (-O0):
define i32 @addThree(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 = add nsw i32 %5, 3
ret i32 %6
}

LLVM IR (-O2):
define i32 @addThree(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 3
ret i32 %3
}
void shutdown(void) { (void *)0; }


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

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

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

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