xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ DSA;

/* Variables and functions */
int PEM_ASN1_write(int /*<<< orphan*/ *, int /*<<< orphan*/,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_PUBLIC;
scalar_t__ i2d_DSA_PUBKEY;
int PEM_write_DSA_PUBKEY(FILE *fp, DSA *x) {
  return PEM_ASN1_write((i2d_of_void *)i2d_DSA_PUBKEY, PEM_STRING_PUBLIC, fp, x,
                        NULL, NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_DSA_PUBKEY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_DSA_PUBKEY>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_DSA_PUBKEY = global i64 0
@PEM_STRING_PUBLIC = global i32 0
define i32 @PEM_write_DSA_PUBKEY(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_DSA_PUBKEY
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_PUBLIC
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_DSA_PUBKEY = global i64 0
@PEM_STRING_PUBLIC = global i32 0
define i32 @PEM_write_DSA_PUBKEY(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_DSA_PUBKEY
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_PUBLIC
%6 = tail call i32 @PEM_ASN1_write(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
/* Variables and functions */
double acos(double);
double safeACOS(double val) {
  if (val < -1)
    return 3.14159265;
  if (val > 1)
    return 0;
  return acos(val);
}


x86 assembly (clang, -O0):
<safeACOS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1142 <safeACOS+0x32>
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1175 <safeACOS+0x65>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1166 <safeACOS+0x56>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1175 <safeACOS+0x65>
movsd  -0x10(%rbp),%xmm0
call   1030 <acos@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safeACOS>:
movsd  0xef0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1127 <safeACOS+0x17>
movsd  0xeda(%rip),%xmm0
ret
xorpd  %xmm1,%xmm1
ucomisd 0xedd(%rip),%xmm0
jbe    113a <safeACOS+0x2a>
movapd %xmm1,%xmm0
ret
jmp    1030 <acos@plt>

LLVM IR (-O0):
define double @safeACOS(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, -1.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0x400921FB53C8D4F1, double* %2
br label %14
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 1.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store double 0.000000e+00, double* %2
br label %14
11: ; preds = %7
%12 = load double, double* %3
%13 = call double @acos(double %12)
store double %13, double* %2
br label %14
14: ; preds = %11, %10, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @safeACOS(double %0) {
%2 = fcmp olt double %0, -1.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 1.000000e+00
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call double @acos(double %0)
br label %7
7: ; preds = %3, %1, %5
%8 = phi double [ %6, %5 ], [ 0x400921FB53C8D4F1, %1 ], [ 0.000000e+00, %3 ]
ret double %8
}
void __attribute__((weak)) _exit(int code __attribute__((unused))) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

x86 assembly (clang, -O2):
<_exit>:
jmp    1100 <_exit>

LLVM IR (-O0):
define weak void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define weak void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
void check_zero_sized_VLA(int x) {
  if (x)
    return;
  int vla[x];
}


x86 assembly (clang, -O0):
<check_zero_sized_VLA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111a <check_zero_sized_VLA+0x1a>
jmp    112f <check_zero_sized_VLA+0x2f>
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @check_zero_sized_VLA(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %14
8: ; preds = %1
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %3
%12 = alloca i32, i64 %10
store i64 %10, i64* %4
%13 = load i8*, i8** %3
br label %14
14: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @check_zero_sized_VLA(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void null_pointer_read(void) {
  int *i = 0;
  printf("%i", *i);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @null_pointer_read() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 undef)
ret void
}
void set_page(unsigned int table[], unsigned char page, unsigned int address,
              unsigned short flags) {
  table[page] = ((address & 0xFFFFF000) | flags);
}


x86 assembly (clang, -O0):
<set_page>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%edx
and    $0xfffff000,%edx
movzwl -0x12(%rbp),%eax
or     %eax,%edx
mov    -0x8(%rbp),%rax
movzbl -0x9(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_page>:
and    $0xfffff000,%edx
or     %ecx,%edx
mov    %esi,%eax
mov    %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @set_page(i32* %0, i8 zeroext %1, i32 %2, i16 zeroext %3) {
%5 = alloca i32*
%6 = alloca i8
%7 = alloca i32
%8 = alloca i16
store i32* %0, i32** %5
store i8 %1, i8* %6
store i32 %2, i32* %7
store i16 %3, i16* %8
%9 = load i32, i32* %7
%10 = and i32 %9, -4096
%11 = load i16, i16* %8
%12 = zext i16 %11 to i32
%13 = or i32 %10, %12
%14 = load i32*, i32** %5
%15 = load i8, i8* %6
%16 = zext i8 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 %13, i32* %17
ret void
}

LLVM IR (-O2):
define void @set_page(i32* nocapture writeonly %0, i8 zeroext %1, i32 %2, i16 zeroext %3) {
%5 = and i32 %2, -4096
%6 = zext i16 %3 to i32
%7 = or i32 %5, %6
%8 = zext i8 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %7, i32* %9
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
bool dir_exits(const char *path) {
  struct stat st;
  if (stat(path, &st) != 0) {
    return false;
  }
  if (S_ISDIR(st.st_mode)) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<dir_exits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     114f <dir_exits+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1174 <dir_exits+0x54>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     116d <dir_exits+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <dir_exits+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_exits>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <dir_exits+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @dir_exits(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %16
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i64 @S_ISDIR(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %2
br label %16
15: ; preds = %9
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @dir_exits(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ StabilizationBankHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void StabilizationBankRequestUpdate() {
  UAVObjRequestUpdate(StabilizationBankHandle());
}


x86 assembly (clang, -O0):
<StabilizationBankRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <StabilizationBankHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StabilizationBankRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <StabilizationBankHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @StabilizationBankRequestUpdate() {
%1 = call i32 (...) @StabilizationBankHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @StabilizationBankRequestUpdate() {
%1 = tail call i32 (...) @StabilizationBankHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
scrnextup(f, n) int f, n;
{
  nextwind(0, 1);
  backpage(f, n);
  prevwind(0, 1);
}


x86 assembly (clang, -O0):
<scrnextup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <nextwind@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1040 <backpage@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1050 <prevwind@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrnextup>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <nextwind@plt>
mov    %ebp,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <backpage@plt>
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <prevwind@plt>

LLVM IR (-O0):
define i32 @scrnextup(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @nextwind to i32 (i32, i32, ...)*)(i32 0, i32 1)
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @backpage to i32 (i32, i32, ...)*)(i32 %7, i32 %8)
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @prevwind to i32 (i32, i32, ...)*)(i32 0, i32 1)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @scrnextup(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @nextwind to i32 (i32, i32, ...)*)(i32 0, i32 1)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @backpage to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @prevwind to i32 (i32, i32, ...)*)(i32 0, i32 1)
ret i32 undef
}
/* Variables and functions */
int check_inpos(char *, char const *, int const *);
int main(int argc, char **argv) {
  const char *str1 = "user@example.com";
  const int expected_inpos[] = {0, 0, 0,  1,  2,  3,  4,  5,  6,  7,
                                8, 9, 10, 11, 12, 13, 14, 15, 15, 15};
  return check_inpos("compress.cti,en-us-g2.ctb", str1, expected_inpos);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xee4(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    0xeac(%rip),%rdi
call   1030 <check_inpos@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xf55(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf39(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xf1d(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xf01(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xebb(%rip),%rdi
lea    0xea3(%rip),%rsi
mov    %rsp,%rdx
call   1030 <check_inpos@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"user@example.com\00"
@__const.main.expected_inpos = [20 x i32] [i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 15, i32 15]
@.str.1 = [26 x i8] c"compress.cti,en-us-g2.ctb\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [20 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %6
%8 = bitcast [20 x i32]* %7 to i8*
%9 = load i8*, i8** %6
%10 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 0
%11 = call i32 @check_inpos(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [17 x i8] c"user@example.com\00"
@__const.main.expected_inpos = [20 x i32] [i32 0, i32 0, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 15, i32 15]
@.str.1 = [26 x i8] c"compress.cti,en-us-g2.ctb\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [20 x i32]
%4 = bitcast [20 x i32]* %3 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%6 = call i32 @check_inpos(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %5)
ret i32 %6
}
int fun_coverage_if_neq(int x) {
  if (x != 5) {
    return 8;
  } else {
    return 18;
  }
}


x86 assembly (clang, -O0):
<fun_coverage_if_neq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     111d <fun_coverage_if_neq+0x1d>
movl   $0x8,-0x4(%rbp)
jmp    1124 <fun_coverage_if_neq+0x24>
movl   $0x12,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_coverage_if_neq>:
cmp    $0x5,%edi
mov    $0x12,%ecx
mov    $0x8,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fun_coverage_if_neq(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 5
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 8, i32* %2
br label %8
7: ; preds = %1
store i32 18, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @fun_coverage_if_neq(i32 %0) {
%2 = icmp eq i32 %0, 5
%3 = select i1 %2, i32 18, i32 8
ret i32 %3
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/, struct timespec *);
int sched_rr_get_interval(pid_t pid, struct timespec *ts) {
  return syscall(161, pid, ts);
}


x86 assembly (clang, -O0):
<sched_rr_get_interval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0xa1,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_rr_get_interval>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0xa1,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @sched_rr_get_interval(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @syscall(i32 161, i32 %5, %struct.timespec* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @sched_rr_get_interval(i32 %0, %struct.timespec* %1) {
%3 = tail call i32 @syscall(i32 161, i32 %0, %struct.timespec* %1)
ret i32 %3
}
/* Variables and functions */
int maxProfit(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int profit[] = {1, 2, 3, 4, 6, 7};
  int re = maxProfit(profit, 6);
  printf("%d\n", re);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x6,%esi
call   1040 <maxProfit@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1040 <maxProfit@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.profit = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 6, i32 7]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = bitcast [6 x i32]* %3 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%6 = call i32 @maxProfit(i32* %5, i32 6)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _ifconfig_usage(void) {
  fputs("Usage: "
        "ifconfig"
        " [-m] interface [argument...]\n"
        "       "
        "ifconfig"
        " -a\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_ifconfig_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ifconfig_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [65 x i8] c"Usage: ifconfig [-m] interface [argument...]\0A ifconfig -a\0A\00"
@stderr = global i32 0
define i32 @_ifconfig_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [65 x i8] c"Usage: ifconfig [-m] interface [argument...]\0A ifconfig -a\0A\00"
@stderr = global i32 0
define i32 @_ifconfig_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t bit_test(const uint8_t byte, uint8_t n) { return byte & (1 << n); }


x86 assembly (clang, -O0):
<bit_test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_test>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @bit_test(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 = shl i32 1, %6
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @bit_test(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
ret i32 %4
}
int cio_decrement(int *value) { return __sync_add_and_fetch(value, -1); }


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

x86 assembly (clang, -O2):
<cio_decrement>:
mov    $0xffffffff,%eax
lock xadd %eax,(%rdi)
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @cio_decrement(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = atomicrmw add i32* %3, i32 -1 seq_cst
%5 = add i32 %4, -1
ret i32 %5
}

LLVM IR (-O2):
define i32 @cio_decrement(i32* nocapture %0) {
%2 = atomicrmw add i32* %0, i32 -1 seq_cst
%3 = add i32 %2, -1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;
typedef int /*<<< orphan*/ posix_spawn_file_actions_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int __spawni(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/ const *,
             int /*<<< orphan*/ const *, char *const *, char *const *,
             int /*<<< orphan*/);
int posix_spawn(pid_t *pid, const char *path,
                const posix_spawn_file_actions_t *file_actions,
                const posix_spawnattr_t *attrp, char *const argv[],
                char *const envp[]) {
  return __spawni(pid, path, file_actions, attrp, argv, envp, 0);
}


x86 assembly (clang, -O0):
<posix_spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <__spawni@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawn>:
push   %rax
movl   $0x0,(%rsp)
call   1030 <__spawni@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @posix_spawn(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8**
%12 = alloca i8**
store i32* %0, i32** %7
store i8* %1, i8** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i8** %4, i8*** %11
store i8** %5, i8*** %12
%13 = load i32*, i32** %7
%14 = load i8*, i8** %8
%15 = load i32*, i32** %9
%16 = load i32*, i32** %10
%17 = load i8**, i8*** %11
%18 = load i8**, i8*** %12
%19 = call i32 @__spawni(i32* %13, i8* %14, i32* %15, i32* %16, i8** %17, i8** %18, i32 0)
ret i32 %19
}

LLVM IR (-O2):
define i32 @posix_spawn(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5) {
%7 = tail call i32 @__spawni(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5, i32 0)
ret i32 %7
}
/* Variables and functions */
int date_years_between(char *, char *);
int /*<<< orphan*/ printf(char *, int);
void test_years_between(void) {
  printf("Should be 50: is %d\n",
         date_years_between("1960-10-06", "2011-08-04"));
}


x86 assembly (clang, -O0):
<test_years_between>:
push   %rbp
mov    %rsp,%rbp
lea    0xeea(%rip),%rdi
lea    0xeee(%rip),%rsi
call   1040 <date_years_between@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_years_between>:
push   %rax
lea    0xeed(%rip),%rdi
lea    0xef1(%rip),%rsi
call   1040 <date_years_between@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Should be 50: is %d\0A\00"
@.str.1 = [11 x i8] c"1960-10-06\00"
@.str.2 = [11 x i8] c"2011-08-04\00"
define void @test_years_between() {
%1 = call i32 @date_years_between(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Should be 50: is %d\0A\00"
@.str.1 = [11 x i8] c"1960-10-06\00"
@.str.2 = [11 x i8] c"2011-08-04\00"
define void @test_years_between() {
%1 = tail call i32 @date_years_between(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
char *julian_display_hhmm(double);
char *julian_get_hhmm(double current) { return julian_display_hhmm(current); }


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

x86 assembly (clang, -O2):
<julian_get_hhmm>:
jmp    1030 <julian_display_hhmm@plt>

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

LLVM IR (-O2):
define i8* @julian_get_hhmm(double %0) {
%2 = tail call i8* @julian_display_hhmm(double %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, float);
main() {
  float sides;
  float sum;
  sides = 2.8;
  sum = sides * sides * sides;
  printf("The volume of a cube with sides 2.8m is %f", sum);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"The volume of a cube with sides 2.8m is %f\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
store float 0x4006666660000000, float* %1
%3 = load float, float* %1
%4 = load float, float* %1
%5 = fmul float %3, %4
%6 = load float, float* %1
%7 = fmul float %5, %6
store float %7, float* %2
%8 = load float, float* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), float %8)
%10 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"The volume of a cube with sides 2.8m is %f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), float 0x4035F3B640000000)
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_gameover();
int /*<<< orphan*/ do_hiscores();
void game_over() {
  do_gameover();
  do_hiscores();
}


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

x86 assembly (clang, -O2):
<game_over>:
push   %rax
xor    %eax,%eax
call   1040 <do_gameover@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <do_hiscores@plt>

LLVM IR (-O0):
define void @game_over() {
%1 = call i32 (...) @do_gameover()
%2 = call i32 (...) @do_hiscores()
ret void
}

LLVM IR (-O2):
define void @game_over() {
%1 = tail call i32 (...) @do_gameover()
%2 = tail call i32 (...) @do_hiscores()
ret void
}
int f5(int a, int b) { return 2 * a - 6 * b; }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
imul   $0x6,-0x8(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
lea    (%rdi,%rdi,1),%eax
add    %esi,%esi
lea    (%rsi,%rsi,2),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f5(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 = mul nsw i32 2, %5
%7 = load i32, i32* %4
%8 = mul nsw i32 6, %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f5(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = mul i32 %1, -6
%5 = add i32 %4, %3
ret i32 %5
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 "
         "REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 "
         "CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 "
         "BUILD_DATE=2014年 07月 05日 星期六 20:12:43 CST BUILD=DEBUG "
         "CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 "
         "USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= "
         "MALI_PLATFORM_FILE=platform/ux500/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


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

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

LLVM IR (-O0):
@.str = [485 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=2014\E5\B9\B4 07\E6\9C\88 05\E6\97\A5 \E6\98\9F\E6\9C\9F\E5\85\AD 20:12:43 CST BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([485 x i8], [485 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [485 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=2014\E5\B9\B4 07\E6\9C\88 05\E6\97\A5 \E6\98\9F\E6\9C\9F\E5\85\AD 20:12:43 CST BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([485 x i8], [485 x i8]* @.str, i64 0, i64 0)
}
extern __attribute__((gnu_)) double carmen_degrees_to_radians(double theta) {
  return (theta * 3.14159265358979323846 / 180.0);
}


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

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

LLVM IR (-O0):
define double @carmen_degrees_to_radians(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @carmen_degrees_to_radians(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
void XoDumpJPEG() {}


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

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

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

LLVM IR (-O2):
define void @XoDumpJPEG() {
ret void
}
/* Type definitions */
struct fdt_property {
  int dummy;
};

/* Variables and functions */
struct fdt_property const *fdt_get_property_namelen(void const *, int,
                                                    char const *,
                                                    int /*<<< orphan*/, int *);
int /*<<< orphan*/ strlen(char const *);
const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
                                            const char *name, int *lenp) {
  return fdt_get_property_namelen(fdt, nodeoffset, name, strlen(name), lenp);
}


x86 assembly (clang, -O0):
<fdt_get_property>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
mov    -0x20(%rbp),%r8
call   1040 <fdt_get_property_namelen@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdt_get_property>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fdt_get_property_namelen@plt>

LLVM IR (-O0):
%struct.fdt_property = type { i32 }
define %struct.fdt_property* @fdt_get_property(i8* %0, i32 %1, i8* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %7
%13 = call i32 @strlen(i8* %12)
%14 = load i32*, i32** %8
%15 = call %struct.fdt_property* @fdt_get_property_namelen(i8* %9, i32 %10, i8* %11, i32 %13, i32* %14)
ret %struct.fdt_property* %15
}

LLVM IR (-O2):
%struct.fdt_property = type { i32 }
define %struct.fdt_property* @fdt_get_property(i8* %0, i32 %1, i8* %2, i32* %3) {
%5 = tail call i32 @strlen(i8* %2)
%6 = tail call %struct.fdt_property* @fdt_get_property_namelen(i8* %0, i32 %1, i8* %2, i32 %5, i32* %3)
ret %struct.fdt_property* %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: intel-gen4disasm [-o outputfile] [-b] inputfile\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"usage: intel-gen4disasm [-o outputfile] [-b] inputfile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"usage: intel-gen4disasm [-o outputfile] [-b] inputfile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t vton(uint8_t *addr) {
  return (addr[0] << (3 * 8)) | (addr[1] << (2 * 8)) | (addr[2] << (1 * 8)) |
         (addr[3] << (0 * 8));
}


x86 assembly (clang, -O0):
<vton>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vton>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @vton(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = shl i32 %19, 0
%21 = or i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @vton(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
unsigned char luma(unsigned char r, unsigned char g, unsigned char b) {
  return ((r + b + g) / 3);
}


x86 assembly (clang, -O0):
<luma>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x3(%rbp),%ecx
add    %ecx,%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<luma>:
add    %esi,%edi
add    %edx,%edi
imul   $0xaaab,%edi,%eax
shr    $0x11,%eax
ret

LLVM IR (-O0):
define zeroext i8 @luma(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = add nsw i32 %8, %10
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = add nsw i32 %11, %13
%15 = sdiv i32 %14, 3
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @luma(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %0 to i16
%5 = zext i8 %2 to i16
%6 = zext i8 %1 to i16
%7 = add nuw nsw i16 %6, %4
%8 = add nuw nsw i16 %7, %5
%9 = udiv i16 %8, 3
%10 = trunc i16 %9 to i8
ret i8 %10
}
/* Variables and functions */
int snprintf(char *, int const, char *, char *);
int handle_names(char *channel, char *mesg, const int mesg_len) {
  return snprintf(mesg, mesg_len, "NAMES %s\r\n", channel);
}


x86 assembly (clang, -O0):
<handle_names>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rcx
lea    0xecb(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_names>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"NAMES %s\0D\0A\00"
define i32 @handle_names(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"NAMES %s\0D\0A\00"
define i32 @handle_names(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @snprintf(i8* %1, i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %4
}
/* Variables and functions */
int sendcmd(int, int, int, unsigned char, int /*<<< orphan*/);
int set_clock(int f, int y, unsigned char month, unsigned char d,
              unsigned char h, unsigned char min) {
  return sendcmd(f, 6, ((y & 0xFFFF) << 16) | (month << 8) | d,
                 (h << 24) | (min << 16), 0);
}


x86 assembly (clang, -O0):
<set_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8d,-0x1c(%rbp)
mov    %ecx,%eax
mov    -0x1c(%rbp),%ecx
mov    %eax,-0x18(%rbp)
mov    %edx,%eax
mov    -0x18(%rbp),%edx
mov    %eax,-0x14(%rbp)
mov    %esi,%eax
mov    -0x14(%rbp),%esi
mov    %eax,-0x10(%rbp)
mov    %edi,%r8d
mov    -0x10(%rbp),%edi
mov    %r9b,%al
mov    %r8d,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %sil,-0x9(%rbp)
mov    %dl,-0xa(%rbp)
mov    %cl,-0xb(%rbp)
mov    %al,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
and    $0xffff,%edx
shl    $0x10,%edx
movzbl -0x9(%rbp),%eax
shl    $0x8,%eax
or     %eax,%edx
movzbl -0xa(%rbp),%eax
or     %eax,%edx
movzbl -0xb(%rbp),%eax
shl    $0x18,%eax
movzbl -0xc(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    $0x6,%esi
xor    %r8d,%r8d
movzbl %al,%ecx
call   1030 <sendcmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_clock>:
shl    $0x10,%esi
shl    $0x8,%edx
or     %esi,%edx
or     %ecx,%edx
mov    $0x6,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sendcmd@plt>

LLVM IR (-O0):
define i32 @set_clock(i32 %0, i32 %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
store i32 %0, i32* %7
store i32 %1, i32* %8
store i8 %2, i8* %9
store i8 %3, i8* %10
store i8 %4, i8* %11
store i8 %5, i8* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = and i32 %14, 65535
%16 = shl i32 %15, 16
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = or i32 %16, %19
%21 = load i8, i8* %10
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
%24 = load i8, i8* %11
%25 = zext i8 %24 to i32
%26 = shl i32 %25, 24
%27 = load i8, i8* %12
%28 = zext i8 %27 to i32
%29 = shl i32 %28, 16
%30 = or i32 %26, %29
%31 = trunc i32 %30 to i8
%32 = call i32 @sendcmd(i32 %13, i32 6, i32 %23, i8 zeroext %31, i32 0)
ret i32 %32
}

LLVM IR (-O2):
define i32 @set_clock(i32 %0, i32 %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5) {
%7 = shl i32 %1, 16
%8 = zext i8 %2 to i32
%9 = shl nuw nsw i32 %8, 8
%10 = or i32 %9, %7
%11 = zext i8 %3 to i32
%12 = or i32 %10, %11
%13 = tail call i32 @sendcmd(i32 %0, i32 6, i32 %12, i8 zeroext 0, i32 0)
ret i32 %13
}
/* Type definitions */
struct dance_matrix {
  int dummy;
};

/* Variables and functions */
int dance_init_named_cap(struct dance_matrix *, size_t, size_t, int const *,
                         char *const *, int);
int dance_init_named(struct dance_matrix *m, size_t rows, size_t cols,
                     const int *data, char *const *names) {
  return dance_init_named_cap(m, rows, cols, data, names, 1000);
}


x86 assembly (clang, -O0):
<dance_init_named>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x3e8,%r9d
call   1030 <dance_init_named_cap@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dance_init_named>:
mov    $0x3e8,%r9d
jmp    1030 <dance_init_named_cap@plt>

LLVM IR (-O0):
%struct.dance_matrix = type { i32 }
define i32 @dance_init_named(%struct.dance_matrix* %0, i64 %1, i64 %2, i32* %3, i8** %4) {
%6 = alloca %struct.dance_matrix*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i8**
store %struct.dance_matrix* %0, %struct.dance_matrix** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store i8** %4, i8*** %10
%11 = load %struct.dance_matrix*, %struct.dance_matrix** %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i32*, i32** %9
%15 = load i8**, i8*** %10
%16 = call i32 @dance_init_named_cap(%struct.dance_matrix* %11, i64 %12, i64 %13, i32* %14, i8** %15, i32 1000)
ret i32 %16
}

LLVM IR (-O2):
%struct.dance_matrix = type { i32 }
define i32 @dance_init_named(%struct.dance_matrix* %0, i64 %1, i64 %2, i32* %3, i8** %4) {
%6 = tail call i32 @dance_init_named_cap(%struct.dance_matrix* %0, i64 %1, i64 %2, i32* %3, i8** %4, i32 1000)
ret i32 %6
}
int __attribute__((weak)) main() { return -1; }


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

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

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

LLVM IR (-O2):
define weak i32 @main() {
ret i32 -1
}
int BMP_CbRow(int cx, int cbpp, int cBitsAlign) {
  return ((cx * cbpp + (cBitsAlign - 1)) & ~(cBitsAlign - 1)) >> 3;
}


x86 assembly (clang, -O0):
<BMP_CbRow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMP_CbRow>:
imul   %esi,%edi
lea    (%rdx,%rdi,1),%eax
add    $0xffffffff,%eax
neg    %edx
and    %edx,%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @BMP_CbRow(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = xor i32 %14, -1
%16 = and i32 %12, %15
%17 = ashr i32 %16, 3
ret i32 %17
}

LLVM IR (-O2):
define i32 @BMP_CbRow(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = add nsw i32 %2, -1
%6 = add nsw i32 %5, %4
%7 = sub i32 0, %2
%8 = and i32 %6, %7
%9 = ashr i32 %8, 3
ret i32 %9
}