#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*/ display();
int extractMin();
int /*<<< orphan*/ insertMinHeap(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  insertMinHeap(2);
  insertMinHeap(3);
  insertMinHeap(5);
  insertMinHeap(4);
  insertMinHeap(50);
  insertMinHeap(300);
  insertMinHeap(40);
  insertMinHeap(500);
  insertMinHeap(30);
  display();
  printf("\n");
  for (int i = 0; i < 6; i++)
    printf("%d ", extractMin());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1060 <insertMinHeap@plt>
mov    $0x3,%edi
call   1060 <insertMinHeap@plt>
mov    $0x5,%edi
call   1060 <insertMinHeap@plt>
mov    $0x4,%edi
call   1060 <insertMinHeap@plt>
mov    $0x32,%edi
call   1060 <insertMinHeap@plt>
mov    $0x12c,%edi
call   1060 <insertMinHeap@plt>
mov    $0x28,%edi
call   1060 <insertMinHeap@plt>
mov    $0x1f4,%edi
call   1060 <insertMinHeap@plt>
mov    $0x1e,%edi
call   1060 <insertMinHeap@plt>
mov    $0x0,%al
call   1030 <display@plt>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    11f4 <main+0xb4>
mov    $0x0,%al
call   1050 <extractMin@plt>
mov    %eax,%esi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c5 <main+0x85>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2,%edi
call   1070 <insertMinHeap@plt>
mov    $0x3,%edi
call   1070 <insertMinHeap@plt>
mov    $0x5,%edi
call   1070 <insertMinHeap@plt>
mov    $0x4,%edi
call   1070 <insertMinHeap@plt>
mov    $0x32,%edi
call   1070 <insertMinHeap@plt>
mov    $0x12c,%edi
call   1070 <insertMinHeap@plt>
mov    $0x28,%edi
call   1070 <insertMinHeap@plt>
mov    $0x1f4,%edi
call   1070 <insertMinHeap@plt>
mov    $0x1e,%edi
call   1070 <insertMinHeap@plt>
xor    %eax,%eax
call   1040 <display@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <extractMin@plt>
lea    0xe36(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <extractMin@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <extractMin@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <extractMin@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <extractMin@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <extractMin@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @insertMinHeap(i32 2)
%4 = call i32 @insertMinHeap(i32 3)
%5 = call i32 @insertMinHeap(i32 5)
%6 = call i32 @insertMinHeap(i32 4)
%7 = call i32 @insertMinHeap(i32 50)
%8 = call i32 @insertMinHeap(i32 300)
%9 = call i32 @insertMinHeap(i32 40)
%10 = call i32 @insertMinHeap(i32 500)
%11 = call i32 @insertMinHeap(i32 30)
%12 = call i32 (...) @display()
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %14
14: ; preds = %20, %0
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 6
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = call i32 (...) @extractMin()
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %14
23: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 @insertMinHeap(i32 2)
%2 = tail call i32 @insertMinHeap(i32 3)
%3 = tail call i32 @insertMinHeap(i32 5)
%4 = tail call i32 @insertMinHeap(i32 4)
%5 = tail call i32 @insertMinHeap(i32 50)
%6 = tail call i32 @insertMinHeap(i32 300)
%7 = tail call i32 @insertMinHeap(i32 40)
%8 = tail call i32 @insertMinHeap(i32 500)
%9 = tail call i32 @insertMinHeap(i32 30)
%10 = tail call i32 (...) @display()
%11 = tail call i32 @putchar(i32 10)
%12 = tail call i32 (...) @extractMin()
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = tail call i32 (...) @extractMin()
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = tail call i32 (...) @extractMin()
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = tail call i32 (...) @extractMin()
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = tail call i32 (...) @extractMin()
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = tail call i32 (...) @extractMin()
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
ret i32 0
}