#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 */
long *malloc(long);
int /*<<< orphan*/ mysort(long, long *);
int /*<<< orphan*/ printArray(char *, long, long *);
void main() {
  long n;
  n = 10;
  long *a;
  a = malloc(n * 8);
  a[0] = 8;
  a[1] = 7;
  a[2] = 1;
  a[3] = 9;
  a[4] = 11;
  a[5] = 83;
  a[6] = 7;
  a[7] = 13;
  a[8] = 94;
  a[9] = 1;
  printArray("Before", n, a);
  mysort(n, a);
  printArray("After", n, a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x8,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x7,0x8(%rax)
mov    -0x10(%rbp),%rax
movq   $0x1,0x10(%rax)
mov    -0x10(%rbp),%rax
movq   $0x9,0x18(%rax)
mov    -0x10(%rbp),%rax
movq   $0xb,0x20(%rax)
mov    -0x10(%rbp),%rax
movq   $0x53,0x28(%rax)
mov    -0x10(%rbp),%rax
movq   $0x7,0x30(%rax)
mov    -0x10(%rbp),%rax
movq   $0xd,0x38(%rax)
mov    -0x10(%rbp),%rax
movq   $0x5e,0x40(%rax)
mov    -0x10(%rbp),%rax
movq   $0x1,0x48(%rax)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe29(%rip),%rdi
call   1050 <printArray@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mysort@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe0f(%rip),%rdi
call   1050 <printArray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x50,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
movaps 0xebb(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xec1(%rip),%xmm0
movups %xmm0,0x10(%rax)
movaps 0xec6(%rip),%xmm0
movups %xmm0,0x20(%rax)
movaps 0xecb(%rip),%xmm0
movups %xmm0,0x30(%rax)
movaps 0xed0(%rip),%xmm0
movups %xmm0,0x40(%rax)
lea    0xed5(%rip),%rdi
mov    $0xa,%esi
mov    %rax,%rdx
call   1050 <printArray@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <mysort@plt>
lea    0xebb(%rip),%rdi
mov    $0xa,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1050 <printArray@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Before\00"
@.str.1 = [6 x i8] c"After\00"
define void @main() {
%1 = alloca i64
%2 = alloca i64*
store i64 10, i64* %1
%3 = load i64, i64* %1
%4 = mul nsw i64 %3, 8
%5 = call i64* @malloc(i64 %4)
store i64* %5, i64** %2
%6 = load i64*, i64** %2
%7 = getelementptr inbounds i64, i64* %6, i64 0
store i64 8, i64* %7
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 1
store i64 7, i64* %9
%10 = load i64*, i64** %2
%11 = getelementptr inbounds i64, i64* %10, i64 2
store i64 1, i64* %11
%12 = load i64*, i64** %2
%13 = getelementptr inbounds i64, i64* %12, i64 3
store i64 9, i64* %13
%14 = load i64*, i64** %2
%15 = getelementptr inbounds i64, i64* %14, i64 4
store i64 11, i64* %15
%16 = load i64*, i64** %2
%17 = getelementptr inbounds i64, i64* %16, i64 5
store i64 83, i64* %17
%18 = load i64*, i64** %2
%19 = getelementptr inbounds i64, i64* %18, i64 6
store i64 7, i64* %19
%20 = load i64*, i64** %2
%21 = getelementptr inbounds i64, i64* %20, i64 7
store i64 13, i64* %21
%22 = load i64*, i64** %2
%23 = getelementptr inbounds i64, i64* %22, i64 8
store i64 94, i64* %23
%24 = load i64*, i64** %2
%25 = getelementptr inbounds i64, i64* %24, i64 9
store i64 1, i64* %25
%26 = load i64, i64* %1
%27 = load i64*, i64** %2
%28 = call i32 @printArray(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %26, i64* %27)
%29 = load i64, i64* %1
%30 = load i64*, i64** %2
%31 = call i32 @mysort(i64 %29, i64* %30)
%32 = load i64, i64* %1
%33 = load i64*, i64** %2
%34 = call i32 @printArray(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %32, i64* %33)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Before\00"
@.str.1 = [6 x i8] c"After\00"
define void @main() {
%1 = tail call i64* @malloc(i64 80)
%2 = bitcast i64* %1 to <2 x i64>*
store <2 x i64> <i64 8, i64 7>, <2 x i64>* %2
%3 = getelementptr inbounds i64, i64* %1, i64 2
%4 = bitcast i64* %3 to <2 x i64>*
store <2 x i64> <i64 1, i64 9>, <2 x i64>* %4
%5 = getelementptr inbounds i64, i64* %1, i64 4
%6 = bitcast i64* %5 to <2 x i64>*
store <2 x i64> <i64 11, i64 83>, <2 x i64>* %6
%7 = getelementptr inbounds i64, i64* %1, i64 6
%8 = bitcast i64* %7 to <2 x i64>*
store <2 x i64> <i64 7, i64 13>, <2 x i64>* %8
%9 = getelementptr inbounds i64, i64* %1, i64 8
%10 = bitcast i64* %9 to <2 x i64>*
store <2 x i64> <i64 94, i64 1>, <2 x i64>* %10
%11 = tail call i32 @printArray(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 10, i64* %1)
%12 = tail call i32 @mysort(i64 10, i64* %1)
%13 = tail call i32 @printArray(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 10, i64* %1)
ret void
}