#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*/ hremove();
int /*<<< orphan*/ insert(int);
int /*<<< orphan*/ print_heap();
int main(int argc, char **argv) {
  insert(10);
  insert(20);
  insert(3);
  insert(5);
  insert(13);
  insert(-2);
  insert(0);
  insert(6);
  insert(-10);
  insert(15);
  insert(22);
  print_heap();
  insert(12);
  print_heap();
  insert(-100);
  print_heap();
  hremove();
  print_heap();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
call   1040 <insert@plt>
mov    $0x14,%edi
call   1040 <insert@plt>
mov    $0x3,%edi
call   1040 <insert@plt>
mov    $0x5,%edi
call   1040 <insert@plt>
mov    $0xd,%edi
call   1040 <insert@plt>
mov    $0xfffffffe,%edi
call   1040 <insert@plt>
xor    %edi,%edi
call   1040 <insert@plt>
mov    $0x6,%edi
call   1040 <insert@plt>
mov    $0xfffffff6,%edi
call   1040 <insert@plt>
mov    $0xf,%edi
call   1040 <insert@plt>
mov    $0x16,%edi
call   1040 <insert@plt>
mov    $0x0,%al
call   1050 <print_heap@plt>
mov    $0xc,%edi
call   1040 <insert@plt>
mov    $0x0,%al
call   1050 <print_heap@plt>
mov    $0xffffff9c,%edi
call   1040 <insert@plt>
mov    $0x0,%al
call   1050 <print_heap@plt>
mov    $0x0,%al
call   1030 <hremove@plt>
mov    $0x0,%al
call   1050 <print_heap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <insert@plt>
mov    $0x14,%edi
call   1040 <insert@plt>
mov    $0x3,%edi
call   1040 <insert@plt>
mov    $0x5,%edi
call   1040 <insert@plt>
mov    $0xd,%edi
call   1040 <insert@plt>
mov    $0xfffffffe,%edi
call   1040 <insert@plt>
xor    %edi,%edi
call   1040 <insert@plt>
mov    $0x6,%edi
call   1040 <insert@plt>
mov    $0xfffffff6,%edi
call   1040 <insert@plt>
mov    $0xf,%edi
call   1040 <insert@plt>
mov    $0x16,%edi
call   1040 <insert@plt>
xor    %eax,%eax
call   1050 <print_heap@plt>
mov    $0xc,%edi
call   1040 <insert@plt>
xor    %eax,%eax
call   1050 <print_heap@plt>
mov    $0xffffff9c,%edi
call   1040 <insert@plt>
xor    %eax,%eax
call   1050 <print_heap@plt>
xor    %eax,%eax
call   1030 <hremove@plt>
xor    %eax,%eax
call   1050 <print_heap@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @insert(i32 10)
%7 = call i32 @insert(i32 20)
%8 = call i32 @insert(i32 3)
%9 = call i32 @insert(i32 5)
%10 = call i32 @insert(i32 13)
%11 = call i32 @insert(i32 -2)
%12 = call i32 @insert(i32 0)
%13 = call i32 @insert(i32 6)
%14 = call i32 @insert(i32 -10)
%15 = call i32 @insert(i32 15)
%16 = call i32 @insert(i32 22)
%17 = call i32 (...) @print_heap()
%18 = call i32 @insert(i32 12)
%19 = call i32 (...) @print_heap()
%20 = call i32 @insert(i32 -100)
%21 = call i32 (...) @print_heap()
%22 = call i32 (...) @hremove()
%23 = call i32 (...) @print_heap()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @insert(i32 10)
%4 = tail call i32 @insert(i32 20)
%5 = tail call i32 @insert(i32 3)
%6 = tail call i32 @insert(i32 5)
%7 = tail call i32 @insert(i32 13)
%8 = tail call i32 @insert(i32 -2)
%9 = tail call i32 @insert(i32 0)
%10 = tail call i32 @insert(i32 6)
%11 = tail call i32 @insert(i32 -10)
%12 = tail call i32 @insert(i32 15)
%13 = tail call i32 @insert(i32 22)
%14 = tail call i32 (...) @print_heap()
%15 = tail call i32 @insert(i32 12)
%16 = tail call i32 (...) @print_heap()
%17 = tail call i32 @insert(i32 -100)
%18 = tail call i32 (...) @print_heap()
%19 = tail call i32 (...) @hremove()
%20 = tail call i32 (...) @print_heap()
ret i32 0
}