xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  scanf("%d", &n);
  printf("%d", n * n);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
imul   %esi,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
float QuarticEaseOut(float p) {
  float f = (p - 1);
  return f * f * f * (1 - p) + 1;
}


x86 assembly (clang, -O0):
<QuarticEaseOut>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xeca(%rip),%xmm1
subss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xeb9(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuarticEaseOut>:
movss  0xef8(%rip),%xmm1
addss  %xmm0,%xmm1
movaps %xmm1,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
movss  0xee5(%rip),%xmm3
movaps %xmm3,%xmm1
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm3,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @QuarticEaseOut(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fmul float %2, %2
%4 = fmul float %2, %3
%5 = fsub float 1.000000e+00, %0
%6 = tail call float @llvm.fmuladd.f32(float %4, float %5, float 1.000000e+00)
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ __be64_to_cpu(int /*<<< orphan*/);
void LOAD_OP(int I, uint64_t *W, const uint8_t *input) {
  W[I] = __be64_to_cpu(((uint64_t *)(input))[I]);
}


x86 assembly (clang, -O0):
<LOAD_OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <__be64_to_cpu@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LOAD_OP>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
movslq %edi,%rbx
mov    (%rdx,%rbx,4),%edi
call   1030 <__be64_to_cpu@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @LOAD_OP(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = call i32 @__be64_to_cpu(i32 %11)
%13 = load i32*, i32** %5
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
define void @LOAD_OP(i32 %0, i32* nocapture writeonly %1, i32* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @__be64_to_cpu(i32 %6)
%8 = getelementptr inbounds i32, i32* %1, i64 %4
store i32 %7, i32* %8
ret void
}
unsigned char high(int value) { return ((value >> 8) & 0xff); }


x86 assembly (clang, -O0):
<high>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<high>:
mov    %edi,%eax
shr    $0x8,%eax
ret

LLVM IR (-O0):
define zeroext i8 @high(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @high(i32 %0) {
%2 = lshr i32 %0, 8
%3 = trunc i32 %2 to i8
ret i8 %3
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
scalar_t__ clamp_s12(int const);
void RescaleUVSubBlock(int16_t *dst, const int16_t *src) {
  unsigned int i;
  for (i = 0; i < 64; ++i)
    dst[i] = (((int)clamp_s12(src[i]) * 0xe00) >> 16) + 0x80;
}


x86 assembly (clang, -O0):
<RescaleUVSubBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jae    1167 <RescaleUVSubBlock+0x57>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
call   1030 <clamp_s12@plt>
imul   $0xe00,%eax,%edx
sar    $0x10,%edx
add    $0x80,%edx
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <RescaleUVSubBlock+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RescaleUVSubBlock>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r14,%rbx,4),%edi
call   1030 <clamp_s12@plt>
imul   $0xe00,%eax,%eax
sar    $0x10,%eax
sub    $0xffffff80,%eax
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1120 <RescaleUVSubBlock+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @RescaleUVSubBlock(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %24, %2
%7 = load i32, i32* %5
%8 = icmp ult i32 %7, 64
br i1 %8, label %9, label %27
9: ; preds = %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = call i64 @clamp_s12(i32 %14)
%16 = trunc i64 %15 to i32
%17 = mul nsw i32 %16, 3584
%18 = ashr i32 %17, 16
%19 = add nsw i32 %18, 128
%20 = load i32*, i32** %3
%21 = load i32, i32* %5
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
store i32 %19, i32* %23
br label %24
24: ; preds = %9
%25 = load i32, i32* %5
%26 = add i32 %25, 1
store i32 %26, i32* %5
br label %6
27: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @RescaleUVSubBlock(i32* nocapture writeonly %0, i32* nocapture %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %13, %3 ]
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = tail call i64 @clamp_s12(i32 %6)
%8 = trunc i64 %7 to i32
%9 = mul nsw i32 %8, 3584
%10 = ashr i32 %9, 16
%11 = add nsw i32 %10, 128
%12 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %11, i32* %12
%13 = add nuw nsw i64 %4, 1
%14 = icmp eq i64 %13, 64
br i1 %14, label %15, label %3
15: ; preds = %3
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
void log_payload_recv(int packet_num, uint8_t *buf, int length) {
  FILE *log = fopen("recv.log", "a");
  fwrite(&packet_num, sizeof(int), 1, log);
  fwrite(buf, sizeof(uint8_t), length, log);
  fclose(log);
}


x86 assembly (clang, -O0):
<log_payload_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xeb7(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x4,%esi
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_payload_recv>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xeb7(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbp
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14d,%edx
mov    %rbp,%rcx
call   1050 <fwrite@plt>
mov    %rbp,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"recv.log\00"
@.str.1 = [2 x i8] c"a\00"
define void @log_payload_recv(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %7
%9 = load i32*, i32** %7
%10 = call i32 @fwrite(i32* %4, i32 4, i32 1, i32* %9)
%11 = load i32*, i32** %5
%12 = load i32, i32* %6
%13 = load i32*, i32** %7
%14 = call i32 @fwrite(i32* %11, i32 4, i32 %12, i32* %13)
%15 = load i32*, i32** %7
%16 = call i32 @fclose(i32* %15)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"recv.log\00"
@.str.1 = [2 x i8] c"a\00"
define void @log_payload_recv(i32 %0, i32* nocapture %1, i32 %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @fwrite(i32* %4, i32 4, i32 1, i32* %5)
%7 = tail call i32 @fwrite(i32* %1, i32 4, i32 %2, i32* %5)
%8 = tail call i32 @fclose(i32* %5)
ret void
}
/* Variables and functions */
scalar_t__ pthread_self();
int c_get_threadid() { return (int)pthread_self(); }


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

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

LLVM IR (-O0):
define i32 @c_get_threadid() {
%1 = call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @c_get_threadid() {
%1 = tail call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Type definitions */
struct elf32_hdr {
  int dummy;
};

/* Variables and functions */
unsigned int PER_LINUX_32BIT;
int /*<<< orphan*/ set_personality(unsigned int);
void elf_set_personality(const struct elf32_hdr *x) {
  unsigned int personality = PER_LINUX_32BIT;
  set_personality(personality);
}


x86 assembly (clang, -O0):
<elf_set_personality>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <set_personality@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_set_personality>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <set_personality@plt>

LLVM IR (-O0):
%struct.elf32_hdr = type { i32 }
@PER_LINUX_32BIT = global i32 0
define void @elf_set_personality(%struct.elf32_hdr* %0) {
%2 = alloca %struct.elf32_hdr*
%3 = alloca i32
store %struct.elf32_hdr* %0, %struct.elf32_hdr** %2
%4 = load i32, i32* @PER_LINUX_32BIT
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @set_personality(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.elf32_hdr = type { i32 }
@PER_LINUX_32BIT = global i32 0
define void @elf_set_personality(%struct.elf32_hdr* nocapture readnone %0) {
%2 = load i32, i32* @PER_LINUX_32BIT
%3 = tail call i32 @set_personality(i32 %2)
ret void
}
/* Variables and functions */
int __nvvm_read_ptx_sreg_ntid_w();
int __nvvm_read_ptx_sreg_ntid_x();
int __nvvm_read_ptx_sreg_ntid_y();
int __nvvm_read_ptx_sreg_ntid_z();
__attribute__((device)) int read_ntid() {
  int x = __nvvm_read_ptx_sreg_ntid_x();
  int y = __nvvm_read_ptx_sreg_ntid_y();
  int z = __nvvm_read_ptx_sreg_ntid_z();
  int w = __nvvm_read_ptx_sreg_ntid_w();
  return x + y + z + w;
}


x86 assembly (clang, -O0):
<read_ntid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__nvvm_read_ptx_sreg_ntid_x@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__nvvm_read_ptx_sreg_ntid_y@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__nvvm_read_ptx_sreg_ntid_z@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <__nvvm_read_ptx_sreg_ntid_w@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ntid>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <__nvvm_read_ptx_sreg_ntid_x@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <__nvvm_read_ptx_sreg_ntid_y@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <__nvvm_read_ptx_sreg_ntid_z@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <__nvvm_read_ptx_sreg_ntid_w@plt>
add    %r14d,%ebp
add    %ebx,%ebp
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_ntid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @__nvvm_read_ptx_sreg_ntid_x()
store i32 %5, i32* %1
%6 = call i32 (...) @__nvvm_read_ptx_sreg_ntid_y()
store i32 %6, i32* %2
%7 = call i32 (...) @__nvvm_read_ptx_sreg_ntid_z()
store i32 %7, i32* %3
%8 = call i32 (...) @__nvvm_read_ptx_sreg_ntid_w()
store i32 %8, i32* %4
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_ntid() {
%1 = tail call i32 (...) @__nvvm_read_ptx_sreg_ntid_x()
%2 = tail call i32 (...) @__nvvm_read_ptx_sreg_ntid_y()
%3 = tail call i32 (...) @__nvvm_read_ptx_sreg_ntid_z()
%4 = tail call i32 (...) @__nvvm_read_ptx_sreg_ntid_w()
%5 = add nsw i32 %2, %1
%6 = add nsw i32 %5, %3
%7 = add nsw i32 %6, %4
ret i32 %7
}
int test_imm_8Buint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x8B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Buint64_midword_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, 16
%6 = and i64 %5, 139
%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_8Buint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9109504
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int is_write_request(int opcode) { return opcode == 2; }


x86 assembly (clang, -O0):
<is_write_request>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_write_request>:
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_write_request(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_write_request(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int abs(int const);
const char *IntTileType(const int i) {
  static const char *tileTypes[] = {"shadow", "normal", "alt1", "alt2"};
  return tileTypes[abs(i) % 4];
}


x86 assembly (clang, -O0):
<IntTileType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
lea    0x2efb(%rip),%rax
mov    (%rax,%rcx,8),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntTileType>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
and    $0x3,%eax
lea    0xeef(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@IntTileType.tileTypes = internal global [4 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0)]
@.str = [7 x i8] c"shadow\00"
@.str.1 = [7 x i8] c"normal\00"
@.str.2 = [5 x i8] c"alt1\00"
@.str.3 = [5 x i8] c"alt2\00"
define i8* @IntTileType(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @abs(i32 %3)
%5 = srem i32 %4, 4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [4 x i8*], [4 x i8*]* @IntTileType.tileTypes, i64 0, i64 %6
%8 = load i8*, i8** %7
ret i8* %8
}

LLVM IR (-O2):
@reltable.IntTileType = internal unnamed_addr constant [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.IntTileType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.IntTileType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.IntTileType to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.IntTileType to i64)) to i32)]
@.str = [7 x i8] c"shadow\00"
@.str.1 = [7 x i8] c"normal\00"
@.str.2 = [5 x i8] c"alt1\00"
@.str.3 = [5 x i8] c"alt2\00"
define i8* @IntTileType(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = and i32 %2, 3
%4 = zext i32 %3 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.IntTileType to i8*), i64 %5)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glutWireTeapot(double);
void display() {
  glClear(GL_COLOR_BUFFER_BIT);
  glutWireTeapot(.5);
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
movsd  0xeb6(%rip),%xmm0
call   1050 <glutWireTeapot@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
movsd  0xeb9(%rip),%xmm0
call   1050 <glutWireTeapot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 @glutWireTeapot(double 5.000000e-01)
%4 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 @glutWireTeapot(double 5.000000e-01)
%4 = tail call i32 (...) @glFlush()
ret void
}
int xcomp_inode_info_free(struct xcomp_inode_info *info) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.xcomp_inode_info = type opaque
define i32 @xcomp_inode_info_free(%struct.xcomp_inode_info* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void netprobe_termination_handler(int s) {
  printf("NetworkProbe Exiting...");
  exit(s == 0 ? 1 : 0);
}


x86 assembly (clang, -O0):
<netprobe_termination_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%ecx
xor    %edi,%edi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmove  %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<netprobe_termination_handler>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
test   %ebx,%ebx
sete   %dil
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"NetworkProbe Exiting...\00"
define void @netprobe_termination_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"NetworkProbe Exiting...\00"
define void @netprobe_termination_handler(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int Cyc_JumpAnalysis_hash_ptr(void *s) {
  void *_T0;
  int _T1;
  _T0 = s;
  _T1 = (int)_T0;
  return _T1;
}


x86 assembly (clang, -O0):
<Cyc_JumpAnalysis_hash_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_JumpAnalysis_hash_ptr>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @Cyc_JumpAnalysis_hash_ptr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int unsetI2C(int i2c_fd) {
  close(i2c_fd);
  return 0;
}


x86 assembly (clang, -O0):
<unsetI2C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsetI2C>:
push   %rax
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @unsetI2C(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ send_tcp(char *, int);
int main(int argc, char *argv[]) {
  send_tcp(argv[1], 80);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x50,%esi
call   1030 <send_tcp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    $0x50,%esi
call   1030 <send_tcp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @send_tcp(i8* %8, i32 80)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @send_tcp(i8* %4, i32 80)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ ssqfcn_(int *, int *, double *, double *, int *);
void mgh_ssqfcn(int m, int n, const double *x, double *fvec, int nprob) {
  int _m = m, _n = n, _nprob = nprob;
  assert(sizeof(double) == sizeof(*x));
  ssqfcn_(&_m, &_n, (double *)x, (double *)fvec, &_nprob);
}


x86 assembly (clang, -O0):
<mgh_ssqfcn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
lea    -0x28(%rbp),%r8
call   1040 <ssqfcn_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgh_ssqfcn>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
mov    %r8d,0xc(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%r8
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <ssqfcn_@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mgh_ssqfcn(i32 %0, i32 %1, double* %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store double* %2, double** %8
store double* %3, double** %9
store i32 %4, i32* %10
%14 = load i32, i32* %6
store i32 %14, i32* %11
%15 = load i32, i32* %7
store i32 %15, i32* %12
%16 = load i32, i32* %10
store i32 %16, i32* %13
%17 = call i32 @assert(i32 1)
%18 = load double*, double** %8
%19 = load double*, double** %9
%20 = call i32 @ssqfcn_(i32* %11, i32* %12, double* %18, double* %19, i32* %13)
ret void
}

LLVM IR (-O2):
define void @mgh_ssqfcn(i32 %0, i32 %1, double* %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %6 to i8*
store i32 %0, i32* %6
%10 = bitcast i32* %7 to i8*
store i32 %1, i32* %7
%11 = bitcast i32* %8 to i8*
store i32 %4, i32* %8
%12 = tail call i32 @assert(i32 1)
%13 = call i32 @ssqfcn_(i32* %6, i32* %7, double* %2, double* %3, i32* %8)
ret void
}
/* Variables and functions */
char *calloc(int, int);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *cpystr(const char *str) {
  int len = strlen(str);
  char *path = calloc(sizeof(char), len + 1);
  strncpy(path, str, len);
  path[len] = 0;
  return path;
}


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

x86 assembly (clang, -O2):
<cpystr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%r15d
lea    0x1(%r15),%esi
mov    $0x1,%edi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <strncpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @cpystr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i8* @calloc(i32 1, i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = call i32 @strncpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %4
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
define i8* @cpystr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @calloc(i32 1, i32 %3)
%5 = tail call i32 @strncpy(i8* %4, i8* %0, i32 %2)
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
void gtk_toolbar_get_style() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_get_style() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SCK(int /*<<< orphan*/);
int /*<<< orphan*/ SI(int /*<<< orphan*/);
void p24start(void) {
  SI(0);
  SCK(0);
}


x86 assembly (clang, -O0):
<p24start>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <SI@plt>
xor    %edi,%edi
call   1030 <SCK@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<p24start>:
push   %rax
xor    %edi,%edi
call   1040 <SI@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <SCK@plt>

LLVM IR (-O0):
define void @p24start() {
%1 = call i32 @SI(i32 0)
%2 = call i32 @SCK(i32 0)
ret void
}

LLVM IR (-O2):
define void @p24start() {
%1 = tail call i32 @SI(i32 0)
%2 = tail call i32 @SCK(i32 0)
ret void
}
/* Variables and functions */
int exchange(int *, int);
int /*<<< orphan*/ printf(char *, int, int);
void test_exchange() {
  int a = 4;
  int b = exchange(&a, 3);
  printf("a = %d, b = %d\n", a, b);
}


x86 assembly (clang, -O0):
<test_exchange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x3,%esi
call   1040 <exchange@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_exchange>:
push   %rax
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x3,%esi
call   1040 <exchange@plt>
mov    0x4(%rsp),%esi
lea    0xebd(%rip),%rdi
mov    %eax,%edx
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"a = %d, b = %d\0A\00"
define void @test_exchange() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 4, i32* %1
%3 = call i32 @exchange(i32* %1, i32 3)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %3)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int inet6_rth_gettype(void *bp) {
  uint8_t *rthp = (uint8_t *)bp;
  return rthp[2];
}


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

x86 assembly (clang, -O2):
<inet6_rth_gettype>:
mov    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @inet6_rth_gettype(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 2
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @inet6_rth_gettype(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XUnmapEvent;

/* Variables and functions */
void set_XUnmapEvent_serial(void *_p, unsigned long _v) {
  ((XUnmapEvent *)_p)->serial = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XUnmapEvent_serial>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XUnmapEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void print_copyright() {
  time_t t;
  struct tm *ts;
  t = time(NULL);
  ts = localtime(&t);
  int year = ts->tm_year + 1900;
  printf(
      "Copyright 1987-2014 US Government. This work, authored by Alaska "
      "Satellite\n"
      "Facility employees, was funded in whole or in part by NASA, under US\n"
      "Government contract NNG13HQ05C.\n"
      "\n");
}


x86 assembly (clang, -O0):
<print_copyright>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x76c,%eax
mov    %eax,-0x14(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_copyright>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeb3(%rip),%rdi
call   1040 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [178 x i8] c"Copyright 1987-2014 US Government. This work, authored by Alaska Satellite\0AFacility employees, was funded in whole or in part by NASA, under US\0AGovernment contract NNG13HQ05C.\0A\0A\00"
define void @print_copyright() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i32
%4 = call i32 @time(i32* null)
store i32 %4, i32* %1
%5 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %5, %struct.tm** %2
%6 = load %struct.tm*, %struct.tm** %2
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1900
store i32 %9, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@str = [177 x i8] c"Copyright 1987-2014 US Government. This work, authored by Alaska Satellite\0AFacility employees, was funded in whole or in part by NASA, under US\0AGovernment contract NNG13HQ05C.\0A\00"
define void @print_copyright() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([177 x i8], [177 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int CANBaseValid(unsigned long);
unsigned long CANRegRead(unsigned long);
int /*<<< orphan*/ CANRegWrite(unsigned long, unsigned long);
int /*<<< orphan*/ DEBUG_ASSERT(int);
void CANIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(CANBaseValid(ulBase));
  DEBUG_ASSERT((ulIntFlags & ~(0x00000008 | 0x00000004 | 0x00000002)) == 0);
  CANRegWrite(ulBase + 0x00000000,
              CANRegRead(ulBase + 0x00000000) & ~(ulIntFlags));
}


x86 assembly (clang, -O0):
<CANIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <CANBaseValid@plt>
mov    %eax,%edi
call   1050 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0xfffffffffffffff1,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
add    $0x0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x0,%rdi
call   1040 <CANRegRead@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    %rax,%rsi
call   1030 <CANRegWrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntDisable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1060 <CANBaseValid@plt>
mov    %eax,%edi
call   1050 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xfffffffffffffff1,%rbx
sete   %dil
call   1050 <DEBUG_ASSERT@plt>
mov    %r14,%rdi
call   1040 <CANRegRead@plt>
not    %rbx
and    %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <CANRegWrite@plt>

LLVM IR (-O0):
define void @CANIntDisable(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 = call i32 @CANBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = and i64 %8, -15
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @DEBUG_ASSERT(i32 %11)
%13 = load i64, i64* %3
%14 = add i64 %13, 0
%15 = load i64, i64* %3
%16 = add i64 %15, 0
%17 = call i64 @CANRegRead(i64 %16)
%18 = load i64, i64* %4
%19 = xor i64 %18, -1
%20 = and i64 %17, %19
%21 = call i32 @CANRegWrite(i64 %14, i64 %20)
ret void
}

LLVM IR (-O2):
define void @CANIntDisable(i64 %0, i64 %1) {
%3 = tail call i32 @CANBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = and i64 %1, -15
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = tail call i64 @CANRegRead(i64 %0)
%10 = xor i64 %1, -1
%11 = and i64 %9, %10
%12 = tail call i32 @CANRegWrite(i64 %0, i64 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *,
                           char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void die_with_std_error(const char *message, int errnum) {
  char *cause = strerror(errnum);
  fprintf(stderr, "%s%s\ncause: %s", "DiSL-agent error: ", message, cause);
  exit(10002);
}


x86 assembly (clang, -O0):
<die_with_std_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <strerror@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe9d(%rip),%rsi
lea    0xea5(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x2712,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die_with_std_error>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1050 <strerror@plt>
mov    0x2e9e(%rip),%rcx
mov    (%rcx),%edi
lea    0xeb5(%rip),%rsi
lea    0xebd(%rip),%rdx
mov    %rbx,%rcx
mov    %rax,%r8
call   1030 <fprintf@plt>
mov    $0x2712,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"%s%s\0Acause: %s\00"
@.str.1 = [19 x i8] c"DiSL-agent error: \00"
define void @die_with_std_error(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 i32, i32* %4
%7 = call i8* @strerror(i32 %6)
store i8* %7, i8** %5
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = load i8*, i8** %5
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* %10)
%12 = call i32 @exit(i32 10002)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"%s%s\0Acause: %s\00"
@.str.1 = [19 x i8] c"DiSL-agent error: \00"
define void @die_with_std_error(i8* %0, i32 %1) {
%3 = tail call i8* @strerror(i32 %1)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %3)
%6 = tail call i32 @exit(i32 10002)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int input;
  while (1) {
    scanf("%d", &input);
    if (input != 42)
      printf("%d\n", input);
    else
      break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2a,-0x8(%rbp)
je     115d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    1162 <main+0x42>
jmp    1167 <main+0x47>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x2a,%esi
je     117c <main+0x5c>
lea    0xeb9(%rip),%r14
lea    0xeaf(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x2a,%esi
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\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 = icmp eq i32 %4, 42
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 42
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XRegisterIMInstantiateCallback() {
  printf("XRegisterIMInstantiateCallback called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [38 x i8] c"XRegisterIMInstantiateCallback called\00"
define i32 @XRegisterIMInstantiateCallback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ console_tx_hex16(unsigned short);
void print_info_hex16(unsigned short value) { console_tx_hex16(value); }


x86 assembly (clang, -O0):
<print_info_hex16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <console_tx_hex16@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @print_info_hex16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @console_tx_hex16(i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_info_hex16(i16 zeroext %0) {
%2 = tail call i32 @console_tx_hex16(i16 zeroext %0)
ret void
}
/* Variables and functions */
int A(int);
int /*<<< orphan*/ printf(char *);
int B(int depth) {
  int a;
  ;
  depth++;
  printf("B ");
  ;
  if (depth == 100) {
    ;
    return 1;
  } else {
    a = A(depth);
  };
  return a + 1;
}


x86 assembly (clang, -O0):
<B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x64,-0x8(%rbp)
jne    1156 <B+0x36>
movl   $0x1,-0x4(%rbp)
jmp    116a <B+0x4a>
mov    -0x8(%rbp),%edi
call   1040 <A@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<B>:
push   %rbx
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
cmp    $0x64,%ebx
je     1146 <B+0x26>
mov    %ebx,%edi
call   1040 <A@plt>
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"B \00"
define i32 @B(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 100
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %17
11: ; preds = %1
%12 = load i32, i32* %3
%13 = call i32 @A(i32 %12)
store i32 %13, i32* %4
br label %14
14: ; preds = %11
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"B \00"
define i32 @B(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %2, 100
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @A(i32 %2)
%7 = add nsw i32 %6, 1
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ 1, %1 ]
ret i32 %9
}