xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int doskonala(int i);
  int liczba, i, suma;
  printf("Wszystkie liczby doskonałe mniejsze od 10 000 to: \n");
  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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Wszystkie liczby doskona\C5\82e mniejsze od 10 000 to: \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [52 x i8] c"Wszystkie liczby doskona\C5\82e mniejsze od 10 000 to: \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void test_getopt() {}


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

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

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

LLVM IR (-O2):
define void @test_getopt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CallBack1(int, int /*<<< orphan*/);
int /*<<< orphan*/ FetchWave(char const *);
void WaveModified(const char *waveName) { CallBack1(1, FetchWave(waveName)); }


x86 assembly (clang, -O0):
<WaveModified>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <FetchWave@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   1030 <CallBack1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaveModified>:
push   %rax
call   1040 <FetchWave@plt>
mov    $0x1,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <CallBack1@plt>

LLVM IR (-O0):
define void @WaveModified(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @FetchWave(i8* %3)
%5 = call i32 @CallBack1(i32 1, i32 %4)
ret void
}

LLVM IR (-O2):
define void @WaveModified(i8* %0) {
%2 = tail call i32 @FetchWave(i8* %0)
%3 = tail call i32 @CallBack1(i32 1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int tee_call_server_start();
int tee_callback_server_start();
int main(int argc, char **argv) {
  int ret = 0;
  ret = tee_call_server_start();
  if (ret != 0)
    return -1;
  ret = tee_callback_server_start();
  if (ret != 0)
    return -1;
  while (1)
    sleep(5);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <tee_call_server_start@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116d <main+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a1 <main+0x71>
mov    $0x0,%al
call   1040 <tee_callback_server_start@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     118d <main+0x5d>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a1 <main+0x71>
jmp    1192 <main+0x62>
mov    $0x5,%edi
call   1050 <sleep@plt>
jmp    1192 <main+0x62>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <tee_call_server_start@plt>
test   %eax,%eax
jne    1147 <main+0x17>
xor    %eax,%eax
call   1040 <tee_callback_server_start@plt>
test   %eax,%eax
je     1150 <main+0x20>
mov    $0xffffffff,%eax
pop    %rcx
ret
xchg   %ax,%ax
mov    $0x5,%edi
call   1050 <sleep@plt>
jmp    1150 <main+0x20>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @tee_call_server_start()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 (...) @tee_callback_server_start()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5, %8
%9 = tail call i32 @sleep(i32 5)
br label %8
10: ; preds = %5, %2
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ expect_null_failed(void *, char const *, int);
int /*<<< orphan*/ expectation_passed();
void _expect_null(void *act, const char *file, int line) {
  if ((act) == NULL)
    expectation_passed();
  else
    expect_null_failed(act, file, line);
}


x86 assembly (clang, -O0):
<_expect_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114a <_expect_null+0x2a>
mov    $0x0,%al
call   1030 <expectation_passed@plt>
jmp    115a <_expect_null+0x3a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <expect_null_failed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_expect_null>:
test   %rdi,%rdi
je     112a <_expect_null+0xa>
jmp    1040 <expect_null_failed@plt>
xor    %eax,%eax
jmp    1030 <expectation_passed@plt>

LLVM IR (-O0):
define void @_expect_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 i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 (...) @expectation_passed()
br label %16
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 @expect_null_failed(i8* %12, i8* %13, i32 %14)
br label %16
16: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
define void @_expect_null(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (...) @expectation_passed()
br label %9
7: ; preds = %3
%8 = tail call i32 @expect_null_failed(i8* %0, i8* %1, i32 %2)
br label %9
9: ; preds = %7, %5
ret void
}
void fun_three(int a, char b, void *c) {}


x86 assembly (clang, -O0):
<fun_three>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fun_three(i32 %0, i8 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8*
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @fun_three(i32 %0, i8 signext %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lis_test();
int main() { lis_test(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <lis_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @lis_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @lis_test()
ret i32 0
}
int sanity_assert_no_wsi_traces(const struct lws_context *context,
                                struct lws *wsi) {
  (void)context;
  (void)wsi;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.lws_context = type opaque
%struct.lws = type opaque
define i32 @sanity_assert_no_wsi_traces(%struct.lws_context* %0, %struct.lws* %1) {
%3 = alloca %struct.lws_context*
%4 = alloca %struct.lws*
store %struct.lws_context* %0, %struct.lws_context** %3
store %struct.lws* %1, %struct.lws** %4
%5 = load %struct.lws_context*, %struct.lws_context** %3
%6 = load %struct.lws*, %struct.lws** %4
ret i32 0
}

LLVM IR (-O2):
%struct.lws_context = type opaque
%struct.lws = type opaque
define i32 @sanity_assert_no_wsi_traces(%struct.lws_context* nocapture readnone %0, %struct.lws* nocapture readnone %1) {
ret i32 0
}
yyerror(msg) char *msg;
{
  long pos;
  yyGetPos(&pos);
  Error(msg, pos);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <yyGetPos@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <Error@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1040 <yyGetPos@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <Error@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @yyerror(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = call i32 (i64*, ...) bitcast (i32 (...)* @yyGetPos to i32 (i64*, ...)*)(i64* %4)
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @Error to i32 (i8*, i64, ...)*)(i8* %6, i64 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @yyerror(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 (i64*, ...) bitcast (i32 (...)* @yyGetPos to i32 (i64*, ...)*)(i64* %2)
%5 = load i64, i64* %2
%6 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @Error to i32 (i8*, i64, ...)*)(i8* %0, i64 %5)
ret i32 undef
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
int clock();
uint64_t gettime_clock() {
  return clock() * (1000000 / CLOCKS_PER_SEC);
  ;
}


x86 assembly (clang, -O0):
<gettime_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x4(%rbp)
mov    $0xf4240,%eax
mov    0x2eba(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime_clock>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%ecx
mov    0x2ec7(%rip),%rsi
mov    $0xf4240,%eax
xor    %edx,%edx
idivl  (%rsi)
imul   %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define i32 @gettime_clock() {
%1 = call i32 (...) @clock()
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sdiv i32 1000000, %2
%4 = mul nsw i32 %1, %3
ret i32 %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define i32 @gettime_clock() {
%1 = tail call i32 (...) @clock()
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sdiv i32 1000000, %2
%4 = mul nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
char const *ngettext(char const *, char const *, unsigned long);
scalar_t__ use_gettext_poison();
__attribute__((format_arg(1))) __attribute__((format_arg(2))) const char *
Q_(const char *msgid, const char *plu, unsigned long n) {
  if (use_gettext_poison())
    return "# GETTEXT POISON #";
  return ngettext(msgid, plu, n);
}


x86 assembly (clang, -O0):
<Q_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <use_gettext_poison@plt>
cmp    $0x0,%rax
je     1155 <Q_+0x35>
lea    0xeb4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <Q_+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <ngettext@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <use_gettext_poison@plt>
test   %rax,%rax
je     1147 <Q_+0x27>
lea    0xebf(%rip),%rax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <ngettext@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"# GETTEXT POISON #\00"
define i8* @Q_(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = call i64 (...) @use_gettext_poison()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %4
br label %16
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = call i8* @ngettext(i8* %12, i8* %13, i64 %14)
store i8* %15, i8** %4
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
@.str = [19 x i8] c"# GETTEXT POISON #\00"
define i8* @Q_(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 (...) @use_gettext_poison()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i8* @ngettext(i8* %0, i8* %1, i64 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i8* [ %7, %6 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %3 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned desired_number_of_snapshots(int interval_num, int num_intervals) {
  unsigned n;
  assert(interval_num >= 0);
  if (interval_num >= num_intervals)
    return 0;
  n = num_intervals - interval_num - 1;
  return 1 << n;
}


x86 assembly (clang, -O0):
<desired_number_of_snapshots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1147 <desired_number_of_snapshots+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1160 <desired_number_of_snapshots+0x50>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<desired_number_of_snapshots>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
mov    %edi,%ebp
not    %ebp
mov    %ebp,%edi
shr    $0x1f,%edi
call   1030 <assert@plt>
add    %r14d,%ebp
mov    $0x1,%edx
mov    %ebp,%ecx
shl    %cl,%edx
xor    %eax,%eax
cmp    %ebx,%r14d
cmovg  %edx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @desired_number_of_snapshots(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp sge i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %22
15: ; preds = %2
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = sub nsw i32 %16, %17
%19 = sub nsw i32 %18, 1
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = shl i32 1, %20
store i32 %21, i32* %3
br label %22
22: ; preds = %15, %14
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @desired_number_of_snapshots(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @assert(i32 %4)
%6 = icmp sgt i32 %1, %0
%7 = add i32 %3, %1
%8 = shl nuw i32 1, %7
%9 = select i1 %6, i32 %8, i32 0
ret i32 %9
}
int frob() { return 4; }


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

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

LLVM IR (-O0):
define i32 @frob() {
ret i32 4
}

LLVM IR (-O2):
define i32 @frob() {
ret i32 4
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char *const *, char const *, struct option const *,
                     int *, int /*<<< orphan*/);
int timidity_getopt_long(int argc, char *const *argv, const char *options,
                         const struct option *long_options, int *opt_index) {
  return _getopt_internal(argc, argv, options, long_options, opt_index, 0);
}


x86 assembly (clang, -O0):
<timidity_getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timidity_getopt_long>:
xor    %r9d,%r9d
jmp    1030 <_getopt_internal@plt>

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

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @timidity_getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 0)
ret i32 %6
}
/* Type definitions */
struct mntent {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int addmntent(FILE *stream, const struct mntent *mnt) {}


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

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

LLVM IR (-O0):
%struct.mntent = type { i32 }
define i32 @addmntent(i32* %0, %struct.mntent* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.mntent*
store i32* %0, i32** %4
store %struct.mntent* %1, %struct.mntent** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.mntent = type { i32 }
define i32 @addmntent(i32* nocapture readnone %0, %struct.mntent* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int rand();
int foo(void) {
  int a, b;
  int i;
  a = rand() % 65536;
  b = rand() % 65536;
  for (i = 0; i < b; i++)
    a += b;
  return a % 65536;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x10000,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x10000,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1166 <foo+0x56>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <foo+0x33>
mov    -0x4(%rbp),%eax
mov    $0x10000,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
lea    0xffff(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
and    $0xffff0000,%eax
sub    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffff0000,%ecx
sub    %ecx,%eax
mov    %eax,%ecx
imul   %ecx,%ecx
test   %eax,%eax
cmovle %ebp,%ecx
mov    %ebx,%eax
add    %ecx,%eax
lea    0xffff(%rcx,%rbx,1),%ecx
cmovns %eax,%ecx
and    $0xffff0000,%ecx
sub    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 65536
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 65536
%5 = icmp sgt i32 %4, 0
%6 = mul nuw i32 %4, %4
%7 = select i1 %5, i32 %6, i32 0
%8 = add i32 %2, %7
%9 = srem i32 %8, 65536
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int UINT32_C(int);
uint32_t rgph_murmur32s_fmix(uint32_t h) {
  h ^= h >> 16;
  h *= UINT32_C(0x85ebca6b);
  h ^= h >> 13;
  h *= UINT32_C(0xc2b2ae35);
  h ^= h >> 16;
  return h;
}


x86 assembly (clang, -O0):
<rgph_murmur32s_fmix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x85ebca6b,%edi
call   1030 <UINT32_C@plt>
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xd,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0xc2b2ae35,%edi
call   1030 <UINT32_C@plt>
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_murmur32s_fmix>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sar    $0x10,%ebp
xor    %edi,%ebp
mov    $0x85ebca6b,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ebx
imul   %ebp,%ebx
mov    %ebx,%eax
sar    $0xd,%eax
xor    %eax,%ebx
mov    $0xc2b2ae35,%edi
call   1030 <UINT32_C@plt>
imul   %ebx,%eax
mov    %eax,%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rgph_murmur32s_fmix(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = call i32 @UINT32_C(i32 -2048144789)
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, %7
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = ashr i32 %10, 13
%12 = load i32, i32* %2
%13 = xor i32 %12, %11
store i32 %13, i32* %2
%14 = call i32 @UINT32_C(i32 -1028477387)
%15 = load i32, i32* %2
%16 = mul nsw i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 16
%19 = load i32, i32* %2
%20 = xor i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @rgph_murmur32s_fmix(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = tail call i32 @UINT32_C(i32 -2048144789)
%5 = mul nsw i32 %4, %3
%6 = ashr i32 %5, 13
%7 = xor i32 %6, %5
%8 = tail call i32 @UINT32_C(i32 -1028477387)
%9 = mul nsw i32 %7, %8
%10 = ashr i32 %9, 16
%11 = xor i32 %10, %9
ret i32 %11
}
int config_WEBIF(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @config_WEBIF() {
ret i32 1
}
float min_f(float a, float b) {
  if (a >= b)
    return b;
  return a;
}


x86 assembly (clang, -O0):
<min_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     112c <min_f+0x2c>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <min_f+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_f>:
movaps %xmm1,%xmm2
cmpless %xmm0,%xmm2
andps  %xmm2,%xmm1
andnps %xmm0,%xmm2
orps   %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @min_f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp oge float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %5
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %4
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @min_f(float %0, float %1) {
%3 = fcmp oge float %0, %1
%4 = select i1 %3, float %1, float %0
ret float %4
}
/* Variables and functions */
int natural35(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Sum of all multiples of 3 or 5 below 1000: %d", natural35(1000));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e8,%edi
call   1040 <natural35@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"Sum of all multiples of 3 or 5 below 1000: %d\00"
define i32 @main() {
%1 = call i32 @natural35(i32 1000)
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"Sum of all multiples of 3 or 5 below 1000: %d\00"
define i32 @main() {
%1 = tail call i32 @natural35(i32 1000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IF_fct_2(char);
void IF_Linfeg(void) { IF_fct_2('i'); }


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

x86 assembly (clang, -O2):
<IF_Linfeg>:
mov    $0x69,%edi
jmp    1030 <IF_fct_2@plt>

LLVM IR (-O0):
define void @IF_Linfeg() {
%1 = call i32 @IF_fct_2(i8 signext 105)
ret void
}

LLVM IR (-O2):
define void @IF_Linfeg() {
%1 = tail call i32 @IF_fct_2(i8 signext 105)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgentry(void) {
  gen("pushq\t%rbp");
  gen("movq\t%rsp,%rbp");
}


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

x86 assembly (clang, -O2):
<cgentry>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <gen@plt>
lea    0xee7(%rip),%rdi
pop    %rax
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"pushq\09%rbp\00"
@.str.1 = [15 x i8] c"movq\09%rsp,%rbp\00"
define void @cgentry() {
%1 = call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"pushq\09%rbp\00"
@.str.1 = [15 x i8] c"movq\09%rsp,%rbp\00"
define void @cgentry() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "sync", message); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [5 x i8] c"sync\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void OCSP_REQINFO_free(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_REQINFO_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core9_print(char *, char const *);
void U_EMRARCTO_print(const char *contents) {
  core9_print("U_EMRARCTO", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRARCTO_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <core9_print@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"U_EMRARCTO\00"
define void @U_EMRARCTO_print(i8* %0) {
%2 = tail call i32 @core9_print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
__attribute__((visibility("default"))) float echo_float(float arg, ...) {
  return arg;
}


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

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

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

LLVM IR (-O2):
define float @echo_float(float returned %0, ...) {
ret float %0
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void iwait() {
  struct timeval t;
  fd_set r;
  fd_set w;
  int ret;
  FD_ZERO(&r);
  FD_SET(0, &r);
  FD_ZERO(&r);
  FD_SET(1, &w);
  t.tv_sec = 0;
  t.tv_usec = 8000;
  ret = select(2, &r, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<iwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x14(%rbp),%rdi
call   1030 <FD_ZERO@plt>
xor    %edi,%edi
lea    -0x14(%rbp),%rsi
call   1050 <FD_SET@plt>
lea    -0x14(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    $0x1,%edi
lea    -0x18(%rbp),%rsi
call   1050 <FD_SET@plt>
movq   $0x0,-0x8(%rbp)
movl   $0x1f40,-0x10(%rbp)
mov    $0x2,%edi
lea    -0x14(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1040 <select@plt>
mov    %eax,-0x1c(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iwait>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <FD_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <FD_SET@plt>
mov    %rbx,%rdi
call   1030 <FD_ZERO@plt>
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
call   1050 <FD_SET@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <select@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define void @iwait() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @FD_ZERO(i32* %2)
%6 = call i32 @FD_SET(i32 0, i32* %2)
%7 = call i32 @FD_ZERO(i32* %2)
%8 = call i32 @FD_SET(i32 1, i32* %3)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
store i64 0, i64* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
store i32 8000, i32* %10
%11 = call i32 @select(i32 2, i32* %2, i32* null, i32* null, i32* null)
store i32 %11, i32* %4
ret void
}

LLVM IR (-O2):
define void @iwait() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @FD_ZERO(i32* %1)
%6 = call i32 @FD_SET(i32 0, i32* %1)
%7 = call i32 @FD_ZERO(i32* %1)
%8 = call i32 @FD_SET(i32 1, i32* %2)
%9 = call i32 @select(i32 2, i32* %1, i32* null, i32* null, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ print(char *);
void thread_yield() {
  do {
    print("NYI\n");
    abort();
  } while (0);
}


x86 assembly (clang, -O0):
<thread_yield>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <thread_yield+0x9>
lea    0xed0(%rip),%rdi
call   1040 <print@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<thread_yield>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <print@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"NYI\0A\00"
define void @thread_yield() {
br label %1
1: ; preds = %0
%2 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
4: ; No predecessors!
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"NYI\0A\00"
define void @thread_yield() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
main() {
  int x = 1;
  return (*((char *)&x));
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}

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

/* Variables and functions */
int /*<<< orphan*/ pcn_out(int, int, int);
int com_ping(int p0, struct parameter *param) {
  (void)(param);
  pcn_out(p0, 502, 613);
  return 0;
}


x86 assembly (clang, -O0):
<com_ping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1f6,%esi
mov    $0x265,%edx
call   1030 <pcn_out@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<com_ping>:
push   %rax
mov    $0x1f6,%esi
mov    $0x265,%edx
call   1030 <pcn_out@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.parameter = type { i32 }
define i32 @com_ping(i32 %0, %struct.parameter* %1) {
%3 = alloca i32
%4 = alloca %struct.parameter*
store i32 %0, i32* %3
store %struct.parameter* %1, %struct.parameter** %4
%5 = load %struct.parameter*, %struct.parameter** %4
%6 = load i32, i32* %3
%7 = call i32 @pcn_out(i32 %6, i32 502, i32 613)
ret i32 0
}

LLVM IR (-O2):
%struct.parameter = type { i32 }
define i32 @com_ping(i32 %0, %struct.parameter* nocapture readnone %1) {
%3 = tail call i32 @pcn_out(i32 %0, i32 502, i32 613)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("test\r\n");
  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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"test\0D\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fabs(double);
int /*<<< orphan*/ fabsf(float);
int /*<<< orphan*/ fabsl(long double);
void uninitvar_fabs(void) {
  float f;
  (void)fabsf(f);
  double d;
  (void)fabs(d);
  long double ld;
  (void)fabsl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_fabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1030 <fabsf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <fabs@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <fabsl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_fabs>:
sub    $0x18,%rsp
call   1030 <fabsf@plt>
call   1050 <fabs@plt>
call   1040 <fabsl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_fabs() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @fabsf(float %4)
%6 = load double, double* %2
%7 = call i32 @fabs(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @fabsl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fabs() {
%1 = tail call i32 @fabsf(float undef)
%2 = tail call i32 @fabs(double undef)
%3 = tail call i32 @fabsl(x86_fp80 undef)
ret void
}
/* Variables and functions */
double trio_pinf();
double trio_ninf(void) {
  static double ninf_value = 0.0;
  if (ninf_value == 0.0) {
    ninf_value = -trio_pinf();
  }
  return ninf_value;
}


x86 assembly (clang, -O0):
<trio_ninf>:
push   %rbp
mov    %rsp,%rbp
movsd  0x2f14(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1155 <trio_ninf+0x45>
jp     1155 <trio_ninf+0x45>
mov    $0x0,%al
call   1030 <trio_pinf@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,0x2edb(%rip)
movsd  0x2ed3(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_ninf>:
push   %rax
movsd  0x2f17(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    113c <trio_ninf+0x2c>
jp     113c <trio_ninf+0x2c>
xor    %eax,%eax
call   1030 <trio_pinf@plt>
xorpd  0xecc(%rip),%xmm0
movlpd %xmm0,0x2ef4(%rip)
pop    %rax
ret

LLVM IR (-O0):
@trio_ninf.ninf_value = internal global double 0.000000e+00
define double @trio_ninf() {
%1 = load double, double* @trio_ninf.ninf_value
%2 = fcmp oeq double %1, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call double (...) @trio_pinf()
%5 = fneg double %4
store double %5, double* @trio_ninf.ninf_value
br label %6
6: ; preds = %3, %0
%7 = load double, double* @trio_ninf.ninf_value
ret double %7
}

LLVM IR (-O2):
@trio_ninf.ninf_value = internal unnamed_addr global double 0.000000e+00
define double @trio_ninf() {
%1 = load double, double* @trio_ninf.ninf_value
%2 = fcmp oeq double %1, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call double (...) @trio_pinf()
%5 = fneg double %4
store double %5, double* @trio_ninf.ninf_value
br label %6
6: ; preds = %3, %0
%7 = phi double [ %5, %3 ], [ %1, %0 ]
ret double %7
}
void __attribute__((no)) write_through_ptr(int *dst, int val) { *dst = val; }


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

x86 assembly (clang, -O2):
<write_through_ptr>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @write_through_ptr(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
/* Variables and functions */
int FALSE;
bool is_symlink(char *sp) {
  (sp += 0);
  return FALSE;
}


x86 assembly (clang, -O0):
<is_symlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_symlink>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@FALSE = global i32 0
define i32 @is_symlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8* %4, i8** %2
%5 = load i32, i32* @FALSE
ret i32 %5
}

LLVM IR (-O2):
@FALSE = global i32 0
define i32 @is_symlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @FALSE
ret i32 %2
}
/* Variables and functions */
int ustrchr_cnt(const unsigned char string[], const size_t length,
                const unsigned char c) {
  int count = 0;
  unsigned int i;
  for (i = 0; i < length; i++) {
    if (string[i] == c) {
      count++;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<ustrchr_cnt>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%rax
jae    115f <ustrchr_cnt+0x5f>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
movzbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114c <ustrchr_cnt+0x4c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1151 <ustrchr_cnt+0x51>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111f <ustrchr_cnt+0x1f>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustrchr_cnt>:
test   %rsi,%rsi
je     1126 <ustrchr_cnt+0x26>
xor    %ecx,%ecx
xor    %eax,%eax
nopl   0x0(%rax)
xor    %r8d,%r8d
cmp    %dl,(%rdi,%rcx,1)
sete   %r8b
add    %r8d,%eax
add    $0x1,%ecx
cmp    %rsi,%rcx
jb     1110 <ustrchr_cnt+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ustrchr_cnt(i8* nocapture %0, i64 %1, i8 zeroext %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %16, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %14, %5 ], [ 0, %3 ]
%7 = phi i32 [ %12, %5 ], [ 0, %3 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %2
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = add nuw nsw i64 %6, 1
%14 = and i64 %13, 4294967295
%15 = icmp ult i64 %14, %1
br i1 %15, label %5, label %16
16: ; preds = %5, %3
%17 = phi i32 [ 0, %3 ], [ %12, %5 ]
ret i32 %17
}
long double __div_func(long double d1, long double d2) { return d1 / d2; }


x86 assembly (clang, -O0):
<__div_func>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fdivrp %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__div_func>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fdivp  %st,%st(1)
ret

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

LLVM IR (-O2):
define x86_fp80 @__div_func(x86_fp80 %0, x86_fp80 %1) {
%3 = fdiv x86_fp80 %0, %1
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(short **);
int /*<<< orphan*/ freeShortVector(short *);
void freeShortMatrix(short int **matrix, int rows) {
  int i;
  for (i = 0; i < rows; i++)
    freeShortVector(matrix[i]);
  free(matrix);
}


x86 assembly (clang, -O0):
<freeShortMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <freeShortMatrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <freeShortVector@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <freeShortMatrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeShortMatrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1152 <freeShortMatrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1040 <freeShortVector@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <freeShortMatrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeShortMatrix(i16** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i16*, i16** %0, i64 %7
%9 = load i16*, i16** %8
%10 = tail call i32 @freeShortVector(i16* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @free(i16** %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool timer_expired32(uint32_t current, uint32_t future) {
  return (uint32_t)(current - future) < 0x80000000;
}


x86 assembly (clang, -O0):
<timer_expired32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x80000000,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @timer_expired32(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 = sub nsw i32 %5, %6
%8 = icmp ult i32 %7, -2147483648
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @timer_expired32(i32 %0, i32 %1) {
%3 = icmp sge i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}