xunge/DecIR huggingface dataset:
int main() {
  unsigned char arg1 = 0x55;
  unsigned char arg2 = 0x55;
  unsigned char arg3 = 0xAA;
  unsigned char out1 = 0;
  unsigned char out2 = 0;
  __asm__("cmpxchgb %%cl, %%dl"
          : "=a"(out1), "=d"(out2)
          : "a"(arg1), "c"(arg2), "d"(arg3));
  return (out1 == 0xAA) && (out2 == 0xAA);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x55,-0x5(%rbp)
movb   $0x55,-0x6(%rbp)
movb   $0xaa,-0x7(%rbp)
movb   $0x0,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x5(%rbp),%al
mov    -0x6(%rbp),%cl
mov    -0x7(%rbp),%dl
cmpxchg %cl,%dl
mov    %al,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
movzbl -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    $0xaa,%ecx
mov    %al,-0xa(%rbp)
jne    1155 <main+0x55>
movzbl -0x9(%rbp),%eax
cmp    $0xaa,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x55,%al
mov    $0x55,%cl
mov    $0xaa,%dl
cmpxchg %cl,%dl
xor    $0xaa,%al
xor    $0xaa,%dl
xor    %ecx,%ecx
or     %al,%dl
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i32 0, i32* %1
store i8 85, i8* %2
store i8 85, i8* %3
store i8 -86, i8* %4
store i8 0, i8* %5
store i8 0, i8* %6
%7 = load i8, i8* %2
%8 = load i8, i8* %3
%9 = load i8, i8* %4
%10 = call { i8, i8 } asm "cmpxchgb %cl, %dl", "={ax},={dx},{ax},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %7, i8 %8, i8 %9)
%11 = extractvalue { i8, i8 } %10, 0
%12 = extractvalue { i8, i8 } %10, 1
store i8 %11, i8* %5
store i8 %12, i8* %6
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = icmp eq i32 %14, 170
br i1 %15, label %16, label %20
16: ; preds = %0
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = icmp eq i32 %18, 170
br label %20
20: ; preds = %16, %0
%21 = phi i1 [ false, %0 ], [ %19, %16 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call { i8, i8 } asm "cmpxchgb %cl, %dl", "={ax},={dx},{ax},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i8 85, i8 85, i8 -86)
%2 = extractvalue { i8, i8 } %1, 0
%3 = extractvalue { i8, i8 } %1, 1
%4 = icmp eq i8 %2, -86
%5 = icmp eq i8 %3, -86
%6 = select i1 %4, i1 %5, i1 false
%7 = zext i1 %6 to i32
ret i32 %7
}
double call_with_trampolines(d1)
double d1;
{ return d1; }


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

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

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

LLVM IR (-O2):
define double @call_with_trampolines(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void custom_output_function(char *prefix, char *contents) {
  printf("\x1b[32m"
         "%s "
         "\x1b[37m"
         "%s\n"
         "\x1b[0;0m",
         prefix, contents);
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"\1B[32m%s \1B[37m%s\0A\1B[0;0m\00"
define void @custom_output_function(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 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\1B[32m%s \1B[37m%s\0A\1B[0;0m\00"
define void @custom_output_function(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ digitalWrite(int, int);
int /*<<< orphan*/ ino(int);
void digitalWriteX(int x, int pin, int value) {
  ino(x);
  digitalWrite(pin, value);
}


x86 assembly (clang, -O0):
<digitalWriteX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ino@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <digitalWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitalWriteX>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <ino@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <digitalWrite@plt>

LLVM IR (-O0):
define void @digitalWriteX(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 = call i32 @ino(i32 %7)
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @digitalWrite(i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @digitalWriteX(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @ino(i32 %0)
%5 = tail call i32 @digitalWrite(i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_backward(int, int);
void b_backward_test(void **state) {
  assert_int_equal(0x0002000000000000ul,
                   b_backward(0x0000000004000000ul, 0x0002000400000000ul));
  assert_int_equal(0x0002000000000000ul,
                   b_backward(0x0000000001000000ul, 0x0002000400000000ul));
}


x86 assembly (clang, -O0):
<b_backward_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4000000,%edi
xor    %esi,%esi
call   1030 <b_backward@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <assert_int_equal@plt>
mov    $0x1000000,%edi
xor    %esi,%esi
call   1030 <b_backward@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_backward_test>:
push   %rax
mov    $0x4000000,%edi
xor    %esi,%esi
call   1030 <b_backward@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1040 <assert_int_equal@plt>
mov    $0x1000000,%edi
xor    %esi,%esi
call   1030 <b_backward@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_backward_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_backward(i32 67108864, i32 0)
%4 = call i32 @assert_int_equal(i32 0, i32 %3)
%5 = call i32 @b_backward(i32 16777216, i32 0)
%6 = call i32 @assert_int_equal(i32 0, i32 %5)
ret void
}

LLVM IR (-O2):
define void @b_backward_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_backward(i32 67108864, i32 0)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
%4 = tail call i32 @b_backward(i32 16777216, i32 0)
%5 = tail call i32 @assert_int_equal(i32 0, i32 %4)
ret void
}
void handle_USR2(sig) int sig;
{}


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

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

LLVM IR (-O0):
define void @handle_USR2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @handle_USR2(i32 %0) {
ret void
}
void foo66() {}


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

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

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

LLVM IR (-O2):
define void @foo66() {
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int scmp(const void *p1, const void *p2) {
  char *v1, *v2;
  v1 = *(char **)p1;
  v2 = *(char **)p2;
  return strcmp(v1, v2);
}


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

x86 assembly (clang, -O2):
<scmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @scmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @scmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
int beqInstruction(int i, int j) { return (i == j) ? 1 : 0; }


x86 assembly (clang, -O0):
<beqInstruction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<beqInstruction>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @beqInstruction(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 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @beqInstruction(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int sub_fun(int);
int fun(int x) {
  int ret;
  ret = sub_fun(x);
  return ret;
}


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

x86 assembly (clang, -O2):
<fun>:
jmp    1030 <sub_fun@plt>

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

LLVM IR (-O2):
define i32 @fun(i32 %0) {
%2 = tail call i32 @sub_fun(i32 %0)
ret i32 %2
}
/* Variables and functions */
int myAtoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *str = "  -42";
  int a = myAtoi(str);
  printf("a %d\n", a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c" -42\00"
@.str.1 = [6 x i8] c"a %d\0A\00"
define i32 @main() {
%1 = tail call i32 @myAtoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned int kbc_indexof(unsigned r, unsigned c) { return c * 16 + r; }


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

x86 assembly (clang, -O2):
<kbc_indexof>:
shl    $0x4,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @kbc_indexof(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = mul i32 %5, 16
%7 = load i32, i32* %3
%8 = add i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @kbc_indexof(i32 %0, i32 %1) {
%3 = shl i32 %1, 4
%4 = add i32 %3, %0
ret i32 %4
}
int SCOTCH_memMax() { return ((int)-1); }


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

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

LLVM IR (-O0):
define i32 @SCOTCH_memMax() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @SCOTCH_memMax() {
ret i32 -1
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t S0(uint64_t x) {
  return (((x) >> (28)) | ((x) << (64 - (28)))) ^
         (((x) >> (34)) | ((x) << (64 - (34)))) ^
         (((x) >> (39)) | ((x) << (64 - (39))));
}


x86 assembly (clang, -O0):
<S0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1c,%eax
mov    -0x4(%rbp),%edx
mov    $0x24,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x22,%ecx
sar    %cl,%edx
mov    %edx,%ecx
mov    -0x4(%rbp),%edx
shl    $0x1e,%edx
or     %edx,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x27,%ecx
sar    %cl,%edx
mov    %edx,%ecx
mov    -0x4(%rbp),%edx
shl    $0x19,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @S0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 28
%5 = load i32, i32* %2
%6 = shl i32 %5, 36
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = ashr i32 %8, 34
%10 = load i32, i32* %2
%11 = shl i32 %10, 30
%12 = or i32 %9, %11
%13 = xor i32 %7, %12
%14 = load i32, i32* %2
%15 = ashr i32 %14, 39
%16 = load i32, i32* %2
%17 = shl i32 %16, 25
%18 = or i32 %15, %17
%19 = xor i32 %13, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @S0(i32 %0) {
ret i32 poison
}
int CDAudio_Init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CDAudio_Init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DrawWindow();
int /*<<< orphan*/ GetInput();
void MainLoop() {
  do {
    GetInput();
    DrawWindow();
  } while (1);
}


x86 assembly (clang, -O0):
<MainLoop>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <MainLoop+0x9>
mov    $0x0,%al
call   1030 <GetInput@plt>
mov    $0x0,%al
call   1040 <DrawWindow@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1129 <MainLoop+0x9>
jmp    1146 <MainLoop+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MainLoop>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <GetInput@plt>
xor    %eax,%eax
call   1040 <DrawWindow@plt>
jmp    1130 <MainLoop+0x10>

LLVM IR (-O0):
define void @MainLoop() {
br label %1
1: ; preds = %4, %0
%2 = call i32 (...) @GetInput()
%3 = call i32 (...) @DrawWindow()
br label %4
4: ; preds = %1
br i1 true, label %1, label %5
5: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @MainLoop() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @GetInput()
%3 = tail call i32 (...) @DrawWindow()
br label %1
}
long scale(long x, long y, long z) {
  long t = x + 4 * y + 12 * z;
  return t;
}


x86 assembly (clang, -O0):
<scale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
imul   $0xc,-0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale>:
lea    (%rdi,%rsi,4),%rax
lea    (%rdx,%rdx,2),%rcx
lea    (%rax,%rcx,4),%rax
ret

LLVM IR (-O0):
define i64 @scale(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = mul nsw i64 4, %9
%11 = add nsw i64 %8, %10
%12 = load i64, i64* %6
%13 = mul nsw i64 12, %12
%14 = add nsw i64 %11, %13
store i64 %14, i64* %7
%15 = load i64, i64* %7
ret i64 %15
}

LLVM IR (-O2):
define i64 @scale(i64 %0, i64 %1, i64 %2) {
%4 = shl nsw i64 %1, 2
%5 = add nsw i64 %4, %0
%6 = mul nsw i64 %2, 12
%7 = add nsw i64 %5, %6
ret i64 %7
}
/* Type definitions */
struct eventab {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ intr_enable(int, int /*<<< orphan*/);
void evt_disable(struct eventab *tab, int irq) {
  (void)tab;
  intr_enable(irq, 0);
}


x86 assembly (clang, -O0):
<evt_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1030 <intr_enable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evt_disable>:
mov    %esi,%edi
xor    %esi,%esi
jmp    1030 <intr_enable@plt>

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

LLVM IR (-O2):
%struct.eventab = type { i32 }
define void @evt_disable(%struct.eventab* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @intr_enable(i32 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_bit_or(void) {
  test("30", "main(){printf(\"%d\", 20|26);}");
  test("30", "main(){int i=20; i|=26; printf(\"%d\", i);}");
}


x86 assembly (clang, -O0):
<TEST_bit_or>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <test@plt>
lea    0xed2(%rip),%rdi
lea    0xeeb(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_bit_or>:
push   %rbx
lea    0xee8(%rip),%rbx
lea    0xee4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xef2(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"30\00"
@.str.1 = [29 x i8] c"main(){printf(\22%d\22, 20|26);}\00"
@.str.2 = [42 x i8] c"main(){int i=20; i|=26; printf(\22%d\22, i);}\00"
define void @TEST_bit_or() {
%1 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"30\00"
@.str.1 = [29 x i8] c"main(){printf(\22%d\22, 20|26);}\00"
@.str.2 = [42 x i8] c"main(){int i=20; i|=26; printf(\22%d\22, i);}\00"
define void @TEST_bit_or() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret void
}
double MPStoKTS(double MPS) {
  double KTS = 1.9438445 * MPS;
  return KTS;
}


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

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

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

LLVM IR (-O2):
define double @MPStoKTS(double %0) {
%2 = fmul double %0, 0x3FFF19FCB0C026CC
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage(void) {
  fputs("Usage: listContains [needle] ([haystack...])\n", stderr);
  fputs("   Checks if any items (one item per arg) match needle.\n", stderr);
  fputs("    If so, returns 0 (true). Otherwise, returns 1 (false).\n\n",
        stderr);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xef5(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xf19(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xeff(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xf2a(%rip),%rdi
pop    %rbx
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Usage: listContains [needle] ([haystack...])\0A\00"
@stderr = global i32 0
@.str.1 = [57 x i8] c" Checks if any items (one item per arg) match needle.\0A\00"
@.str.2 = [61 x i8] c" If so, returns 0 (true). Otherwise, returns 1 (false).\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Usage: listContains [needle] ([haystack...])\0A\00"
@stderr = global i32 0
@.str.1 = [57 x i8] c" Checks if any items (one item per arg) match needle.\0A\00"
@.str.2 = [61 x i8] c" If so, returns 0 (true). Otherwise, returns 1 (false).\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
struct rw_semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __up_read(struct rw_semaphore *);
void up_read(struct rw_semaphore *sem) {
  ;
  __up_read(sem);
  ;
}


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

x86 assembly (clang, -O2):
<up_read>:
jmp    1030 <__up_read@plt>

LLVM IR (-O0):
%struct.rw_semaphore = type { i32 }
define void @up_read(%struct.rw_semaphore* %0) {
%2 = alloca %struct.rw_semaphore*
store %struct.rw_semaphore* %0, %struct.rw_semaphore** %2
%3 = load %struct.rw_semaphore*, %struct.rw_semaphore** %2
%4 = call i32 @__up_read(%struct.rw_semaphore* %3)
ret void
}

LLVM IR (-O2):
%struct.rw_semaphore = type { i32 }
define void @up_read(%struct.rw_semaphore* %0) {
%2 = tail call i32 @__up_read(%struct.rw_semaphore* %0)
ret void
}
void nooperands(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @BN_set_word() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ string(char *);
void oid_0002(void) { string("Firmware build date"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Firmware build date\00"
define void @oid_0002() {
%1 = call i32 @string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Firmware build date\00"
define void @oid_0002() {
%1 = tail call i32 @string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(unsigned char *, int, unsigned char *, int,
                                 int, int);
void pixel_avg_8x4(unsigned char *pix1, int i_stride_pix1, unsigned char *pix2,
                   int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 8, 4);
}


x86 assembly (clang, -O0):
<pixel_avg_8x4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x8,%r8d
mov    $0x4,%r9d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_8x4>:
mov    $0x8,%r8d
mov    $0x4,%r9d
jmp    1030 <pixel_avg_wxh@plt>

LLVM IR (-O0):
define void @pixel_avg_8x4(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 i32, i32* %8
%13 = call i32 @pixel_avg_wxh(i8* %9, i32 %10, i8* %11, i32 %12, i32 8, i32 4)
ret void
}

LLVM IR (-O2):
define void @pixel_avg_8x4(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i8* %0, i32 %1, i8* %2, i32 %3, i32 8, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void read_into_array(int arr[], int size) {
  int i;
  for (i = 0; i < size; i++) {
    scanf("%d", &arr[i]);
  }
}


x86 assembly (clang, -O0):
<read_into_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <read_into_array+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <read_into_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_into_array>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <read_into_array+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <read_into_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @read_into_array(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
void CoIdleTask(void *pdata) {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<CoIdleTask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    1108 <CoIdleTask+0x8>

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

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

LLVM IR (-O2):
define void @CoIdleTask(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int au_handle_shwh(struct super_block *sb, struct au_vdir *vdir,
                   struct au_nhash *whlist, struct au_nhash *delist) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.super_block = type opaque
%struct.au_vdir = type opaque
%struct.au_nhash = type opaque
define i32 @au_handle_shwh(%struct.super_block* %0, %struct.au_vdir* %1, %struct.au_nhash* %2, %struct.au_nhash* %3) {
%5 = alloca %struct.super_block*
%6 = alloca %struct.au_vdir*
%7 = alloca %struct.au_nhash*
%8 = alloca %struct.au_nhash*
store %struct.super_block* %0, %struct.super_block** %5
store %struct.au_vdir* %1, %struct.au_vdir** %6
store %struct.au_nhash* %2, %struct.au_nhash** %7
store %struct.au_nhash* %3, %struct.au_nhash** %8
ret i32 0
}

LLVM IR (-O2):
%struct.super_block = type opaque
%struct.au_vdir = type opaque
%struct.au_nhash = type opaque
define i32 @au_handle_shwh(%struct.super_block* nocapture readnone %0, %struct.au_vdir* nocapture readnone %1, %struct.au_nhash* nocapture readnone %2, %struct.au_nhash* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
double acos(int);
double theta(double xi) { return acos(1 - 2 * xi); }


x86 assembly (clang, -O0):
<theta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xed2(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <acos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<theta>:
addsd  %xmm0,%xmm0
movsd  0xee4(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <acos@plt>

LLVM IR (-O0):
define double @theta(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %3, double 1.000000e+00)
%5 = fptosi double %4 to i32
%6 = call double @acos(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @theta(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double 1.000000e+00)
%3 = fptosi double %2 to i32
%4 = tail call double @acos(i32 %3)
ret double %4
}
void init_device(int mic_device_number) {
  int i;
  for (i = 0; i < mic_device_number; i++) {
  }
}


x86 assembly (clang, -O0):
<init_device>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <init_device+0x2d>
jmp    111f <init_device+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <init_device+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init_device(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @init_device(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_inc_sp(void) { op_write1(0x33); }


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

x86 assembly (clang, -O2):
<op_enc_inc_sp>:
mov    $0x33,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_inc_sp() {
%1 = call i32 @op_write1(i32 51)
ret void
}

LLVM IR (-O2):
define void @op_enc_inc_sp() {
%1 = tail call i32 @op_write1(i32 51)
ret void
}
void platform_execute(void *sp, void *func, void *arg) {
  asm volatile("movq %2, %%rdi;"
               "movq %1, 0(%0);"
               "movq %0, %%rsp;"
               "call *0(%%rsp);"
               : "+r"(sp), "+r"(func), "+r"(arg)
               :
               : "memory");
}


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

x86 assembly (clang, -O2):
<platform_execute>:
mov    %rdx,%rdi
mov    %rsi,(%rdi)
mov    %rdi,%rsp
call   *(%rsp)
ret

LLVM IR (-O0):
define void @platform_execute(i8* %0, i8* %1, i8* %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 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call { i8*, i8*, i8* } asm sideeffect "movq $2, %rdi;movq $1, 0($0);movq $0, %rsp;call *0(%rsp);", "=r,=r,=r,0,1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %7, i8* %8, i8* %9)
%11 = extractvalue { i8*, i8*, i8* } %10, 0
%12 = extractvalue { i8*, i8*, i8* } %10, 1
%13 = extractvalue { i8*, i8*, i8* } %10, 2
store i8* %11, i8** %4
store i8* %12, i8** %5
store i8* %13, i8** %6
ret void
}

LLVM IR (-O2):
define void @platform_execute(i8* %0, i8* %1, i8* %2) {
%4 = tail call { i8*, i8*, i8* } asm sideeffect "movq $2, %rdi;movq $1, 0($0);movq $0, %rsp;call *0(%rsp);", "=r,=r,=r,0,1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1, i8* %2)
ret void
}
int cmpfunc(const void *a, const void *b) { return (-*(int *)a + *(int *)b); }


x86 assembly (clang, -O0):
<cmpfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmpfunc(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = sub nsw i32 0, %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = add nsw i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmpfunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub i32 %6, %4
ret i32 %7
}
int NextEDistList1(Schema, A)
struct univStruct *Schema;
struct EnrolledIn **A;
{
  (*A) = AccessEnrolledInEDistList1Next(*A);
  if ((*A) == 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<NextEDistList1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <AccessEnrolledInEDistList1Next@plt>
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1152 <NextEDistList1+0x42>
movl   $0x0,-0x4(%rbp)
jmp    1159 <NextEDistList1+0x49>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NextEDistList1>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rdi
xor    %eax,%eax
call   1030 <AccessEnrolledInEDistList1Next@plt>
movslq %eax,%rcx
mov    %rcx,(%rbx)
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.univStruct = type opaque
%struct.EnrolledIn = type opaque
define i32 @NextEDistList1(%struct.univStruct* %0, %struct.EnrolledIn** %1) {
%3 = alloca i32
%4 = alloca %struct.univStruct*
%5 = alloca %struct.EnrolledIn**
store %struct.univStruct* %0, %struct.univStruct** %4
store %struct.EnrolledIn** %1, %struct.EnrolledIn*** %5
%6 = load %struct.EnrolledIn**, %struct.EnrolledIn*** %5
%7 = load %struct.EnrolledIn*, %struct.EnrolledIn** %6
%8 = call i32 (%struct.EnrolledIn*, ...) bitcast (i32 (...)* @AccessEnrolledInEDistList1Next to i32 (%struct.EnrolledIn*, ...)*)(%struct.EnrolledIn* %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to %struct.EnrolledIn*
%11 = load %struct.EnrolledIn**, %struct.EnrolledIn*** %5
store %struct.EnrolledIn* %10, %struct.EnrolledIn** %11
%12 = load %struct.EnrolledIn**, %struct.EnrolledIn*** %5
%13 = load %struct.EnrolledIn*, %struct.EnrolledIn** %12
%14 = icmp eq %struct.EnrolledIn* %13, null
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %17
16: ; preds = %2
store i32 1, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.univStruct = type opaque
%struct.EnrolledIn = type opaque
define i32 @NextEDistList1(%struct.univStruct* nocapture readnone %0, %struct.EnrolledIn** nocapture %1) {
%3 = load %struct.EnrolledIn*, %struct.EnrolledIn** %1
%4 = tail call i32 (%struct.EnrolledIn*, ...) bitcast (i32 (...)* @AccessEnrolledInEDistList1Next to i32 (%struct.EnrolledIn*, ...)*)(%struct.EnrolledIn* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.EnrolledIn*
store %struct.EnrolledIn* %6, %struct.EnrolledIn** %1
%7 = icmp ne i32 %4, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ utest_control();
void utest_adts_math(void) {
  utest_control();
  return;
}


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

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

LLVM IR (-O0):
define void @utest_adts_math() {
%1 = call i32 (...) @utest_control()
ret void
}

LLVM IR (-O2):
define void @utest_adts_math() {
%1 = tail call i32 (...) @utest_control()
ret void
}
char *getEnumPuerOp(int value) {
  switch (value) {
  case 0:
    return "NOLL_PURE_EQ";
  case 1:
    return "NOLL_PURE_NEQ";
  default:
    return "NOLL_PURE_OTHER";
  }
}


x86 assembly (clang, -O0):
<getEnumPuerOp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <getEnumPuerOp+0x2b>
jmp    111a <getEnumPuerOp+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <getEnumPuerOp+0x3b>
jmp    114b <getEnumPuerOp+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <getEnumPuerOp+0x56>
lea    0xecb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <getEnumPuerOp+0x56>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getEnumPuerOp>:
cmp    $0x1,%edi
lea    0xf03(%rip),%rax
lea    0xf0a(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee2(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"NOLL_PURE_EQ\00"
@.str.1 = [14 x i8] c"NOLL_PURE_NEQ\00"
@.str.2 = [16 x i8] c"NOLL_PURE_OTHER\00"
define i8* @getEnumPuerOp(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"NOLL_PURE_EQ\00"
@.str.1 = [14 x i8] c"NOLL_PURE_NEQ\00"
@.str.2 = [16 x i8] c"NOLL_PURE_OTHER\00"
define i8* @getEnumPuerOp(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int seven();
int addone() { return seven() + 1; }


x86 assembly (clang, -O0):
<addone>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <seven@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addone>:
push   %rax
xor    %eax,%eax
call   1030 <seven@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @addone() {
%1 = call i32 (...) @seven()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @addone() {
%1 = tail call i32 (...) @seven()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pdispatch_new() {
  printf("NOT IMPLEMENTED:"
         "pa_pdispatch_new"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_pdispatch_new\0A\00"
define i32 @pa_pdispatch_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_pdispatch_new\00"
define i32 @pa_pdispatch_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int do_pk8pkey(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/,
               int, int /*<<< orphan*/ *, char *, int, int /*<<< orphan*/ *,
               void *);
int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, char *kstr,
                                      int klen, pem_password_cb *cb, void *u) {
  return do_pk8pkey(bp, x, 0, nid, NULL, kstr, klen, cb, u);
}


x86 assembly (clang, -O0):
<PEM_write_bio_PKCS8PrivateKey_nid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%r11d
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
xor    %edx,%edx
xor    %r8d,%r8d
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <do_pk8pkey@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_PKCS8PrivateKey_nid>:
push   %rax
mov    %r9,%rax
mov    %r8d,%r10d
mov    %rcx,%r9
mov    %edx,%ecx
sub    $0x8,%rsp
xor    %edx,%edx
xor    %r8d,%r8d
push   0x18(%rsp)
push   %rax
push   %r10
call   1030 <do_pk8pkey@plt>
add    $0x20,%rsp
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @PEM_write_bio_PKCS8PrivateKey_nid(i32* %0, i32* %1, i32 %2, i8* %3, i32 %4, i32* %5, i8* %6) {
%8 = tail call i32 @do_pk8pkey(i32* %0, i32* %1, i32 0, i32 %2, i32* null, i8* %3, i32 %4, i32* %5, i8* %6)
ret i32 %8
}
unsigned short int cast_short_ushort_fast(short int x) {
  return (unsigned short int)x;
}


x86 assembly (clang, -O0):
<cast_short_ushort_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_short_ushort_fast>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @cast_short_ushort_fast(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @cast_short_ushort_fast(i16 returned signext %0) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *xrealloc(void *old, size_t sz) {
  void *new = NULL;
  if (!(new = realloc(old, sz))) {
    fprintf(stderr, "failed to realloc %Zu bytes, exiting", sz);
    exit(1);
  }
  return new;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1186 <xrealloc+0x56>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe89(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1140 <xrealloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"failed to realloc %Zu bytes, exiting\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
store i8* null, i8** %5
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i64, i64* %4
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"failed to realloc %Zu bytes, exiting\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}