xunge/DecIR huggingface dataset:
unsigned int extract_opcode(short insn) {
  unsigned int tmp;
  tmp = 0x0000f000ul & (int)insn;
  tmp >>= 12;
  if (tmp > 3)
    return tmp;
  if (tmp == 3 || tmp == 2)
    return ((unsigned int)insn >> 8) & ~3;
  return ((unsigned int)insn >> 4) & ~5;
}


x86 assembly (clang, -O0):
<extract_opcode>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
cltq
and    $0xf000,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0xc,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jbe    1138 <extract_opcode+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <extract_opcode+0x6b>
cmpl   $0x3,-0xc(%rbp)
je     114c <extract_opcode+0x4c>
cmpl   $0x2,-0xc(%rbp)
jne    115e <extract_opcode+0x5e>
movswl -0x6(%rbp),%eax
shr    $0x8,%eax
and    $0xfffffffc,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <extract_opcode+0x6b>
movswl -0x6(%rbp),%eax
shr    $0x4,%eax
and    $0xfffffffa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_opcode>:
movzwl %di,%eax
cmp    $0x4000,%eax
jb     110e <extract_opcode+0xe>
shr    $0xc,%eax
ret
mov    %edi,%eax
and    $0xe000,%eax
cmp    $0x2000,%eax
jne    1125 <extract_opcode+0x25>
shr    $0x8,%edi
and    $0xfffffffc,%edi
mov    %edi,%eax
ret
shr    $0x4,%edi
and    $0xfffffffa,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @extract_opcode(i16 signext %0) {
%2 = alloca i32
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = sext i32 %6 to i64
%8 = and i64 61440, %7
%9 = trunc i64 %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = lshr i32 %10, 12
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp ugt i32 %12, 3
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %32
16: ; preds = %1
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 3
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 2
br i1 %21, label %22, label %27
22: ; preds = %19, %16
%23 = load i16, i16* %3
%24 = sext i16 %23 to i32
%25 = lshr i32 %24, 8
%26 = and i32 %25, -4
store i32 %26, i32* %2
br label %32
27: ; preds = %19
%28 = load i16, i16* %3
%29 = sext i16 %28 to i32
%30 = lshr i32 %29, 4
%31 = and i32 %30, -6
store i32 %31, i32* %2
br label %32
32: ; preds = %27, %22, %14
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @extract_opcode(i16 signext %0) {
%2 = sext i16 %0 to i32
%3 = icmp ugt i16 %0, 16383
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = lshr i16 %0, 12
%6 = zext i16 %5 to i32
br label %16
7: ; preds = %1
%8 = and i16 %0, -8192
%9 = icmp eq i16 %8, 8192
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = lshr i32 %2, 8
%12 = and i32 %11, 16777212
br label %16
13: ; preds = %7
%14 = lshr i32 %2, 4
%15 = and i32 %14, 268435450
br label %16
16: ; preds = %13, %10, %4
%17 = phi i32 [ %6, %4 ], [ %12, %10 ], [ %15, %13 ]
ret i32 %17
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *alloc_string(const char *data, int len) {
  char *ret = malloc(len + 1);
  if (ret) {
    memcpy(ret, data, len);
    ret[len] = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<alloc_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1165 <alloc_string+0x45>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@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):
<alloc_string>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
lea    0x1(%r14),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1151 <alloc_string+0x31>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <memcpy@plt>
movslq %r14d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @alloc_string(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 = add nsw i32 %6, 1
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %20
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @memcpy(i8* %12, i8* %13, i32 %14)
%16 = load i8*, i8** %5
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 0, i8* %19
br label %20
20: ; preds = %11, %2
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @alloc_string(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %6, %2
ret i8* %4
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __dorand48(struct _reent *, unsigned short *);
long _nrand48_r(struct _reent *r, unsigned short xseed[3]) {
  __dorand48(r, xseed);
  return (long)((unsigned long)xseed[2] << 15) + ((unsigned long)xseed[1] >> 1);
}


x86 assembly (clang, -O0):
<_nrand48_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__dorand48@plt>
mov    -0x10(%rbp),%rax
movzwl 0x4(%rax),%eax
shl    $0xf,%rax
mov    -0x10(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
shr    $0x1,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nrand48_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <__dorand48@plt>
movzwl 0x4(%rbx),%ecx
shl    $0xf,%rcx
movzwl 0x2(%rbx),%eax
shr    %rax
or     %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct._reent = type { i32 }
define i64 @_nrand48_r(%struct._reent* %0, i16* %1) {
%3 = alloca %struct._reent*
%4 = alloca i16*
store %struct._reent* %0, %struct._reent** %3
store i16* %1, i16** %4
%5 = load %struct._reent*, %struct._reent** %3
%6 = load i16*, i16** %4
%7 = call i32 @__dorand48(%struct._reent* %5, i16* %6)
%8 = load i16*, i16** %4
%9 = getelementptr inbounds i16, i16* %8, i64 2
%10 = load i16, i16* %9
%11 = zext i16 %10 to i64
%12 = shl i64 %11, 15
%13 = load i16*, i16** %4
%14 = getelementptr inbounds i16, i16* %13, i64 1
%15 = load i16, i16* %14
%16 = zext i16 %15 to i64
%17 = lshr i64 %16, 1
%18 = add i64 %12, %17
ret i64 %18
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i64 @_nrand48_r(%struct._reent* %0, i16* %1) {
%3 = tail call i32 @__dorand48(%struct._reent* %0, i16* %1)
%4 = getelementptr inbounds i16, i16* %1, i64 2
%5 = load i16, i16* %4
%6 = zext i16 %5 to i64
%7 = shl nuw nsw i64 %6, 15
%8 = getelementptr inbounds i16, i16* %1, i64 1
%9 = load i16, i16* %8
%10 = lshr i16 %9, 1
%11 = zext i16 %10 to i64
%12 = or i64 %7, %11
ret i64 %12
}
/* Variables and functions */
void *calloc(int, size_t);
void *mm_malloc0(size_t size) { return calloc(1, size); }


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

x86 assembly (clang, -O2):
<mm_malloc0>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @mm_malloc0(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ comprintf(char *, char const *, char const *);
void gen_readlong(const char *address, const char *dest) {
  comprintf("\treadlong(%s,%s,scratchie);\n", address, dest);
}


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

x86 assembly (clang, -O2):
<gen_readlong>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <comprintf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\09readlong(%s,%s,scratchie);\0A\00"
define void @gen_readlong(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @comprintf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"\09readlong(%s,%s,scratchie);\0A\00"
define void @gen_readlong(i8* %0, i8* %1) {
%3 = tail call i32 @comprintf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
AX0RX1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (((char *)10000000)[x0]) = (p1[x1]); }


x86 assembly (clang, -O0):
<AX0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0RX1>:
movslq %ecx,%rax
mov    (%r9,%rax,1),%al
movslq %edx,%rcx
mov    %al,0x989680(%rcx)
ret

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

LLVM IR (-O2):
define i32 @AX0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %10
store i8 %9, i8* %11
ret i32 undef
}
void RTLockValidatorWriteLockGetCount(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorWriteLockGetCount() {
ret void
}
double atan(arg)
double arg;
{
  if (arg > 0)
    return (satan(arg));
  else
    return (-satan(-arg));
}


x86 assembly (clang, -O0):
<atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1149 <atan+0x39>
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <satan@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117b <atan+0x6b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    $0x1,%al
call   1030 <satan@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1124 <atan+0x14>
mov    $0x1,%al
call   1030 <satan@plt>
jmp    1135 <atan+0x25>
xorpd  0xed4(%rip),%xmm0
mov    $0x1,%al
call   1030 <satan@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @atan(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = call i32 (double, ...) bitcast (i32 (...)* @satan to i32 (double, ...)*)(double %7)
%9 = sitofp i32 %8 to double
store double %9, double* %2
br label %16
10: ; preds = %1
%11 = load double, double* %3
%12 = fneg double %11
%13 = call i32 (double, ...) bitcast (i32 (...)* @satan to i32 (double, ...)*)(double %12)
%14 = sub nsw i32 0, %13
%15 = sitofp i32 %14 to double
store double %15, double* %2
br label %16
16: ; preds = %10, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @atan(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @satan to i32 (double, ...)*)(double %0)
br label %9
5: ; preds = %1
%6 = fneg double %0
%7 = tail call i32 (double, ...) bitcast (i32 (...)* @satan to i32 (double, ...)*)(double %6)
%8 = sub nsw i32 0, %7
br label %9
9: ; preds = %5, %3
%10 = phi i32 [ %4, %3 ], [ %8, %5 ]
%11 = sitofp i32 %10 to double
ret double %11
}
void abort_demanded_output() {}


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

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

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

LLVM IR (-O2):
define void @abort_demanded_output() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ grava_li(int, char *);
void rot27_sem() { grava_li(1, "$RETURN"); }


x86 assembly (clang, -O0):
<rot27_sem>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <grava_li@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot27_sem>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <grava_li@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"$RETURN\00"
define void @rot27_sem() {
%1 = call i32 @grava_li(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"$RETURN\00"
define void @rot27_sem() {
%1 = tail call i32 @grava_li(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int I2CSystemStatusGet(unsigned int baseAdd) {
  return ((*((volatile unsigned int *)(baseAdd + (0x90)))) & (0x00000001u));
}


x86 assembly (clang, -O0):
<I2CSystemStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSystemStatusGet>:
add    $0x90,%edi
mov    (%rdi),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @I2CSystemStatusGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 144
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @I2CSystemStatusGet(i32 %0) {
%2 = add i32 %0, 144
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 1
ret i32 %6
}
long v_long_func() { return (0); }


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

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

LLVM IR (-O0):
define i64 @v_long_func() {
ret i64 0
}

LLVM IR (-O2):
define i64 @v_long_func() {
ret i64 0
}
/* Type definitions */
struct lba_info {
  int dummy;
};

/* Variables and functions */
int write_lba_attribute(struct lba_info *, char *, char *);
int hplba_init(struct lba_info *lba) {
  return write_lba_attribute(lba, "utilization", "init");
}


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

x86 assembly (clang, -O2):
<hplba_init>:
lea    0xee9(%rip),%rsi
lea    0xeee(%rip),%rdx
jmp    1030 <write_lba_attribute@plt>

LLVM IR (-O0):
%struct.lba_info = type { i32 }
@.str = [12 x i8] c"utilization\00"
@.str.1 = [5 x i8] c"init\00"
define i32 @hplba_init(%struct.lba_info* %0) {
%2 = alloca %struct.lba_info*
store %struct.lba_info* %0, %struct.lba_info** %2
%3 = load %struct.lba_info*, %struct.lba_info** %2
%4 = call i32 @write_lba_attribute(%struct.lba_info* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
%struct.lba_info = type { i32 }
@.str = [12 x i8] c"utilization\00"
@.str.1 = [5 x i8] c"init\00"
define i32 @hplba_init(%struct.lba_info* %0) {
%2 = tail call i32 @write_lba_attribute(%struct.lba_info* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
void disp_sys(void) {
  printf("*** Pcon  %d.%d.%d ***\n\n", 2, 0, 11);
  printf(" input buffer size: %d characters\n", 128);
  return;
}


x86 assembly (clang, -O0):
<disp_sys>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0xb,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x80,%esi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_sys>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0xb,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x80,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"*** Pcon %d.%d.%d ***\0A\0A\00"
@.str.1 = [35 x i8] c" input buffer size: %d characters\0A\00"
define void @disp_sys() {
%1 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 2, i32 0, i32 11)
%2 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 128)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"*** Pcon %d.%d.%d ***\0A\0A\00"
@.str.1 = [35 x i8] c" input buffer size: %d characters\0A\00"
define void @disp_sys() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 2, i32 0, i32 11)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 128)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char *array[] = {"janko", "hrasko"};
  printf("%s\n%s\n", array[0], array[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cea(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ce7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef5(%rip),%rdi
lea    0xee1(%rip),%rsi
lea    0xee0(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"janko\00"
@.str.1 = [7 x i8] c"hrasko\00"
@__const.main.array = [2 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [7 x i8] c"%s\0A%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8*]
store i32 0, i32* %1
%3 = bitcast [2 x i8*]* %2 to i8*
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
%5 = load i8*, i8** %4
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %5, i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"janko\00"
@.str.1 = [7 x i8] c"hrasko\00"
@.str.2 = [7 x i8] c"%s\0A%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void I2CMasterIntClearEx(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000001C))) = ui32IntFlags;
}


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

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

LLVM IR (-O0):
define void @I2CMasterIntClearEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 28
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntClearEx(i64 %0, i64 %1) {
%3 = add i64 %0, 28
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
void LED_50Hz(void) {}


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

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

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

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

/* Variables and functions */
int parse_uid(char const *, int /*<<< orphan*/ *);
int parse_gid(const char *s, gid_t *ret_gid) {
  return parse_uid(s, (uid_t *)ret_gid);
}


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

x86 assembly (clang, -O2):
<parse_gid>:
jmp    1030 <parse_uid@plt>

LLVM IR (-O0):
define i32 @parse_gid(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 @parse_uid(i8* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @parse_gid(i8* %0, i32* %1) {
%3 = tail call i32 @parse_uid(i8* %0, i32* %1)
ret i32 %3
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_output {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *wl_output_get_user_data(struct wl_output *wl_output) {
  return wl_proxy_get_user_data((struct wl_proxy *)wl_output);
}


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

x86 assembly (clang, -O2):
<wl_output_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.wl_output = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_output_get_user_data(%struct.wl_output* %0) {
%2 = alloca %struct.wl_output*
store %struct.wl_output* %0, %struct.wl_output** %2
%3 = load %struct.wl_output*, %struct.wl_output** %2
%4 = bitcast %struct.wl_output* %3 to %struct.wl_proxy*
%5 = call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.wl_output = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_output_get_user_data(%struct.wl_output* %0) {
%2 = bitcast %struct.wl_output* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
scalar_t__ clock();
double timer() {
  double ans;
  ans = (double)clock();
  ans = ans / (double)CLOCKS_PER_SEC;
  return (ans);
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2eb3(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define double @timer() {
%1 = alloca double
%2 = call i64 (...) @clock()
%3 = sitofp i64 %2 to double
store double %3, double* %1
%4 = load double, double* %1
%5 = load i64, i64* @CLOCKS_PER_SEC
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
store double %7, double* %1
%8 = load double, double* %1
ret double %8
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define double @timer() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @CLOCKS_PER_SEC
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stderr;
void printInvalidOptionError(char optionChar) {
  fprintf(stderr, "Unknown option -%c. Use -h for help.\n", optionChar);
}


x86 assembly (clang, -O0):
<printInvalidOptionError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0xed2(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printInvalidOptionError>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"Unknown option -%c. Use -h for help.\0A\00"
define void @printInvalidOptionError(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @stderr
%4 = load i8, i8* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"Unknown option -%c. Use -h for help.\0A\00"
define void @printInvalidOptionError(i8 signext %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIGIO;
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ host_sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ host_sigemptyset(int /*<<< orphan*/ *);
void host_sigfillset(sigset_t *set) {
  host_sigemptyset(set);
  host_sigaddset(set, SIGUSR1);
  host_sigaddset(set, SIGUSR2);
  host_sigaddset(set, SIGALRM);
  host_sigaddset(set, SIGIO);
}


x86 assembly (clang, -O0):
<host_sigfillset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <host_sigemptyset@plt>
mov    -0x8(%rbp),%rdi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
call   1030 <host_sigaddset@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1030 <host_sigaddset@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
call   1030 <host_sigaddset@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e52(%rip),%rax
mov    (%rax),%esi
call   1030 <host_sigaddset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_sigfillset>:
push   %rbx
mov    %rdi,%rbx
call   1040 <host_sigemptyset@plt>
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <host_sigaddset@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <host_sigaddset@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <host_sigaddset@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <host_sigaddset@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@SIGALRM = global i32 0
@SIGIO = global i32 0
define void @host_sigfillset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @host_sigemptyset(i32* %3)
%5 = load i32*, i32** %2
%6 = load i32, i32* @SIGUSR1
%7 = call i32 @host_sigaddset(i32* %5, i32 %6)
%8 = load i32*, i32** %2
%9 = load i32, i32* @SIGUSR2
%10 = call i32 @host_sigaddset(i32* %8, i32 %9)
%11 = load i32*, i32** %2
%12 = load i32, i32* @SIGALRM
%13 = call i32 @host_sigaddset(i32* %11, i32 %12)
%14 = load i32*, i32** %2
%15 = load i32, i32* @SIGIO
%16 = call i32 @host_sigaddset(i32* %14, i32 %15)
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@SIGALRM = global i32 0
@SIGIO = global i32 0
define void @host_sigfillset(i32* %0) {
%2 = tail call i32 @host_sigemptyset(i32* %0)
%3 = load i32, i32* @SIGUSR1
%4 = tail call i32 @host_sigaddset(i32* %0, i32 %3)
%5 = load i32, i32* @SIGUSR2
%6 = tail call i32 @host_sigaddset(i32* %0, i32 %5)
%7 = load i32, i32* @SIGALRM
%8 = tail call i32 @host_sigaddset(i32* %0, i32 %7)
%9 = load i32, i32* @SIGIO
%10 = tail call i32 @host_sigaddset(i32* %0, i32 %9)
ret void
}
int fun1271() { return 1271; }


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

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

LLVM IR (-O0):
define i32 @fun1271() {
ret i32 1271
}

LLVM IR (-O2):
define i32 @fun1271() {
ret i32 1271
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  printf("entering sleep for %u seconds\n", 2);
  sleep(2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"entering sleep for %u seconds\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = call i32 @sleep(i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"entering sleep for %u seconds\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @sleep(i32 2)
ret i32 0
}
/* Variables and functions */
int getdtablesize();
int get_open_max(void) {
  int retval;
  retval = getdtablesize();
  return retval;
}


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

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

LLVM IR (-O0):
define i32 @get_open_max() {
%1 = alloca i32
%2 = call i32 (...) @getdtablesize()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_open_max() {
%1 = tail call i32 (...) @getdtablesize()
ret i32 %1
}
int modulo(int x, int y) { return x % y; }


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @modulo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
int test_imm_16int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x16 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_16int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 22
%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_16int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 94489280512
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int tracker_cmd(int, char *, unsigned char *);
int tracker_download(char *host, unsigned char *fh) {
  return tracker_cmd(2, host, fh);
}


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

x86 assembly (clang, -O2):
<tracker_download>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <tracker_cmd@plt>

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

LLVM IR (-O2):
define i32 @tracker_download(i8* %0, i8* %1) {
%3 = tail call i32 @tracker_cmd(i32 2, i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void error_msg(char *message) {
  printf(message);
  exit(1);
}


x86 assembly (clang, -O0):
<error_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_msg>:
push   %rax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @error_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error_msg(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
double MOAtoDeg(double moa) { return moa / 60; }


x86 assembly (clang, -O0):
<MOAtoDeg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @MOAtoDeg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 6.000000e+01
ret double %4
}

LLVM IR (-O2):
define double @MOAtoDeg(double %0) {
%2 = fdiv double %0, 6.000000e+01
ret double %2
}
void closedevice(fd) int fd;
{ close(fd); }


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

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

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

LLVM IR (-O2):
define void @closedevice(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
ret void
}
void RTStrCacheEnterN(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_strjoinv() {
ret void
}
/* Type definitions */
typedef int uint8_t;
struct pcg_state_16 {
  int dummy;
};

/* Variables and functions */
int pcg_mcg_16_xsh_rs_8_random_r(struct pcg_state_16 *);
uint8_t pcg_mcg_16_xsh_rs_8_boundedrand_r(struct pcg_state_16 *rng,
                                          uint8_t bound) {
  uint8_t threshold = ((uint8_t)(-bound)) % bound;
  for (;;) {
    uint8_t r = pcg_mcg_16_xsh_rs_8_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_mcg_16_xsh_rs_8_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_mcg_16_xsh_rs_8_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_mcg_16_xsh_rs_8_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_mcg_16_xsh_rs_8_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_mcg_16_xsh_rs_8_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_mcg_16_xsh_rs_8_random_r@plt>
test   %eax,%eax
js     1120 <pcg_mcg_16_xsh_rs_8_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_16 = type { i32 }
define i32 @pcg_mcg_16_xsh_rs_8_boundedrand_r(%struct.pcg_state_16* %0, i32 %1) {
%3 = alloca %struct.pcg_state_16*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_16* %0, %struct.pcg_state_16** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_16*, %struct.pcg_state_16** %3
%13 = call i32 @pcg_mcg_16_xsh_rs_8_random_r(%struct.pcg_state_16* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_16 = type { i32 }
define i32 @pcg_mcg_16_xsh_rs_8_boundedrand_r(%struct.pcg_state_16* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_mcg_16_xsh_rs_8_random_r(%struct.pcg_state_16* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void argv_destroy(char **argv) {
  int i;
  for (i = 0; argv[i] != NULL; i++)
    free((void *)argv[i]);
  free((void *)argv);
}


x86 assembly (clang, -O0):
<argv_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <argv_destroy+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <argv_destroy+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argv_destroy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <argv_destroy+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <argv_destroy+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @argv_destroy(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @free(i8* %6)
%8 = add nuw nsw i64 %5, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = bitcast i8** %0 to i8*
%14 = tail call i32 @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ binomial(int, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  printf("%lu\n", binomial(5, 3));
  printf("%lu\n", binomial(30, 15));
  printf("%lu\n", binomial(41, 31));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <binomial@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1e,%edi
mov    $0xf,%esi
call   1030 <binomial@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x29,%edi
mov    $0x1f,%esi
call   1030 <binomial@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <binomial@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1e,%edi
mov    $0xf,%esi
call   1030 <binomial@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x29,%edi
mov    $0x1f,%esi
call   1030 <binomial@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @binomial(i32 5, i32 3)
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @binomial(i32 30, i32 15)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @binomial(i32 41, i32 31)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i32 @binomial(i32 5, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @binomial(i32 30, i32 15)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @binomial(i32 41, i32 31)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void light_start(void) {
  mbus_remote_register_write(0x4, 0x01, ((0 << 5) | (1 << 4) | (2 << 2) | (1)));
}


x86 assembly (clang, -O0):
<light_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x19,%edx
call   1030 <mbus_remote_register_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<light_start>:
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x19,%edx
jmp    1030 <mbus_remote_register_write@plt>

LLVM IR (-O0):
define void @light_start() {
%1 = call i32 @mbus_remote_register_write(i32 4, i32 1, i32 25)
ret void
}

LLVM IR (-O2):
define void @light_start() {
%1 = tail call i32 @mbus_remote_register_write(i32 4, i32 1, i32 25)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  for (int i = 1; i < 100; i += 2) {
    printf("%d\n", i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%ebx
lea    0xee0(%rip),%r14
add    $0x2,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x62,%ebx
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %3, 2
%6 = icmp ult i32 %3, 98
br i1 %6, label %2, label %1
}
int test_imm_A1int8_mem(signed char *val) {
  return ((*val) & (-0xA1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A1int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff5f,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A1int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -161
%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_A1int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -161
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}