xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ ex_realloc(unsigned int *, int);
void push_node_stack(unsigned int node, unsigned int **stack,
                     unsigned int *stack_size) {
  unsigned int new_stack_size = ++(*stack_size);
  *stack =
      (unsigned int *)ex_realloc(*stack, sizeof(unsigned int) * new_stack_size);
  (*stack)[new_stack_size - 1] = node;
}


x86 assembly (clang, -O0):
<push_node_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x1c(%rbp),%eax
shl    $0x2,%rax
mov    %eax,%esi
call   1030 <ex_realloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_node_stack>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    (%rdx),%ebp
lea    0x1(%rbp),%eax
mov    %eax,(%rdx)
mov    (%rsi),%rdi
lea    0x4(,%rbp,4),%esi
call   1030 <ex_realloc@plt>
mov    %rax,(%rbx)
mov    %r14d,(%rax,%rbp,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @push_node_stack(i32 %0, i32** %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32**
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32** %1, i32*** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
%10 = add i32 %9, 1
store i32 %10, i32* %8
store i32 %10, i32* %7
%11 = load i32**, i32*** %5
%12 = load i32*, i32** %11
%13 = load i32, i32* %7
%14 = zext i32 %13 to i64
%15 = mul i64 4, %14
%16 = trunc i64 %15 to i32
%17 = call i64 @ex_realloc(i32* %12, i32 %16)
%18 = inttoptr i64 %17 to i32*
%19 = load i32**, i32*** %5
store i32* %18, i32** %19
%20 = load i32, i32* %4
%21 = load i32**, i32*** %5
%22 = load i32*, i32** %21
%23 = load i32, i32* %7
%24 = sub i32 %23, 1
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %22, i64 %25
store i32 %20, i32* %26
ret void
}

LLVM IR (-O2):
define void @push_node_stack(i32 %0, i32** nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = add i32 %4, 1
store i32 %5, i32* %2
%6 = load i32*, i32** %1
%7 = shl i32 %5, 2
%8 = tail call i64 @ex_realloc(i32* %6, i32 %7)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %1
%10 = zext i32 %4 to i64
%11 = getelementptr inbounds i32, i32* %9, i64 %10
store i32 %0, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_SOFTWARE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ pgp_show_stacktrace();
int /*<<< orphan*/ stderr;
void __pgp_null(const char *_function_name, const char *_file_name,
                int _line_number) {
  fprintf(stderr, "Unhandled NULL occurred: file=%s, function=%s, line=%d\n",
          _file_name, _function_name, _line_number);
  pgp_show_stacktrace();
  exit(EX_SOFTWARE);
}


x86 assembly (clang, -O0):
<__pgp_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <pgp_show_stacktrace@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<__pgp_null>:
push   %rax
mov    %edx,%r8d
mov    %rsi,%rdx
mov    %rdi,%rcx
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <pgp_show_stacktrace@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"Unhandled NULL occurred: file=%s, function=%s, line=%d\0A\00"
@EX_SOFTWARE = global i32 0
define void @__pgp_null(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 i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
%12 = call i32 (...) @pgp_show_stacktrace()
%13 = load i32, i32* @EX_SOFTWARE
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"Unhandled NULL occurred: file=%s, function=%s, line=%d\0A\00"
@EX_SOFTWARE = global i32 0
define void @__pgp_null(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0, i32 %2)
%6 = tail call i32 (...) @pgp_show_stacktrace()
%7 = load i32, i32* @EX_SOFTWARE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
int shademodel_(m)
int *m;
{}


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

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

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

LLVM IR (-O2):
define i32 @shademodel_(i32* nocapture readnone %0) {
ret i32 undef
}
void __DELETE_java_lang_Byte(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_lang_Byte(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_lang_Byte(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int metric_killing(int mu) {
  if (mu == 0)
    return 1;
  return 0;
}


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

x86 assembly (clang, -O2):
<metric_killing>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @metric_killing(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int DoSum(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<DoSum>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @DoSum(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @DoSum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void XDefaultGC() {}


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

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

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

LLVM IR (-O2):
define void @XDefaultGC() {
ret void
}
/* Variables and functions */
scalar_t__ GetOptInt(int *, char ***, char const *, int *);
int GetOptLong(int *argc, char ***argv, const char *flag, long *n) {
  int i;
  if (GetOptInt(argc, argv, flag, &i)) {
    *n = (long)i;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<GetOptLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
call   1030 <GetOptInt@plt>
cmp    $0x0,%rax
je     115e <GetOptLong+0x4e>
movslq -0x2c(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1165 <GetOptLong+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetOptLong>:
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%rbx
lea    0xc(%rsp),%rcx
call   1030 <GetOptInt@plt>
test   %rax,%rax
je     1136 <GetOptLong+0x26>
movslq 0xc(%rsp),%rax
mov    %rax,(%rbx)
mov    $0x1,%eax
jmp    1138 <GetOptLong+0x28>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @GetOptLong(i32* %0, i8*** %1, i8* %2, i64* nocapture writeonly %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = call i64 @GetOptInt(i32* %0, i8*** %1, i8* %2, i32* %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
store i64 %11, i64* %3
br label %12
12: ; preds = %4, %9
%13 = phi i32 [ 1, %9 ], [ 0, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ FlashFSReset();
int /*<<< orphan*/ testcase_1();
int /*<<< orphan*/ testcase_3();
int /*<<< orphan*/ testcase_4();
int /*<<< orphan*/ testcase_5();
int main() {
  testcase_1();
  FlashFSReset();
  testcase_3();
  FlashFSReset();
  testcase_4();
  FlashFSReset();
  testcase_5();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <testcase_1@plt>
mov    $0x0,%al
call   1070 <FlashFSReset@plt>
mov    $0x0,%al
call   1050 <testcase_3@plt>
mov    $0x0,%al
call   1070 <FlashFSReset@plt>
mov    $0x0,%al
call   1030 <testcase_4@plt>
mov    $0x0,%al
call   1070 <FlashFSReset@plt>
mov    $0x0,%al
call   1040 <testcase_5@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <testcase_1@plt>
xor    %eax,%eax
call   1070 <FlashFSReset@plt>
xor    %eax,%eax
call   1050 <testcase_3@plt>
xor    %eax,%eax
call   1070 <FlashFSReset@plt>
xor    %eax,%eax
call   1030 <testcase_4@plt>
xor    %eax,%eax
call   1070 <FlashFSReset@plt>
xor    %eax,%eax
call   1040 <testcase_5@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @testcase_1()
%2 = call i32 (...) @FlashFSReset()
%3 = call i32 (...) @testcase_3()
%4 = call i32 (...) @FlashFSReset()
%5 = call i32 (...) @testcase_4()
%6 = call i32 (...) @FlashFSReset()
%7 = call i32 (...) @testcase_5()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testcase_1()
%2 = tail call i32 (...) @FlashFSReset()
%3 = tail call i32 (...) @testcase_3()
%4 = tail call i32 (...) @FlashFSReset()
%5 = tail call i32 (...) @testcase_4()
%6 = tail call i32 (...) @FlashFSReset()
%7 = tail call i32 (...) @testcase_5()
ret i32 0
}
/* Variables and functions */
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int str_startswith(char *stra, char *strb) {
  int len = strlen(strb);
  return strncmp(stra, strb, len) == 0;
}


x86 assembly (clang, -O0):
<str_startswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_startswith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @str_startswith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i64 @strncmp(i8* %8, i8* %9, i32 %10)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @str_startswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fseek(int /*<<< orphan*/ *, long, int);
void vseek(FILE *fp, long offset, int whence, bool *is_valid) {
  if (is_valid && fseek(fp, offset, whence) != 0)
    is_valid = false;
}


x86 assembly (clang, -O0):
<vseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1154 <vseek+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <fseek@plt>
cmp    $0x0,%rax
je     1154 <vseek+0x44>
movq   $0x0,-0x20(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vseek>:
test   %rcx,%rcx
je     111a <vseek+0xa>
jmp    1030 <fseek@plt>
ret

LLVM IR (-O0):
define void @vseek(i32* %0, i64 %1, i32 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %8
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = load i32*, i32** %5
%13 = load i64, i64* %6
%14 = load i32, i32* %7
%15 = call i64 @fseek(i32* %12, i64 %13, i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %11
store i32* null, i32** %8
br label %18
18: ; preds = %17, %11, %4
ret void
}

LLVM IR (-O2):
define void @vseek(i32* nocapture %0, i64 %1, i32 %2, i32* readnone %3) {
%5 = icmp eq i32* %3, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i64 @fseek(i32* %0, i64 %1, i32 %2)
br label %8
8: ; preds = %6, %4
ret void
}
int test_imm_E3int8_mem(signed char *val) {
  return ((*val) & (0xE3 << 0)) ? -20 : -40;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @user_debug(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, Bigsby!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, Bigsby!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, Bigsby!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
IR0AX1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*p0) <= (((unsigned int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
movslq -0x14(%rbp),%rdx
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
ja     113c <IR0AX1+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <IR0AX1+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AX1>:
mov    (%r8),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(,%rcx,4),%edx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @IR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = load i32, i32* %4
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %8
%10 = load i32, i32* %9
%11 = icmp ule i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int M_PI;
float const fabsf(float);
float sinf(float x) {
  const float B = 4 / M_PI;
  const float C = -4 / (M_PI * M_PI);
  float y = B * x + C * x * fabsf(x);
  return y;
}


x86 assembly (clang, -O0):
<sinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x4,%eax
mov    0x2ebf(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea3(%rip),%rax
imul   (%rax),%ecx
mov    $0xfffffffc,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabsf@plt>
movss  -0x1c(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x14(%rbp),%xmm0
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinf>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%ecx
mov    $0x4,%eax
xor    %edx,%edx
idiv   %ecx
cvtsi2ss %eax,%xmm1
imul   %ecx,%ecx
mov    $0xfffffffc,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm0,%xmm1
andps  0xecc(%rip),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @sinf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %2
%6 = load i32, i32* @M_PI
%7 = sdiv i32 4, %6
%8 = sitofp i32 %7 to float
store float %8, float* %3
%9 = load i32, i32* @M_PI
%10 = load i32, i32* @M_PI
%11 = mul nsw i32 %9, %10
%12 = sdiv i32 -4, %11
%13 = sitofp i32 %12 to float
store float %13, float* %4
%14 = load float, float* %3
%15 = load float, float* %2
%16 = load float, float* %4
%17 = load float, float* %2
%18 = fmul float %16, %17
%19 = load float, float* %2
%20 = call float @fabsf(float %19)
%21 = fmul float %18, %20
%22 = call float @llvm.fmuladd.f32(float %14, float %15, float %21)
store float %22, float* %5
%23 = load float, float* %5
ret float %23
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @sinf(float %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 4, %2
%4 = sitofp i32 %3 to float
%5 = mul nsw i32 %2, %2
%6 = sdiv i32 -4, %5
%7 = sitofp i32 %6 to float
%8 = fmul float %7, %0
%9 = tail call float @llvm.fabs.f32(float %0)
%10 = fmul float %9, %8
%11 = tail call float @llvm.fmuladd.f32(float %4, float %0, float %10)
ret float %11
}
/* Variables and functions */
void *aMalloc_(size_t, char const *, int, char const *);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *aCalloc_(size_t num, size_t size, const char *file, int line,
               const char *func) {
  void *p = aMalloc_(num * size, file, line, func);
  memset(p, 0, num * size);
  return p;
}


x86 assembly (clang, -O0):
<aCalloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1040 <aMalloc_@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aCalloc_>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %r8,%rcx
call   1040 <aMalloc_@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @aCalloc_(i64 %0, i64 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
store i64 %0, i64* %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = mul i64 %12, %13
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i8*, i8** %10
%18 = call i8* @aMalloc_(i64 %14, i8* %15, i32 %16, i8* %17)
store i8* %18, i8** %11
%19 = load i8*, i8** %11
%20 = load i64, i64* %6
%21 = load i64, i64* %7
%22 = mul i64 %20, %21
%23 = call i32 @memset(i8* %19, i32 0, i64 %22)
%24 = load i8*, i8** %11
ret i8* %24
}

LLVM IR (-O2):
define i8* @aCalloc_(i64 %0, i64 %1, i8* %2, i32 %3, i8* %4) {
%6 = mul i64 %1, %0
%7 = tail call i8* @aMalloc_(i64 %6, i8* %2, i32 %3, i8* %4)
%8 = tail call i32 @memset(i8* %7, i32 0, i64 %6)
ret i8* %7
}
/* Variables and functions */
int strcmp(char *, char *);
int cmp_string_asc(const void *x, const void *y) {
  return strcmp(*(char **)x, *(char **)y);
}


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

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

LLVM IR (-O0):
define i32 @cmp_string_asc(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 i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp_string_asc(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 ld_ne_rc1(long double a1) { return (((a1) != (100))); }


x86 assembly (clang, -O0):
<ld_ne_rc1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
setp   %cl
setne  %al
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ne_rc1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
setne  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ld_ne_rc1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp une x86_fp80 %3, 0xK4005C800000000000000
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_ne_rc1(x86_fp80 %0) {
%2 = fcmp une x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage(void) {
  fprintf(stderr, "usage: gpttool write <disk> [ <partition> ]*\n"
                  "       gpttool read <disk>\n"
                  "       gpttool test [ <partition> ]*\n"
                  "\n"
                  "partition:  [<name>]:<size>[kmg] | @<file-of-partitions>\n");
  return 0;
}


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>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [168 x i8] c"usage: gpttool write <disk> [ <partition> ]*\0A gpttool read <disk>\0A gpttool test [ <partition> ]*\0A\0Apartition: [<name>]:<size>[kmg] | @<file-of-partitions>\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [168 x i8] c"usage: gpttool write <disk> [ <partition> ]*\0A gpttool read <disk>\0A gpttool test [ <partition> ]*\0A\0Apartition: [<name>]:<size>[kmg] | @<file-of-partitions>\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *japi_getseltext(int, char *);
char *j_getseltext(int arg0, char *arg1) {
  return (japi_getseltext(arg0, arg1));
}


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

x86 assembly (clang, -O2):
<j_getseltext>:
jmp    1030 <japi_getseltext@plt>

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

LLVM IR (-O2):
define i8* @j_getseltext(i32 %0, i8* %1) {
%3 = tail call i8* @japi_getseltext(i32 %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void EC_DHE_handleErrors(const char *msg) {
  if (msg != 0) {
    printf("%s", msg);
  }
}


x86 assembly (clang, -O0):
<EC_DHE_handleErrors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <EC_DHE_handleErrors+0x27>
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EC_DHE_handleErrors>:
test   %rdi,%rdi
je     1124 <EC_DHE_handleErrors+0x14>
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @EC_DHE_handleErrors(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @EC_DHE_handleErrors(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_ALGOR;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_ALGOR_it;
X509_ALGOR *d2i_X509_ALGOR(X509_ALGOR **a, const unsigned char **in, long len) {
  return (X509_ALGOR *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_ALGOR_it);
}


x86 assembly (clang, -O0):
<d2i_X509_ALGOR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_X509_ALGOR>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@X509_ALGOR_it = global i32 0
define i32* @d2i_X509_ALGOR(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @X509_ALGOR_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@X509_ALGOR_it = global i32 0
define i32* @d2i_X509_ALGOR(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @X509_ALGOR_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ readbyte();
void readbytes(unsigned char *ptr, int len) {
  while (len > 0)
    len--, *ptr++ = readbyte();
}


x86 assembly (clang, -O0):
<readbytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1151 <readbytes+0x41>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <readbyte@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    111f <readbytes+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readbytes>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1135 <readbytes+0x25>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
nop
xor    %eax,%eax
call   1030 <readbyte@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <readbytes+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @readbytes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
store i32 %10, i32* %4
%11 = call i32 (...) @readbyte()
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
store i8 %12, i8* %13
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @readbytes(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %10, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = tail call i32 (...) @readbyte()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %9, i8* %6
%11 = icmp ugt i32 %5, 1
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
int isprime(int n) {
  int i;
  i = 2;
  while (i < n) {
    if (n % i == 0)
      return (-1);
    i++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1144 <isprime+0x44>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isprime+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114b <isprime+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isprime+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
xor    %ecx,%ecx
cmp    $0x3,%edi
jl     1120 <isprime+0x20>
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isprime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isprime+0x10>
mov    %ecx,%eax
ret
mov    $0xffffffff,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isprime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 -1, i32* %2
br label %19
15: ; preds = %9
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %5
store i32 0, i32* %2
br label %19
19: ; preds = %18, %14
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ -1, %5 ]
ret i32 %11
}
/* Variables and functions */
void _memset(void *dst, unsigned char c, size_t len) {
  unsigned char *a = dst;
  size_t i;
  for (i = 0; i < len; ++i)
    a[i] = c;
}


x86 assembly (clang, -O0):
<_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114f <_memset+0x4f>
mov    -0x9(%rbp),%dl
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1122 <_memset+0x22>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_memset>:
test   %rdx,%rdx
je     1123 <_memset+0x13>
push   %rax
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @_memset(i8* %0, i8 zeroext %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8 %1, i8* %5
store i64 %2, i64* %6
%9 = load i8*, i8** %4
store i8* %9, i8** %7
store i64 0, i64* %8
br label %10
10: ; preds = %19, %3
%11 = load i64, i64* %8
%12 = load i64, i64* %6
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i8, i8* %5
%16 = load i8*, i8** %7
%17 = load i64, i64* %8
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8 %15, i8* %18
br label %19
19: ; preds = %14
%20 = load i64, i64* %8
%21 = add i64 %20, 1
store i64 %21, i64* %8
br label %10
22: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @_memset(i8* nocapture writeonly %0, i8 zeroext %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %3
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
double exp(int);
double s(double v) {
  if (v > 5)
    return 1.0;
  else if (v < -5)
    return 0.0;
  else
    return 1.0 / (1.0 + exp(-1 * v));
}


x86 assembly (clang, -O0):

:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <s+0x36>
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1199 <s+0x89>
movsd  0xeba(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1166 <s+0x56>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1199 <s+0x89>
movsd  0xeaa(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  0xe8c(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe80(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):

:
push   %rax
ucomisd 0xeef(%rip),%xmm0
jbe    1125 <s+0x15>
movsd  0xedd(%rip),%xmm0
pop    %rax
ret
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
movsd  0xedb(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1160 <s+0x50>
xorpd  0xedd(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <exp@plt>
movapd %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @s(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 5.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %18
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, -5.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store double 0.000000e+00, double* %2
br label %18
11: ; preds = %7
%12 = load double, double* %3
%13 = fmul double -1.000000e+00, %12
%14 = fptosi double %13 to i32
%15 = call double @exp(i32 %14)
%16 = fadd double 1.000000e+00, %15
%17 = fdiv double 1.000000e+00, %16
store double %17, double* %2
br label %18
18: ; preds = %11, %10, %6
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @s(double %0) {
%2 = fcmp ogt double %0, 5.000000e+00
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = fcmp olt double %0, -5.000000e+00
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = fneg double %0
%7 = fptosi double %6 to i32
%8 = tail call double @exp(i32 %7)
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double 1.000000e+00, %9
br label %11
11: ; preds = %3, %1, %5
%12 = phi double [ %10, %5 ], [ 1.000000e+00, %1 ], [ 0.000000e+00, %3 ]
ret double %12
}
void xyccc(short ix, short iy, float *x, float *y) {
  *x = ((float)ix) / 1000.0;
  *y = ((float)iy) / 1000.0;
}


x86 assembly (clang, -O0):
<xyccc>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movswl -0x2(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movswl -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeae(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyccc>:
cvtsi2sd %edi,%xmm0
movsd  0xef4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rdx)
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rcx)
ret

LLVM IR (-O0):
define void @xyccc(i16 signext %0, i16 signext %1, float* %2, float* %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca float*
%8 = alloca float*
store i16 %0, i16* %5
store i16 %1, i16* %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load i16, i16* %5
%10 = sitofp i16 %9 to float
%11 = fpext float %10 to double
%12 = fdiv double %11, 1.000000e+03
%13 = fptrunc double %12 to float
%14 = load float*, float** %7
store float %13, float* %14
%15 = load i16, i16* %6
%16 = sitofp i16 %15 to float
%17 = fpext float %16 to double
%18 = fdiv double %17, 1.000000e+03
%19 = fptrunc double %18 to float
%20 = load float*, float** %8
store float %19, float* %20
ret void
}

LLVM IR (-O2):
define void @xyccc(i16 signext %0, i16 signext %1, float* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = sitofp i16 %0 to double
%6 = fdiv double %5, 1.000000e+03
%7 = fptrunc double %6 to float
store float %7, float* %2
%8 = sitofp i16 %1 to double
%9 = fdiv double %8, 1.000000e+03
%10 = fptrunc double %9 to float
store float %10, float* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: ypset [-h host] [-d domain] server\n");
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"usage: ypset [-h host] [-d domain] server\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ grtestmod_write(int, int);
void chkp(int n) { grtestmod_write(6, n); }


x86 assembly (clang, -O0):
<chkp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x6,%edi
call   1030 <grtestmod_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chkp>:
mov    %edi,%esi
mov    $0x6,%edi
jmp    1030 <grtestmod_write@plt>

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

LLVM IR (-O2):
define void @chkp(i32 %0) {
%2 = tail call i32 @grtestmod_write(i32 6, i32 %0)
ret void
}
void alarmHandler(int signo) {}


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

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

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

LLVM IR (-O2):
define void @alarmHandler(i32 %0) {
ret void
}
/* Variables and functions */
char *level2_0_s(char *, size_t, int, char *, size_t *);
int /*<<< orphan*/ ntos(int, char *, size_t *);
char *level2_0(int num, int ge, char *regstr, size_t *reglen) {
  char str[128], *s = str, d;
  size_t len = sizeof str;
  ntos(num, str, &len);
  return level2_0_s(str, len, ge, regstr, reglen);
}


x86 assembly (clang, -O0):
<level2_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0xa8(%rbp)
movq   $0x80,-0xb8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xa0(%rbp),%rsi
lea    -0xb8(%rbp),%rdx
call   1030 <ntos@plt>
lea    -0xa0(%rbp),%rdi
mov    -0xb8(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1040 <level2_0_s@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<level2_0>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%ebp
movq   $0x80,0x8(%rsp)
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%rdx
mov    %r15,%rsi
call   1030 <ntos@plt>
mov    0x8(%rsp),%rsi
mov    %r15,%rdi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %r14,%r8
call   1040 <level2_0_s@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @level2_0(i32 %0, i32 %1, i8* %2, i64* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca [128 x i8]
%10 = alloca i8*
%11 = alloca i8
%12 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64* %3, i64** %8
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
store i8* %13, i8** %10
store i64 128, i64* %12
%14 = load i32, i32* %5
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%16 = call i32 @ntos(i32 %14, i8* %15, i64* %12)
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%18 = load i64, i64* %12
%19 = load i32, i32* %6
%20 = load i8*, i8** %7
%21 = load i64*, i64** %8
%22 = call i8* @level2_0_s(i8* %17, i64 %18, i32 %19, i8* %20, i64* %21)
ret i8* %22
}

LLVM IR (-O2):
define i8* @level2_0(i32 %0, i32 %1, i8* %2, i64* %3) {
%5 = alloca [128 x i8]
%6 = alloca i64
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%8 = bitcast i64* %6 to i8*
store i64 128, i64* %6
%9 = call i32 @ntos(i32 %0, i8* %7, i64* %6)
%10 = load i64, i64* %6
%11 = call i8* @level2_0_s(i8* %7, i64 %10, i32 %1, i8* %2, i64* %3)
ret i8* %11
}
void pcp_print_net_ip6_stats(struct activity *a, int curr) {}


x86 assembly (clang, -O0):
<pcp_print_net_ip6_stats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_net_ip6_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
void exit(status) int status;
{
  _CommonStdioShutdown();
  _exit(status);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <_CommonStdioShutdown@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <_CommonStdioShutdown@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @_CommonStdioShutdown()
%4 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 (...) @_CommonStdioShutdown()
tail call void @_exit(i32 %0)
unreachable
}