xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ die(char *, int);
int read(int, long *, int);
int readl(int fd, long *dest) {
  int r = read(fd, dest, sizeof(long));
  if (r != sizeof(long) && r)
    die("Couldn't read long (Got %d)\n", r);
  return r;
}


x86 assembly (clang, -O0):
<readl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x8,%rax
je     116a <readl+0x4a>
cmpl   $0x0,-0x14(%rbp)
je     116a <readl+0x4a>
mov    -0x14(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1040 <die@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readl>:
push   %rbx
mov    $0x8,%edx
call   1030 <read@plt>
mov    %eax,%ebx
test   $0xfffffff7,%eax
je     1142 <readl+0x22>
lea    0xec5(%rip),%rdi
mov    %ebx,%esi
call   1040 <die@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Couldn't read long (Got %d)\0A\00"
define i32 @readl(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i32, i32* %3
%7 = load i64*, i64** %4
%8 = call i32 @read(i32 %6, i64* %7, i32 8)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = icmp ne i64 %10, 8
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %5
%17 = call i32 @die(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %15, %12, %2
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
@.str = [29 x i8] c"Couldn't read long (Got %d)\0A\00"
define i32 @readl(i32 %0, i64* nocapture %1) {
%3 = tail call i32 @read(i32 %0, i64* %1, i32 8)
%4 = and i32 %3, -9
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @die(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %8
8: ; preds = %6, %2
ret i32 %3
}
void lgtd_lifx_gateway_handle_bulb_label(
    struct lgtd_lifx_gateway *gw, const struct lgtd_lifx_packet_header *hdr,
    const struct lgtd_lifx_packet_label *pkt) {
  (void)gw;
  (void)hdr;
  (void)pkt;
}


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

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

LLVM IR (-O0):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
%struct.lgtd_lifx_packet_label = type opaque
define void @lgtd_lifx_gateway_handle_bulb_label(%struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_label* %2) {
%4 = alloca %struct.lgtd_lifx_gateway*
%5 = alloca %struct.lgtd_lifx_packet_header*
%6 = alloca %struct.lgtd_lifx_packet_label*
store %struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_gateway** %4
store %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_header** %5
store %struct.lgtd_lifx_packet_label* %2, %struct.lgtd_lifx_packet_label** %6
%7 = load %struct.lgtd_lifx_gateway*, %struct.lgtd_lifx_gateway** %4
%8 = load %struct.lgtd_lifx_packet_header*, %struct.lgtd_lifx_packet_header** %5
%9 = load %struct.lgtd_lifx_packet_label*, %struct.lgtd_lifx_packet_label** %6
ret void
}

LLVM IR (-O2):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
%struct.lgtd_lifx_packet_label = type opaque
define void @lgtd_lifx_gateway_handle_bulb_label(%struct.lgtd_lifx_gateway* nocapture %0, %struct.lgtd_lifx_packet_header* nocapture %1, %struct.lgtd_lifx_packet_label* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xfree(char *);
void free_mtnstatus_debuginfo(char *buff) { xfree(buff); }


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

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

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

LLVM IR (-O2):
define void @free_mtnstatus_debuginfo(i8* %0) {
%2 = tail call i32 @xfree(i8* %0)
ret void
}
unsigned long elf_hash(const unsigned char *name) {
  unsigned long h = 0, g;
  while (*name) {
    h = (h << 4) + *name++;
    if ((g = h & 0xf0000000))
      h ^= g >> 24;
    h &= ~g;
  }
  return h;
}


x86 assembly (clang, -O0):
<elf_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     117f <elf_hash+0x7f>
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movabs $0xf0000000,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     116a <elf_hash+0x6a>
mov    -0x18(%rbp),%rax
shr    $0x18,%rax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <elf_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113d <elf_hash+0x3d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x4,%rax
movzbl %cl,%ecx
add    %rax,%rcx
mov    %ecx,%eax
and    $0xf0000000,%eax
mov    %rax,%rdx
shr    $0x18,%rdx
xor    %rcx,%rdx
not    %rax
and    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <elf_hash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @elf_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %5
5: ; preds = %25, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %30
9: ; preds = %5
%10 = load i64, i64* %3
%11 = shl i64 %10, 4
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = load i8, i8* %12
%15 = zext i8 %14 to i64
%16 = add i64 %11, %15
store i64 %16, i64* %3
%17 = load i64, i64* %3
%18 = and i64 %17, 4026531840
store i64 %18, i64* %4
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %9
%21 = load i64, i64* %4
%22 = lshr i64 %21, 24
%23 = load i64, i64* %3
%24 = xor i64 %23, %22
store i64 %24, i64* %3
br label %25
25: ; preds = %20, %9
%26 = load i64, i64* %4
%27 = xor i64 %26, -1
%28 = load i64, i64* %3
%29 = and i64 %28, %27
store i64 %29, i64* %3
br label %5
30: ; preds = %5
%31 = load i64, i64* %3
ret i64 %31
}

LLVM IR (-O2):
define i64 @elf_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %17, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %16, %4 ], [ 0, %1 ]
%8 = shl i64 %7, 4
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = zext i8 %5 to i64
%11 = add i64 %8, %10
%12 = and i64 %11, 4026531840
%13 = lshr exact i64 %12, 24
%14 = xor i64 %13, %11
%15 = xor i64 %12, -1
%16 = and i64 %14, %15
%17 = load i8, i8* %9
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %4
19: ; preds = %4, %1
%20 = phi i64 [ 0, %1 ], [ %16, %4 ]
ret i64 %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void cubeByReference(int *iptr) {
  *iptr = (*iptr) * (*iptr) * (*iptr);
  printf("input cubed is %d\n", *iptr);
}


x86 assembly (clang, -O0):
<cubeByReference>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
imul   (%rax),%ecx
mov    -0x8(%rbp),%rax
imul   (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubeByReference>:
mov    (%rdi),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
mov    %esi,(%rdi)
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"input cubed is %d\0A\00"
define void @cubeByReference(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = mul nsw i32 %4, %6
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = mul nsw i32 %7, %9
%11 = load i32*, i32** %2
store i32 %10, i32* %11
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"input cubed is %d\0A\00"
define void @cubeByReference(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, %2
%4 = mul nsw i32 %3, %2
store i32 %4, i32* %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
#define EINVAL 129
#define ENOMEM 128
int posix_memalign(void **, size_t, size_t);
void *memalign(size_t alignment, size_t size) {
  void *ptr;
  switch (posix_memalign(&ptr, alignment, size)) {
  case EINVAL:
  case ENOMEM:
    return NULL;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<memalign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
call   1030 <posix_memalign@plt>
add    $0xffffff80,%eax
sub    $0x1,%eax
ja     114f <memalign+0x3f>
jmp    1142 <memalign+0x32>
movq   $0x0,-0x8(%rbp)
jmp    1157 <memalign+0x47>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memalign>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <posix_memalign@plt>
and    $0xfffffffe,%eax
cmp    $0x80,%eax
je     112f <memalign+0x1f>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @memalign(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = call i32 @posix_memalign(i8** %6, i64 %7, i64 %8)
switch i32 %9, label %11 [
i32 129, label %10
i32 128, label %10
]
10: ; preds = %2, %2
store i8* null, i8** %3
br label %13
11: ; preds = %2
%12 = load i8*, i8** %6
store i8* %12, i8** %3
br label %13
13: ; preds = %11, %10
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @memalign(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @posix_memalign(i8** %3, i64 %0, i64 %1)
%6 = and i32 %5, -2
%7 = icmp eq i32 %6, 128
%8 = load i8*, i8** %3
%9 = select i1 %7, i8* null, i8* %8
ret i8* %9
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double ProgIter_now_wall() {
  struct timeval time;
  if (gettimeofday(&time, NULL)) {
    return 0;
  }
  return (double)time.tv_sec + (double)time.tv_usec * .000001;
}


x86 assembly (clang, -O0):
<ProgIter_now_wall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     113c <ProgIter_now_wall+0x2c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115d <ProgIter_now_wall+0x4d>
cvtsi2sdq -0x10(%rbp),%xmm1
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProgIter_now_wall>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
je     112d <ProgIter_now_wall+0x1d>
xorps  %xmm0,%xmm0
add    $0x18,%rsp
ret
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xebd(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @ProgIter_now_wall() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store double 0.000000e+00, double* %1
br label %14
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = call double @llvm.fmuladd.f64(double %12, double 0x3EB0C6F7A0B5ED8D, double %9)
store double %13, double* %1
br label %14
14: ; preds = %6, %5
%15 = load double, double* %1
ret double %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @ProgIter_now_wall() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %8)
br label %13
13: ; preds = %0, %5
%14 = phi double [ %12, %5 ], [ 0.000000e+00, %0 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ putchar_unlocked(char);
void printSpace() { putchar_unlocked(' '); }


x86 assembly (clang, -O0):
<printSpace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1030 <putchar_unlocked@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSpace>:
mov    $0x20,%edi
jmp    1030 <putchar_unlocked@plt>

LLVM IR (-O0):
define void @printSpace() {
%1 = call i32 @putchar_unlocked(i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @printSpace() {
%1 = tail call i32 @putchar_unlocked(i8 signext 32)
ret void
}
linewidth_(n) int *n;
{ linewidth(*n); }


x86 assembly (clang, -O0):
<linewidth_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <linewidth@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linewidth_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <linewidth@plt>

LLVM IR (-O0):
define i32 @linewidth_(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = call i32 (i32, ...) bitcast (i32 (...)* @linewidth to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @linewidth_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @linewidth to i32 (i32, ...)*)(i32 %2)
ret i32 undef
}
void bit_swap(int *x, int *y) {
  *y = *x ^ *y;
  *x = *x ^ *y;
  *y = *x ^ *y;
}


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

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

LLVM IR (-O0):
define void @bit_swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = xor i32 %6, %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = xor i32 %12, %14
%16 = load i32*, i32** %3
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = xor i32 %18, %20
%22 = load i32*, i32** %4
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @bit_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = xor i32 %4, %3
store i32 %5, i32* %1
%6 = load i32, i32* %0
%7 = xor i32 %6, %5
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = xor i32 %8, %7
store i32 %9, i32* %1
ret void
}
int test_imm_58int16_mem(short *val) {
  return ((*val) & (0x58 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_58int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 88
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int fd;
};
struct epoll_event {
  int events;
  TYPE_1__ data;
};

/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_ADD;
int epoll_ctl(int, int /*<<< orphan*/, int, struct epoll_event *);
int add_event(int epoll_fd, int flags, int socket_fd) {
  struct epoll_event event;
  event.data.fd = socket_fd;
  event.events = flags;
  return epoll_ctl(epoll_fd, EPOLL_CTL_ADD, socket_fd, &event);
}


x86 assembly (clang, -O0):
<add_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
lea    -0x18(%rbp),%rcx
call   1030 <epoll_ctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_event>:
push   %rax
mov    %edx,0x4(%rsp)
mov    %esi,(%rsp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rcx
call   1030 <epoll_ctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.epoll_event = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@EPOLL_CTL_ADD = global i32 0
define i32 @add_event(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.epoll_event
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %7, i32 0, i32 1
%10 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %9, i32 0, i32 0
store i32 %8, i32* %10
%11 = load i32, i32* %5
%12 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %7, i32 0, i32 0
store i32 %11, i32* %12
%13 = load i32, i32* %4
%14 = load i32, i32* @EPOLL_CTL_ADD
%15 = load i32, i32* %6
%16 = call i32 @epoll_ctl(i32 %13, i32 %14, i32 %15, %struct.epoll_event* %7)
ret i32 %16
}

LLVM IR (-O2):
%struct.epoll_event = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@EPOLL_CTL_ADD = global i32 0
define i32 @add_event(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.epoll_event
%5 = bitcast %struct.epoll_event* %4 to i8*
%6 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %4, i64 0, i32 1, i32 0
store i32 %2, i32* %6
%7 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %4, i64 0, i32 0
store i32 %1, i32* %7
%8 = load i32, i32* @EPOLL_CTL_ADD
%9 = call i32 @epoll_ctl(i32 %0, i32 %8, i32 %2, %struct.epoll_event* %4)
ret i32 %9
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};
struct _Locale_monetary {
  int dummy;
};

/* Variables and functions */
struct _Locale_name_hint *
_Locale_get_monetary_hint(struct _Locale_monetary *monetary) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_name_hint = type { i32 }
%struct._Locale_monetary = type { i32 }
define %struct._Locale_name_hint* @_Locale_get_monetary_hint(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
ret %struct._Locale_name_hint* null
}

LLVM IR (-O2):
%struct._Locale_name_hint = type { i32 }
%struct._Locale_monetary = type { i32 }
define noalias %struct._Locale_name_hint* @_Locale_get_monetary_hint(%struct._Locale_monetary* nocapture readnone %0) {
ret %struct._Locale_name_hint* null
}
double todegrees(double x) { return x * (180.0 / 3.14159265358979323846); }


x86 assembly (clang, -O0):
<todegrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<todegrees>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @todegrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x404CA5DC1A63C1F8
ret double %4
}

LLVM IR (-O2):
define double @todegrees(double %0) {
%2 = fmul double %0, 0x404CA5DC1A63C1F8
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct udphdr {
  int /*<<< orphan*/ dest;
};

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t _udphdr_dest_ntohs(struct udphdr *h) { return ntohs(h->dest); }


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

x86 assembly (clang, -O2):
<_udphdr_dest_ntohs>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
%struct.udphdr = type { i32 }
define i32 @_udphdr_dest_ntohs(%struct.udphdr* %0) {
%2 = alloca %struct.udphdr*
store %struct.udphdr* %0, %struct.udphdr** %2
%3 = load %struct.udphdr*, %struct.udphdr** %2
%4 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.udphdr = type { i32 }
define i32 @_udphdr_dest_ntohs(%struct.udphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printSpace(int n) {
  int i;
  for (i = 0; i < n; i++)
    printf(" ");
}


x86 assembly (clang, -O0):
<printSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <printSpace+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printSpace+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSpace>:
push   %rbx
test   %edi,%edi
jle    112f <printSpace+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printSpace+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printSpace(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int getNumOfChar(char **, char, int);
int getNumOfCharacter(char **address, int size) {
  return getNumOfChar(address, 'c', size);
}


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

x86 assembly (clang, -O2):
<getNumOfCharacter>:
mov    %esi,%edx
mov    $0x63,%esi
jmp    1030 <getNumOfChar@plt>

LLVM IR (-O0):
define i32 @getNumOfCharacter(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i8**, i8*** %3
%6 = load i32, i32* %4
%7 = call i32 @getNumOfChar(i8** %5, i8 signext 99, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @getNumOfCharacter(i8** %0, i32 %1) {
%3 = tail call i32 @getNumOfChar(i8** %0, i8 signext 99, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(size_t);
double *SplineAllocate(size_t n) {
  double *pu;
  if ((pu = (double *)malloc((n - 1) * sizeof(double))) == NULL)
    return 0;
  return pu;
}


x86 assembly (clang, -O0):
<SplineAllocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1148 <SplineAllocate+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1150 <SplineAllocate+0x40>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SplineAllocate>:
lea    -0x8(,%rdi,8),%rdi
ff
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define double* @SplineAllocate(i64 %0) {
%2 = alloca double*
%3 = alloca i64
%4 = alloca double*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = sub i64 %5, 1
%7 = mul i64 %6, 8
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to double*
store double* %9, double** %4
%10 = icmp eq double* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store double* null, double** %2
br label %14
12: ; preds = %1
%13 = load double*, double** %4
store double* %13, double** %2
br label %14
14: ; preds = %12, %11
%15 = load double*, double** %2
ret double* %15
}

LLVM IR (-O2):
define double* @SplineAllocate(i64 %0) {
%2 = shl i64 %0, 3
%3 = add i64 %2, -8
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to double*
ret double* %5
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int anonasc;
  int anoatual = 2013;
  printf("digite o ano em que você nasceu: ");
  scanf("%d", &anonasc);
  int idade = anoatual - anonasc;
  printf("Você tem %d anos", idade);
  getch();
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"digite o ano em que voc\C3\AA nasceu: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Voc\C3\AA tem %d anos\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 2013, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"digite o ano em que voc\C3\AA nasceu: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Voc\C3\AA tem %d anos\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sub nsw i32 2013, %5
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @getch()
ret i32 0
}
float fastsin(float x) {
  asm("fsin" : "+t"(x));
  return x;
}


x86 assembly (clang, -O0):
<fastsin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
flds   -0x8(%rbp)
fsin
fstps  -0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastsin>:
movss  %xmm0,-0x4(%rsp)
flds   -0x4(%rsp)
fsin
fstps  -0x8(%rsp)
movss  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @fastsin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float asm "fsin", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %3)
store float %4, float* %2
%5 = load float, float* %2
ret float %5
}

LLVM IR (-O2):
define float @fastsin(float %0) {
%2 = tail call float asm "fsin", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void INC_HOST_REG_W(int host_reg) {
  addbyte(0x66);
  addbyte(0x40 | host_reg);
}


x86 assembly (clang, -O0):
<INC_HOST_REG_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0x40,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INC_HOST_REG_W>:
push   %rbx
mov    %edi,%ebx
mov    $0x66,%edi
call   1030 <addbyte@plt>
or     $0x40,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @INC_HOST_REG_W(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @addbyte(i32 102)
%4 = load i32, i32* %2
%5 = or i32 64, %4
%6 = call i32 @addbyte(i32 %5)
ret void
}

LLVM IR (-O2):
define void @INC_HOST_REG_W(i32 %0) {
%2 = tail call i32 @addbyte(i32 102)
%3 = or i32 %0, 64
%4 = tail call i32 @addbyte(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int scanf(char *, int *, int *);
int /*<<< orphan*/ solve(int, int);
int main() {
  int a = 0, b = 0, res = 0;
  res = scanf("%d %d", &a, &b);
  printf("%llu", solve(a, b));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [5 x i8] c"%llu\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @solve(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: ./StudentAverage [OPTION] [INPUT]\n"
         "\n"
         "\tOPTION: -v --- Show version.\n"
         "\t\t-d --- Show Author name and sirname.\n"
         "\t\t-s --- Calculate students average grade.\n"
         "\tINPUT: Only accept when you use [-s] option.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [201 x i8] c"Usage: ./StudentAverage [OPTION] [INPUT]\0A\0A\09OPTION: -v --- Show version.\0A\09\09-d --- Show Author name and sirname.\0A\09\09-s --- Calculate students average grade.\0A\09INPUT: Only accept when you use [-s] option.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [200 x i8] c"Usage: ./StudentAverage [OPTION] [INPUT]\0A\0A\09OPTION: -v --- Show version.\0A\09\09-d --- Show Author name and sirname.\0A\09\09-s --- Calculate students average grade.\0A\09INPUT: Only accept when you use [-s] option.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([200 x i8], [200 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ thr0(int /*<<< orphan*/);
int /*<<< orphan*/ thr1(int /*<<< orphan*/);
int /*<<< orphan*/ thr2(int /*<<< orphan*/);
int /*<<< orphan*/ thr3(int /*<<< orphan*/);
int /*<<< orphan*/ thr4(int /*<<< orphan*/);
int /*<<< orphan*/ thr5(int /*<<< orphan*/);
int /*<<< orphan*/ thr6(int /*<<< orphan*/);
int main() {
__CPROVER_ASYNC_0:
  thr0(0);
__CPROVER_ASYNC_1:
  thr1(0);
__CPROVER_ASYNC_2:
  thr2(0);
__CPROVER_ASYNC_3:
  thr3(0);
__CPROVER_ASYNC_4:
  thr4(0);
__CPROVER_ASYNC_5:
  thr5(0);
__CPROVER_ASYNC_6:
  thr6(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1070 <thr0@plt>
xor    %edi,%edi
call   1030 <thr1@plt>
xor    %edi,%edi
call   1050 <thr2@plt>
xor    %edi,%edi
call   1090 <thr3@plt>
xor    %edi,%edi
call   1040 <thr4@plt>
xor    %edi,%edi
call   1080 <thr5@plt>
xor    %edi,%edi
call   1060 <thr6@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1070 <thr0@plt>
xor    %edi,%edi
call   1030 <thr1@plt>
xor    %edi,%edi
call   1050 <thr2@plt>
xor    %edi,%edi
call   1090 <thr3@plt>
xor    %edi,%edi
call   1040 <thr4@plt>
xor    %edi,%edi
call   1080 <thr5@plt>
xor    %edi,%edi
call   1060 <thr6@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 @thr0(i32 0)
br label %4
4: ; preds = %2
%5 = call i32 @thr1(i32 0)
br label %6
6: ; preds = %4
%7 = call i32 @thr2(i32 0)
br label %8
8: ; preds = %6
%9 = call i32 @thr3(i32 0)
br label %10
10: ; preds = %8
%11 = call i32 @thr4(i32 0)
br label %12
12: ; preds = %10
%13 = call i32 @thr5(i32 0)
br label %14
14: ; preds = %12
%15 = call i32 @thr6(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @thr0(i32 0)
%2 = tail call i32 @thr1(i32 0)
%3 = tail call i32 @thr2(i32 0)
%4 = tail call i32 @thr3(i32 0)
%5 = tail call i32 @thr4(i32 0)
%6 = tail call i32 @thr5(i32 0)
%7 = tail call i32 @thr6(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: print-pchk [ -d ] [ -t ] pchk-file\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: print-pchk [ -d ] [ -t ] pchk-file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: print-pchk [ -d ] [ -t ] pchk-file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void ssb_extif_timing_init(struct ssb_extif *extif, unsigned long ns) {}


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

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

LLVM IR (-O0):
%struct.ssb_extif = type opaque
define void @ssb_extif_timing_init(%struct.ssb_extif* %0, i64 %1) {
%3 = alloca %struct.ssb_extif*
%4 = alloca i64
store %struct.ssb_extif* %0, %struct.ssb_extif** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
%struct.ssb_extif = type opaque
define void @ssb_extif_timing_init(%struct.ssb_extif* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ffpmsg(char *);
int uncompress2file(char *filename, FILE *indiskfile, FILE *outdiskfile,
                    int *status) {
  if (*status > 0)
    return (*status);
  ffpmsg("This non-GNU version of CFITSIO does not support compressed files");
  return (*status = 414);
}


x86 assembly (clang, -O0):
<uncompress2file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1143 <uncompress2file+0x33>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <uncompress2file+0x50>
lea    0xeb6(%rip),%rdi
call   1030 <ffpmsg@plt>
mov    -0x28(%rbp),%rax
movl   $0x19e,(%rax)
movl   $0x19e,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncompress2file>:
push   %rbx
mov    (%rcx),%eax
test   %eax,%eax
jle    1119 <uncompress2file+0x9>
pop    %rbx
ret
mov    %rcx,%rbx
lea    0xedd(%rip),%rdi
call   1030 <ffpmsg@plt>
movl   $0x19e,(%rbx)
mov    $0x19e,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [66 x i8] c"This non-GNU version of CFITSIO does not support compressed files\00"
define i32 @uncompress2file(i8* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
%10 = load i32*, i32** %9
%11 = load i32, i32* %10
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %4
%14 = load i32*, i32** %9
%15 = load i32, i32* %14
store i32 %15, i32* %5
br label %19
16: ; preds = %4
%17 = call i32 @ffpmsg(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%18 = load i32*, i32** %9
store i32 414, i32* %18
store i32 414, i32* %5
br label %19
19: ; preds = %16, %13
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@.str = [66 x i8] c"This non-GNU version of CFITSIO does not support compressed files\00"
define i32 @uncompress2file(i8* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @ffpmsg(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
store i32 414, i32* %3
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ 414, %7 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(long, int /*<<< orphan*/ *);
void putlong(long val, FILE *f) {
  putc((val >> 24) & 0xff, f);
  putc((val >> 16) & 0xff, f);
  putc((val >> 8) & 0xff, f);
  putc(val & 0xff, f);
}


x86 assembly (clang, -O0):
<putlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
sar    $0x18,%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rdi
sar    $0x10,%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rdi
sar    $0x8,%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putlong>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
shr    $0x18,%edi
call   1030 <putc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
movzbl %bl,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @putlong(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = ashr i64 %5, 24
%7 = and i64 %6, 255
%8 = load i32*, i32** %4
%9 = call i32 @putc(i64 %7, i32* %8)
%10 = load i64, i64* %3
%11 = ashr i64 %10, 16
%12 = and i64 %11, 255
%13 = load i32*, i32** %4
%14 = call i32 @putc(i64 %12, i32* %13)
%15 = load i64, i64* %3
%16 = ashr i64 %15, 8
%17 = and i64 %16, 255
%18 = load i32*, i32** %4
%19 = call i32 @putc(i64 %17, i32* %18)
%20 = load i64, i64* %3
%21 = and i64 %20, 255
%22 = load i32*, i32** %4
%23 = call i32 @putc(i64 %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @putlong(i64 %0, i32* nocapture %1) {
%3 = lshr i64 %0, 24
%4 = and i64 %3, 255
%5 = tail call i32 @putc(i64 %4, i32* %1)
%6 = lshr i64 %0, 16
%7 = and i64 %6, 255
%8 = tail call i32 @putc(i64 %7, i32* %1)
%9 = lshr i64 %0, 8
%10 = and i64 %9, 255
%11 = tail call i32 @putc(i64 %10, i32* %1)
%12 = and i64 %0, 255
%13 = tail call i32 @putc(i64 %12, i32* %1)
ret void
}
signed long long signedlonglong_ignoring_signedshortint(signed long long x,
                                                        signed short int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedlonglong_ignoring_signedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @signedlonglong_ignoring_signedshortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglong_ignoring_signedshortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
int kbhit(void) { return (*(volatile unsigned int *)(0x20000020)) & 0x01; }


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

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

LLVM IR (-O0):
define i32 @kbhit() {
%1 = load volatile i32, i32* inttoptr (i64 536870944 to i32*)
%2 = and i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @kbhit() {
%1 = load volatile i32, i32* inttoptr (i64 536870944 to i32*)
%2 = and i32 %1, 1
ret i32 %2
}
int test_imm_8Duint8_mem(unsigned char *val) {
  return ((*val) & (-0x8D << 0)) ? -20 : -40;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @nfs4_state_start() {
ret void
}
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int, int);
void logPID() { printf("PID: %d - PPID: %d\n", getpid(), getppid()); }


x86 assembly (clang, -O0):
<logPID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getppid@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logPID>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"PID: %d - PPID: %d\0A\00"
define void @logPID() {
%1 = call i32 (...) @getpid()
%2 = call i32 (...) @getppid()
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"PID: %d - PPID: %d\0A\00"
define void @logPID() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (...) @getppid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}