xunge/DecIR huggingface dataset:
/* Variables and functions */
char *xstrdup(char const *);
char *mmp_str_pathUnixToSys(const char *str) { return xstrdup(str); }


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

x86 assembly (clang, -O2):
<mmp_str_pathUnixToSys>:
jmp    1030 <xstrdup@plt>

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

LLVM IR (-O2):
define i8* @mmp_str_pathUnixToSys(i8* %0) {
%2 = tail call i8* @xstrdup(i8* %0)
ret i8* %2
}
int anna_instr_is_short_circut(char instr) { return instr >= 64; }


x86 assembly (clang, -O0):
<anna_instr_is_short_circut>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x40,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<anna_instr_is_short_circut>:
xor    %eax,%eax
cmp    $0x40,%dil
setge  %al
ret

LLVM IR (-O0):
define i32 @anna_instr_is_short_circut(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 64
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @anna_instr_is_short_circut(i8 signext %0) {
%2 = icmp sgt i8 %0, 63
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ funcptr();
void test_load(void) {
  int i;
  for (i = 0; i < 10000000; i++)
    funcptr();
}


x86 assembly (clang, -O0):
<test_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x989680,-0x4(%rbp)
jge    1141 <test_load+0x31>
mov    $0x0,%al
call   1030 <funcptr@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test_load+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_load>:
push   %rbx
mov    $0x989680,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <funcptr@plt>
add    $0xffffffff,%ebx
jne    1120 <test_load+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @test_load() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @funcptr()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 10000000
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSDPT(const char *the_title) { return any_decrqss(the_title, "(p"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"(p\00"
define i32 @rpt_DECSDPT(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
void spt_setproctitle_fast(const char *title) { (void)title; }


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

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

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

LLVM IR (-O2):
define void @spt_setproctitle_fast(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lower(char *);
int /*<<< orphan*/ mu_fail(char *);
scalar_t__ strcmp(char *, char *);
void test_lower() {
  char text[10] = "Test Text";
  lower(text);
  do {
    if (!((strcmp(text, "test text") == 0))) {
      mu_fail("test_uppper: text should be 'test text'");
      return;
    }
  } while (0);
}


x86 assembly (clang, -O0):
<test_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xebe(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xa(%rbp),%rdi
call   1050 <lower@plt>
lea    -0xa(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1182 <test_lower+0x52>
lea    0xe9c(%rip),%rdi
call   1040 <mu_fail@plt>
jmp    1187 <test_lower+0x57>
jmp    1187 <test_lower+0x57>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lower>:
push   %rbx
sub    $0x10,%rsp
movabs $0x7865542074736554,%rax
54 65 78
mov    %rax,(%rsp)
movw   $0x74,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <lower@plt>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1175 <test_lower+0x45>
lea    0xea4(%rip),%rdi
call   1040 <mu_fail@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_lower.text = [10 x i8] c"Test Text\00"
@.str = [10 x i8] c"test text\00"
@.str.1 = [40 x i8] c"test_uppper: text should be 'test text'\00"
define void @test_lower() {
%1 = alloca [10 x i8]
%2 = bitcast [10 x i8]* %1 to i8*
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @lower(i8* %3)
br label %5
5: ; preds = %0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = call i32 @mu_fail(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %12
11: ; preds = %5
br label %12
12: ; preds = %9, %11
ret void
}

LLVM IR (-O2):
@__const.test_lower.text = [10 x i8] c"Test Text\00"
@.str = [10 x i8] c"test text\00"
@.str.1 = [40 x i8] c"test_uppper: text should be 'test text'\00"
define void @test_lower() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @lower(i8* %2)
%4 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @mu_fail(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %0, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char const *, char const *);
int cmp_substr(const char *haystack, const char *needle) {
  return strstr(haystack, needle) == NULL;
}


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

x86 assembly (clang, -O2):
<cmp_substr>:
push   %rax
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cmp_substr(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* @strstr(i8* %5, i8* %6)
%8 = icmp eq i32* %7, null
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @cmp_substr(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
int sn_decode_has(char *start, char *end, int size) {
  return (end - start) >= size;
}


x86 assembly (clang, -O0):
<sn_decode_has>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sn_decode_has>:
sub    %rdi,%rsi
movslq %edx,%rcx
xor    %eax,%eax
cmp    %rcx,%rsi
setge  %al
ret

LLVM IR (-O0):
define i32 @sn_decode_has(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = icmp sge i64 %11, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @sn_decode_has(i8* %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = sext i32 %2 to i64
%8 = icmp sge i64 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
int aom_codec_version(void) { return ((3 << 16) | (1 << 8) | (0)); }


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

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

LLVM IR (-O0):
define i32 @aom_codec_version() {
ret i32 196864
}

LLVM IR (-O2):
define i32 @aom_codec_version() {
ret i32 196864
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int file_exist(char *fname) {
  FILE *fp = fopen(fname, "rb");
  if (fp == NULL)
    return 0;
  else {
    fclose(fp);
    return 1;
  }
}


x86 assembly (clang, -O0):
<file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <file_exist+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <file_exist+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exist>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exist+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @file_exist(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double dtime() {
  double tsecs = 0.;
  struct timeval myt;
  gettimeofday(&myt, (struct timezone *)0);
  tsecs = (double)(myt.tv_sec + myt.tv_usec * 1.0e-6);
  return (tsecs);
}


x86 assembly (clang, -O0):
<dtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xec0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
%struct.timezone = type { i32 }
define double @dtime() {
%1 = alloca double
%2 = alloca %struct.timeval
store double 0.000000e+00, double* %1
%3 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%8 = load double, double* %7
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %6)
store double %9, double* %1
%10 = load double, double* %1
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
%struct.timezone = type { i32 }
define double @dtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void Usage(char *prog_name) {
  fprintf(stderr, "usage: %s <number of threads> <number of messages>\n",
          prog_name);
  fprintf(stderr, "   number of messages = number sent by each thread\n");
  exit(0);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"usage: %s <number of threads> <number of messages>\0A\00"
@.str.1 = [52 x i8] c" number of messages = number sent by each thread\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"usage: %s <number of threads> <number of messages>\0A\00"
@.str.1 = [52 x i8] c" number of messages = number sent by each thread\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
}
void math_cos(void) {
  double d = luaL_check_number(1);
  lua_pushnumber(cos(((d)*3.14159265358979323846 / 180.0)));
}


x86 assembly (clang, -O0):
<math_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <luaL_check_number@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeb3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <cos@plt>
mov    $0x1,%al
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_cos>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <luaL_check_number@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xeb7(%rip),%xmm0
divsd  0xeb7(%rip),%xmm0
call   1050 <cos@plt>
mov    $0x1,%al
pop    %rcx
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_cos() {
%1 = alloca double
%2 = call i32 (i32, ...) bitcast (i32 (...)* @luaL_check_number to i32 (i32, ...)*)(i32 1)
%3 = sitofp i32 %2 to double
store double %3, double* %1
%4 = load double, double* %1
%5 = fmul double %4, 0x400921FB54442D18
%6 = fdiv double %5, 1.800000e+02
%7 = call double @cos(double %6)
%8 = call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %7)
ret void
}

LLVM IR (-O2):
define void @math_cos() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @luaL_check_number to i32 (i32, ...)*)(i32 1)
%2 = sitofp i32 %1 to double
%3 = fmul double %2, 0x400921FB54442D18
%4 = fdiv double %3, 1.800000e+02
%5 = tail call double @cos(double %4)
%6 = tail call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %5)
ret void
}
void OpEA(void) { {}; }


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

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

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

LLVM IR (-O2):
define void @OpEA() {
ret void
}
void cov_serialize(long double f, unsigned char *buf, int length) {
  int i;
  union {
    unsigned char bytes[10];
    long double val;
  } bfconvert;
  bfconvert.val = f;
  for (i = 0; i < length; i++) {
    buf[i] = bfconvert.bytes[i];
  }
}


x86 assembly (clang, -O0):
<cov_serialize>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
fldt   -0x10(%rbp)
fstpt  -0x30(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    114b <cov_serialize+0x4b>
movslq -0x20(%rbp),%rax
mov    -0x30(%rbp,%rax,1),%dl
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111e <cov_serialize+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cov_serialize>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
test   %esi,%esi
jle    1129 <cov_serialize+0x19>
mov    %esi,%edx
mov    %rsp,%rsi
call   1030 <memcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%union.anon = type { x86_fp80 }
define void @cov_serialize(x86_fp80 %0, i8* %1, i32 %2) {
%4 = alloca x86_fp80
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %union.anon
store x86_fp80 %0, x86_fp80* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load x86_fp80, x86_fp80* %4
%10 = bitcast %union.anon* %8 to x86_fp80*
store x86_fp80 %9, x86_fp80* %10
store i32 0, i32* %7
br label %11
11: ; preds = %25, %3
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %28
15: ; preds = %11
%16 = bitcast %union.anon* %8 to [10 x i8]*
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %16, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = load i8*, i8** %5
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 %20, i8* %24
br label %25
25: ; preds = %15
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %11
28: ; preds = %11
ret void
}

LLVM IR (-O2):
%union.anon = type { x86_fp80 }
define void @cov_serialize(x86_fp80 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = alloca %union.anon
%5 = bitcast %union.anon* %4 to i8*
%6 = getelementptr inbounds %union.anon, %union.anon* %4, i64 0, i32 0
store x86_fp80 %0, x86_fp80* %6
%7 = icmp sgt i32 %2, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = zext i32 %2 to i64
br label %10
10: ; preds = %8, %3
ret void
}
int _open(const char *path, int flags, ...) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @_open(i8* nocapture readnone %0, i32 %1, ...) {
ret i32 1
}
float devi(float a, float b) { return a / b; }


x86 assembly (clang, -O0):
<devi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<devi>:
divss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @devi(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ fh_cli_write(char *);
void fh_cli_beep() { fh_cli_write("\7"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"\07\00"
define void @fh_cli_beep() {
%1 = call i32 @fh_cli_write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\07\00"
define void @fh_cli_beep() {
%1 = tail call i32 @fh_cli_write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void set_t0_t2_param(double *eta) { *eta = 1.0; }


x86 assembly (clang, -O0):
<set_t0_t2_param>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_t0_t2_param>:
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @set_t0_t2_param(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
store double 1.000000e+00, double* %3
ret void
}

LLVM IR (-O2):
define void @set_t0_t2_param(double* nocapture writeonly %0) {
store double 1.000000e+00, double* %0
ret void
}
void set_Center(unsigned char *pds, int center) { pds[4] = center; }


x86 assembly (clang, -O0):
<set_Center>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_Center>:
mov    %sil,0x4(%rdi)
ret

LLVM IR (-O0):
define void @set_Center(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 4
store i8 %6, i8* %8
ret void
}

LLVM IR (-O2):
define void @set_Center(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %3, i8* %4
ret void
}
int init_(void) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @init_() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
void TextStartup(void) { setbuf(stdout, NULL); }


x86 assembly (clang, -O0):
<TextStartup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TextStartup>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <setbuf@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @TextStartup() {
%1 = load i32, i32* @stdout
%2 = call i32 @setbuf(i32 %1, i32* null)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @TextStartup() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setbuf(i32 %1, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wd;

/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char wd[1024];
  getcwd(wd, sizeof(wd));
  printf("%s\n", wd);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @getcwd(i8* %4, i32 1024)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f3(void) { puts("f3() is working."); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"f3() is working.\00"
define void @f3() {
%1 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"f3() is working.\00"
define void @f3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int M_PI;
double cos(double);
double func8(double x) { return cos(x + M_PI / 3); }


x86 assembly (clang, -O0):
<func8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func8>:
mov    0x2ed1(%rip),%rax
movslq (%rax),%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
jmp    1030 <cos@plt>

LLVM IR (-O0):
@M_PI = global i32 0
define double @func8(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = sdiv i32 %4, 3
%6 = sitofp i32 %5 to double
%7 = fadd double %3, %6
%8 = call double @cos(double %7)
ret double %8
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @func8(double %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 %2, 3
%4 = sitofp i32 %3 to double
%5 = fadd double %4, %0
%6 = tail call double @cos(double %5)
ret double %6
}
void AYUVToUVRow_C() {}


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

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

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

LLVM IR (-O2):
define void @AYUVToUVRow_C() {
ret void
}
/* Variables and functions */
double dsfmt_gv_genrand_close1_open2();
double dsfmt_gv_genrand_close_open(void) {
  return dsfmt_gv_genrand_close1_open2() - 1.0;
}


x86 assembly (clang, -O0):
<dsfmt_gv_genrand_close_open>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dsfmt_gv_genrand_close1_open2@plt>
movsd  0xedd(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsfmt_gv_genrand_close_open>:
push   %rax
xor    %eax,%eax
call   1030 <dsfmt_gv_genrand_close1_open2@plt>
addsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dsfmt_gv_genrand_close_open() {
%1 = call double (...) @dsfmt_gv_genrand_close1_open2()
%2 = fsub double %1, 1.000000e+00
ret double %2
}

LLVM IR (-O2):
define double @dsfmt_gv_genrand_close_open() {
%1 = tail call double (...) @dsfmt_gv_genrand_close1_open2()
%2 = fadd double %1, -1.000000e+00
ret double %2
}
void add_ELF_words() {}


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

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

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

LLVM IR (-O2):
define void @add_ELF_words() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ client_creature_shutdown();
int /*<<< orphan*/ client_player_shutdown();
int /*<<< orphan*/ client_world_shutdown();
void client_game_shutdown() {
  client_creature_shutdown();
  client_player_shutdown();
  client_world_shutdown();
}


x86 assembly (clang, -O0):
<client_game_shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <client_creature_shutdown@plt>
mov    $0x0,%al
call   1040 <client_player_shutdown@plt>
mov    $0x0,%al
call   1050 <client_world_shutdown@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_game_shutdown>:
push   %rax
xor    %eax,%eax
call   1030 <client_creature_shutdown@plt>
xor    %eax,%eax
call   1040 <client_player_shutdown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <client_world_shutdown@plt>

LLVM IR (-O0):
define void @client_game_shutdown() {
%1 = call i32 (...) @client_creature_shutdown()
%2 = call i32 (...) @client_player_shutdown()
%3 = call i32 (...) @client_world_shutdown()
ret void
}

LLVM IR (-O2):
define void @client_game_shutdown() {
%1 = tail call i32 (...) @client_creature_shutdown()
%2 = tail call i32 (...) @client_player_shutdown()
%3 = tail call i32 (...) @client_world_shutdown()
ret void
}
/* Variables and functions */
int main(void) {
  size_t len;
  len = ~(sizeof(size_t) - 1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ up(struct semaphore *);
void triple_up(struct semaphore *s1, struct semaphore *s2,
               struct semaphore *s3) {
  up(s1);
  if (s1 != s2)
    up(s2);
  up(s3);
}


x86 assembly (clang, -O0):
<triple_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <up@plt>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1144 <triple_up+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <up@plt>
mov    -0x18(%rbp),%rdi
call   1030 <up@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triple_up>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <up@plt>
cmp    %r15,%rbx
je     1130 <triple_up+0x20>
mov    %r15,%rdi
call   1030 <up@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <up@plt>

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

LLVM IR (-O2):
%struct.semaphore = type { i32 }
define void @triple_up(%struct.semaphore* %0, %struct.semaphore* %1, %struct.semaphore* %2) {
%4 = tail call i32 @up(%struct.semaphore* %0)
%5 = icmp eq %struct.semaphore* %0, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @up(%struct.semaphore* %1)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @up(%struct.semaphore* %2)
ret void
}
/* Variables and functions */
size_t c_tree_max_size();
size_t c_multiset_max_size(void) { return c_tree_max_size(); }


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

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

LLVM IR (-O0):
define i64 @c_multiset_max_size() {
%1 = call i64 (...) @c_tree_max_size()
ret i64 %1
}

LLVM IR (-O2):
define i64 @c_multiset_max_size() {
%1 = tail call i64 (...) @c_tree_max_size()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ collect_supportsave_data();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void terminate_signal_handler() {
  collect_supportsave_data();
  exit(0);
}


x86 assembly (clang, -O0):
<terminate_signal_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <collect_supportsave_data@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<terminate_signal_handler>:
push   %rax
xor    %eax,%eax
call   1030 <collect_supportsave_data@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @terminate_signal_handler() {
%1 = call i32 (...) @collect_supportsave_data()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @terminate_signal_handler() {
%1 = tail call i32 (...) @collect_supportsave_data()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *benchmark_result() {
  static char result = '\0';
  (void)fprintf(stderr, "null_call (getppid)\n");
  return (&result);
}


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

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

LLVM IR (-O0):
@benchmark_result.result = internal global i8 0
@stderr = global i32 0
@.str = [21 x i8] c"null_call (getppid)\0A\00"
define i8* @benchmark_result() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i8* @benchmark_result.result
}

LLVM IR (-O2):
@benchmark_result.result = internal global i8 0
@stderr = global i32 0
@.str = [21 x i8] c"null_call (getppid)\0A\00"
define i8* @benchmark_result() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i8* @benchmark_result.result
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void my_abort(void) {
  char *c = NULL;
  *c = '\123';
  abort();
}


x86 assembly (clang, -O0):
<my_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x53,(%rax)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @my_abort() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
store i8 83, i8* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ DrawBMP226(unsigned long, unsigned long);
void drawbmp(unsigned long xd, unsigned long yd) { DrawBMP226(xd, yd); }


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

x86 assembly (clang, -O2):
<drawbmp>:
jmp    1030 <DrawBMP226@plt>

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

LLVM IR (-O2):
define void @drawbmp(i64 %0, i64 %1) {
%3 = tail call i32 @DrawBMP226(i64 %0, i64 %1)
ret void
}
/* Variables and functions */
int rand();
int dtls_prng(unsigned char *buf, size_t len) {
  while (len--)
    *buf++ = rand() & 0xFF;
  return 1;
}


x86 assembly (clang, -O0):
<dtls_prng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     115d <dtls_prng+0x4d>
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1120 <dtls_prng+0x10>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtls_prng>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1144 <dtls_prng+0x34>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <dtls_prng+0x20>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @dtls_prng(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
br label %5
5: ; preds = %9, %2
%6 = load i64, i64* %4
%7 = add i64 %6, -1
store i64 %7, i64* %4
%8 = icmp ne i64 %6, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = call i32 (...) @rand()
%11 = and i32 %10, 255
%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 i32 1
}

LLVM IR (-O2):
define i32 @dtls_prng(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %10, %4 ], [ %0, %2 ]
%7 = add i64 %5, -1
%8 = tail call i32 (...) @rand()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %9, i8* %6
%11 = icmp eq i64 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ passphrase_disable_echo1(int /*<<< orphan*/);
void passphrase_disable_echo(void) { passphrase_disable_echo1(STDIN_FILENO); }


x86 assembly (clang, -O0):
<passphrase_disable_echo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <passphrase_disable_echo1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<passphrase_disable_echo>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <passphrase_disable_echo1@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define void @passphrase_disable_echo() {
%1 = load i32, i32* @STDIN_FILENO
%2 = call i32 @passphrase_disable_echo1(i32 %1)
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define void @passphrase_disable_echo() {
%1 = load i32, i32* @STDIN_FILENO
%2 = tail call i32 @passphrase_disable_echo1(i32 %1)
ret void
}
int my_str_isupper(char *str) {
  int i;
  i = 0;
  while (str[i] != '\0') {
    if (str[i] >= 'A' && str[i] <= 'Z')
      i++;
    else
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<my_str_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116d <my_str_isupper+0x6d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
jl     115c <my_str_isupper+0x5c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5a,%eax
jg     115c <my_str_isupper+0x5c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1168 <my_str_isupper+0x68>
movl   $0x0,-0x4(%rbp)
jmp    1174 <my_str_isupper+0x74>
jmp    110f <my_str_isupper+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_isupper>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <my_str_isupper+0x23>
add    $0x1,%rdi
nop
add    $0xbf,%cl
cmp    $0x1a,%cl
jae    1124 <my_str_isupper+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <my_str_isupper+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @my_str_isupper(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %33, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %34
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 65
br i1 %20, label %21, label %32
21: ; preds = %13
%22 = load i8*, i8** %3
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 90
br i1 %28, label %29, label %32
29: ; preds = %21
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %33
32: ; preds = %21, %13
store i32 0, i32* %2
br label %35
33: ; preds = %29
br label %5
34: ; preds = %5
store i32 1, i32* %2
br label %35
35: ; preds = %34, %32
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
define i32 @my_str_isupper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -65
%12 = icmp ult i8 %11, 26
%13 = add nuw i64 %9, 1
br i1 %12, label %4, label %14
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
/* Variables and functions */
unsigned long htonl(unsigned long);
unsigned long anp_sys_htonl(unsigned long l) { return htonl(l); }


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

x86 assembly (clang, -O2):
<anp_sys_htonl>:
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i64 @anp_sys_htonl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @htonl(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @anp_sys_htonl(i64 %0) {
%2 = tail call i64 @htonl(i64 %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_fast64_t;

/* Variables and functions */
int /*<<< orphan*/ greatestPrimeFactor(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void problem3(uint_fast64_t number) {
  printf("Problem 3: The largest prime factor of %llu is %llu.\n", number,
         greatestPrimeFactor(number));
}


x86 assembly (clang, -O0):
<problem3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <greatestPrimeFactor@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<problem3>:
push   %rbx
mov    %edi,%ebx
call   1040 <greatestPrimeFactor@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Problem 3: The largest prime factor of %llu is %llu.\0A\00"
define void @problem3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @greatestPrimeFactor(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"Problem 3: The largest prime factor of %llu is %llu.\0A\00"
define void @problem3(i32 %0) {
%2 = tail call i32 @greatestPrimeFactor(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void show_n_char(char ch, int num) {
  int count;
  for (count = 1; count <= num; count++)
    putchar(ch);
}


x86 assembly (clang, -O0):
<show_n_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114b <show_n_char+0x3b>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <show_n_char+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_n_char>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <show_n_char+0x1c>
mov    %esi,%ebx
movsbl %dil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <show_n_char+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @show_n_char(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8, i8* %3
%12 = call i32 @putchar(i8 signext %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @show_n_char(i8 signext %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 1, %2 ]
%6 = tail call i32 @putchar(i8 signext %0)
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %5, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
void PEM_ASN1_read_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @PEM_ASN1_read_bio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void OTG_FS_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @OTG_FS_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @OTG_FS_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}