#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 */
typedef int /*<<< orphan*/ A;

/* Variables and functions */
int /*<<< orphan*/ heapSort(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int);
int main(int argc, char const *argv[]) {
  int A[50];
  heapSort(A, sizeof(A) / sizeof(int));
  for (int i = 0; i < 28; ++i)
    printf("%i ", A[i]);
  int i;
  scanf("%i", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
mov    $0x32,%esi
call   1030 <heapSort@plt>
movl   $0x0,-0xe4(%rbp)
cmpl   $0x1c,-0xe4(%rbp)
jge    119f <main+0x6f>
movslq -0xe4(%rbp),%rax
mov    -0xe0(%rbp,%rax,4),%esi
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    1164 <main+0x34>
mov    -0xe8(%rbp),%esi
lea    0xe58(%rip),%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
mov    %rsp,%rdi
mov    $0x32,%esi
call   1030 <heapSort@plt>
mov    (%rsp),%esi
lea    0xeb1(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x30(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x34(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x38(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x3c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x40(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x44(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x48(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x4c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x50(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x54(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x58(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x5c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x60(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x64(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x68(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x6c(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xd62(%rip),%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i \00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [50 x i32]
%4 = bitcast [50 x i32]* %3 to i8*
%5 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 0
%6 = call i32 @heapSort(i32* %5, i32 50)
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 1
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 2
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 3
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 4
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 5
%22 = load i32, i32* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 6
%25 = load i32, i32* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 7
%28 = load i32, i32* %27
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 8
%31 = load i32, i32* %30
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 9
%34 = load i32, i32* %33
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 10
%37 = load i32, i32* %36
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 11
%40 = load i32, i32* %39
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %40)
%42 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 12
%43 = load i32, i32* %42
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %43)
%45 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 13
%46 = load i32, i32* %45
%47 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %46)
%48 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 14
%49 = load i32, i32* %48
%50 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %49)
%51 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 15
%52 = load i32, i32* %51
%53 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %52)
%54 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 16
%55 = load i32, i32* %54
%56 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %55)
%57 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 17
%58 = load i32, i32* %57
%59 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %58)
%60 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 18
%61 = load i32, i32* %60
%62 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %61)
%63 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 19
%64 = load i32, i32* %63
%65 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %64)
%66 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 20
%67 = load i32, i32* %66
%68 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %67)
%69 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 21
%70 = load i32, i32* %69
%71 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %70)
%72 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 22
%73 = load i32, i32* %72
%74 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %73)
%75 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 23
%76 = load i32, i32* %75
%77 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %76)
%78 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 24
%79 = load i32, i32* %78
%80 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %79)
%81 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 25
%82 = load i32, i32* %81
%83 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %82)
%84 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 26
%85 = load i32, i32* %84
%86 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %85)
%87 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 27
%88 = load i32, i32* %87
%89 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %88)
%90 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}