#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*/ arr;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sort(int *, int);
int main(int argc, char const *argv[]) {
  int idx = 0;
  int arr[] = {1, 3, 5, 7, 9, 2, 3, 4, 8, 6, 7, 0, 10, 2, 11, 5};
  for (idx = 0; idx < sizeof(arr) / sizeof(int) - 1; idx++) {
    printf("%d ", arr[idx]);
  }
  printf("\n");
  sort(arr, sizeof(arr) / sizeof(int));
  for (idx = 0; idx < sizeof(arr) / sizeof(int) - 1; idx++) {
    printf("%d ", arr[idx]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xea8(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0xf,%rax
jae    119b <main+0x6b>
movslq -0x14(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1169 <main+0x39>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    $0x10,%esi
call   1040 <sort@plt>
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0xf,%rax
jae    11f0 <main+0xc0>
movslq -0x14(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11be <main+0x8e>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea0(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed5(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
mov    $0x10,%esi
call   1050 <sort@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x30(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x34(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [16 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9, i32 2, i32 3, i32 4, i32 8, i32 6, i32 7, i32 0, i32 10, i32 2, i32 11, i32 5]
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [16 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = bitcast [16 x i32]* %7 to i8*
store i32 0, i32* %6
br label %9
9: ; preds = %19, %2
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = icmp ult i64 %11, 15
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %13
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %9
22: ; preds = %9
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%25 = call i32 @sort(i32* %24, i32 16)
store i32 0, i32* %6
br label %26
26: ; preds = %36, %22
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = icmp ult i64 %28, 15
br i1 %29, label %30, label %39
30: ; preds = %26
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %30
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %26
39: ; preds = %26
%40 = 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):
@__const.main.arr = [16 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9, i32 2, i32 3, i32 4, i32 8, i32 6, i32 7, i32 0, i32 10, i32 2, i32 11, i32 5]
@.str = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i32]
%4 = bitcast [16 x i32]* %3 to i8*
%5 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%9 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%11 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 3
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%13 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 4
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
%15 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 5
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%17 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 6
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%19 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 7
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%21 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 8
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%23 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 9
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%25 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 10
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%27 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 11
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%29 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 12
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%31 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 13
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%33 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 14
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 11)
%35 = tail call i32 @putchar(i32 10)
%36 = call i32 @sort(i32* %5, i32 16)
%37 = load i32, i32* %5
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %7
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %9
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %11
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %43)
%45 = load i32, i32* %13
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %15
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %47)
%49 = load i32, i32* %17
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %49)
%51 = load i32, i32* %19
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %21
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %53)
%55 = load i32, i32* %23
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %55)
%57 = load i32, i32* %25
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %57)
%59 = load i32, i32* %27
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %59)
%61 = load i32, i32* %29
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %61)
%63 = load i32, i32* %31
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %63)
%65 = load i32, i32* %33
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %65)
%67 = call i32 @putchar(i32 10)
ret i32 0
}