#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 PQdelmax();
int /*<<< orphan*/ PQempty();
int /*<<< orphan*/ PQinit();
int /*<<< orphan*/ PQinsert(int);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  int i;
  srand(time(NULL));
  PQinit();
  for (i = 0; i < 10; ++i) {
    PQinsert(rand() % 100);
  }
  while (!PQempty()) {
    printf("%d ", PQdelmax());
  }
  printf("\n");
  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   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    $0x0,%al
call   1080 <PQinit@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11db <main+0x5b>
mov    $0x0,%al
call   10a0 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <PQinsert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ad <main+0x2d>
jmp    11e0 <main+0x60>
mov    $0x0,%al
call   1060 <PQempty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11fc <main+0x7c>
jmp    1218 <main+0x98>
mov    $0x0,%al
call   1030 <PQdelmax@plt>
mov    %eax,%esi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11e0 <main+0x60>
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
xor    %eax,%eax
call   1090 <PQinit@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
movslq %eax,%rdi
imul   $0x51eb851f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edi
call   1050 <PQinsert@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
movslq %eax,%rdi
imul   $0x51eb851f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edi
call   1050 <PQinsert@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
movslq %eax,%rdi
imul   $0x51eb851f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edi
call   1050 <PQinsert@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
movslq %eax,%rdi
imul   $0x51eb851f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edi
call   1050 <PQinsert@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
movslq %eax,%rdi
imul   $0x51eb851f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edi
call   1050 <PQinsert@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
movslq %eax,%rdi
imul   $0x51eb851f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edi
call   1050 <PQinsert@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
movslq %eax,%rdi
imul   $0x51eb851f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edi
call   1050 <PQinsert@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
movslq %eax,%rdi
imul   $0x51eb851f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edi
call   1050 <PQinsert@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
movslq %eax,%rdi
imul   $0x51eb851f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edi
call   1050 <PQinsert@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
movslq %eax,%rdi
imul   $0x51eb851f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%edi
call   1050 <PQinsert@plt>
xor    %eax,%eax
call   1070 <PQempty@plt>
test   %eax,%eax
jne    136e <main+0x1de>
lea    0xcb8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <PQdelmax@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <PQempty@plt>
test   %eax,%eax
je     1350 <main+0x1c0>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @PQinit()
store i32 0, i32* %2
br label %6
6: ; preds = %13, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 100
%12 = call i32 @PQinsert(i32 %11)
br label %13
13: ; preds = %9
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %6
16: ; preds = %6
br label %17
17: ; preds = %21, %16
%18 = call i32 (...) @PQempty()
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = call i32 (...) @PQdelmax()
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
br label %17
24: ; preds = %17
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @PQinit()
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 100
%6 = tail call i32 @PQinsert(i32 %5)
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 100
%9 = tail call i32 @PQinsert(i32 %8)
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, 100
%12 = tail call i32 @PQinsert(i32 %11)
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 100
%15 = tail call i32 @PQinsert(i32 %14)
%16 = tail call i32 (...) @rand()
%17 = srem i32 %16, 100
%18 = tail call i32 @PQinsert(i32 %17)
%19 = tail call i32 (...) @rand()
%20 = srem i32 %19, 100
%21 = tail call i32 @PQinsert(i32 %20)
%22 = tail call i32 (...) @rand()
%23 = srem i32 %22, 100
%24 = tail call i32 @PQinsert(i32 %23)
%25 = tail call i32 (...) @rand()
%26 = srem i32 %25, 100
%27 = tail call i32 @PQinsert(i32 %26)
%28 = tail call i32 (...) @rand()
%29 = srem i32 %28, 100
%30 = tail call i32 @PQinsert(i32 %29)
%31 = tail call i32 (...) @rand()
%32 = srem i32 %31, 100
%33 = tail call i32 @PQinsert(i32 %32)
%34 = tail call i32 (...) @PQempty()
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %0, %36
%37 = tail call i32 (...) @PQdelmax()
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %37)
%39 = tail call i32 (...) @PQempty()
%40 = icmp eq i32 %39, 0
br i1 %40, label %36, label %41
41: ; preds = %36, %0
%42 = tail call i32 @putchar(i32 10)
ret i32 0
}