#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ test_build_max_heap(int, int);
int /*<<< orphan*/ test_expressionsmergesort(int /*<<< orphan*/, int);
int /*<<< orphan*/ test_mergesort(int, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  test_build_max_heap(0, 100);
  test_build_max_heap(1, 100);
  test_build_max_heap(10, 100);
  test_build_max_heap(50, 10);
  test_expressionsmergesort(0, 100);
  test_mergesort(1, 100);
  test_mergesort(10, 100);
  test_mergesort(50, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %edi,%edi
mov    $0x64,%esi
call   1070 <test_build_max_heap@plt>
mov    $0x1,%edi
mov    $0x64,%esi
call   1070 <test_build_max_heap@plt>
mov    $0xa,%edi
mov    $0x64,%esi
call   1070 <test_build_max_heap@plt>
mov    $0x32,%edi
mov    $0xa,%esi
call   1070 <test_build_max_heap@plt>
xor    %edi,%edi
mov    $0x64,%esi
call   1050 <test_expressionsmergesort@plt>
mov    $0x1,%edi
mov    $0x64,%esi
call   1060 <test_mergesort@plt>
mov    $0xa,%edi
mov    $0x64,%esi
call   1060 <test_mergesort@plt>
mov    $0x32,%edi
mov    $0xa,%esi
call   1060 <test_mergesort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %edi,%edi
mov    $0x64,%esi
call   1070 <test_build_max_heap@plt>
mov    $0x1,%edi
mov    $0x64,%esi
call   1070 <test_build_max_heap@plt>
mov    $0xa,%edi
mov    $0x64,%esi
call   1070 <test_build_max_heap@plt>
mov    $0x32,%edi
mov    $0xa,%esi
call   1070 <test_build_max_heap@plt>
xor    %edi,%edi
mov    $0x64,%esi
call   1050 <test_expressionsmergesort@plt>
mov    $0x1,%edi
mov    $0x64,%esi
call   1060 <test_mergesort@plt>
mov    $0xa,%edi
mov    $0x64,%esi
call   1060 <test_mergesort@plt>
mov    $0x32,%edi
mov    $0xa,%esi
call   1060 <test_mergesort@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 @test_build_max_heap(i32 0, i32 100)
%5 = call i32 @test_build_max_heap(i32 1, i32 100)
%6 = call i32 @test_build_max_heap(i32 10, i32 100)
%7 = call i32 @test_build_max_heap(i32 50, i32 10)
%8 = call i32 @test_expressionsmergesort(i32 0, i32 100)
%9 = call i32 @test_mergesort(i32 1, i32 100)
%10 = call i32 @test_mergesort(i32 10, i32 100)
%11 = call i32 @test_mergesort(i32 50, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 @test_build_max_heap(i32 0, i32 100)
%4 = tail call i32 @test_build_max_heap(i32 1, i32 100)
%5 = tail call i32 @test_build_max_heap(i32 10, i32 100)
%6 = tail call i32 @test_build_max_heap(i32 50, i32 10)
%7 = tail call i32 @test_expressionsmergesort(i32 0, i32 100)
%8 = tail call i32 @test_mergesort(i32 1, i32 100)
%9 = tail call i32 @test_mergesort(i32 10, i32 100)
%10 = tail call i32 @test_mergesort(i32 50, i32 10)
ret i32 0
}