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

/* Variables and functions */
int /*<<< orphan*/ csort(int, int, unsigned int *, unsigned int *);
int /*<<< orphan*/ printf(char *, size_t, unsigned int);
int main(void) {
  unsigned src[] = {2, 0, 7, 3, 9, 7, 4, 5, 5, 8, 2, 6, 1, 5, 2};
  unsigned dst[sizeof(src) / sizeof(unsigned)];
  csort(10, sizeof(src) / sizeof(unsigned), src, dst);
  for (size_t i = 0; i < sizeof(src) / sizeof(unsigned); ++i) {
    printf("%zu: %u\n", i, dst[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x3c,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdx
lea    -0x80(%rbp),%rcx
mov    $0xa,%edi
mov    $0xf,%esi
call   1050 <csort@plt>
movq   $0x0,-0x88(%rbp)
cmpq   $0xf,-0x88(%rbp)
0f
jae    11bc <main+0x8c>
mov    -0x88(%rbp),%rsi
mov    -0x88(%rbp),%rax
mov    -0x80(%rbp,%rax,4),%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
jmp    1179 <main+0x49>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
movups 0xefd(%rip),%xmm0
movups %xmm0,0x6c(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x40(%rsp),%rdx
mov    %rsp,%rcx
mov    $0xa,%edi
mov    $0xf,%esi
call   1040 <csort@plt>
mov    (%rsp),%edx
lea    0xec3(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    0x4(%rsp),%edx
mov    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
mov    $0x2,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%edx
mov    $0x3,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%edx
mov    $0x4,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x14(%rsp),%edx
mov    $0x5,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%edx
mov    $0x6,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x1c(%rsp),%edx
mov    $0x7,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%edx
mov    $0x8,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x24(%rsp),%edx
mov    $0x9,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x28(%rsp),%edx
mov    $0xa,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2c(%rsp),%edx
mov    $0xb,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x30(%rsp),%edx
mov    $0xc,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x34(%rsp),%edx
mov    $0xd,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x38(%rsp),%edx
mov    $0xe,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.src = [15 x i32] [i32 2, i32 0, i32 7, i32 3, i32 9, i32 7, i32 4, i32 5, i32 5, i32 8, i32 2, i32 6, i32 1, i32 5, i32 2]
@.str = [9 x i8] c"%zu: %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i32]
%3 = alloca [15 x i32]
%4 = alloca i64
store i32 0, i32* %1
%5 = bitcast [15 x i32]* %2 to i8*
%6 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 0
%8 = call i32 @csort(i32 10, i32 15, i32* %6, i32* %7)
store i64 0, i64* %4
br label %9
9: ; preds = %18, %0
%10 = load i64, i64* %4
%11 = icmp ult i64 %10, 15
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i64, i64* %4
%14 = load i64, i64* %4
%15 = getelementptr inbounds [15 x i32], [15 x i32]* %3, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %13, i32 %16)
br label %18
18: ; preds = %12
%19 = load i64, i64* %4
%20 = add i64 %19, 1
store i64 %20, i64* %4
br label %9
21: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@__const.main.src = [15 x i32] [i32 2, i32 0, i32 7, i32 3, i32 9, i32 7, i32 4, i32 5, i32 5, i32 8, i32 2, i32 6, i32 1, i32 5, i32 2]
@.str = [9 x i8] c"%zu: %u\0A\00"
define i32 @main() {
%1 = alloca [15 x i32]
%2 = alloca [15 x i32]
%3 = bitcast [15 x i32]* %1 to i8*
%4 = bitcast [15 x i32]* %2 to i8*
%5 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 0
%7 = call i32 @csort(i32 10, i32 15, i32* %5, i32* %6)
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 0, i32 %8)
%10 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 1
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 1, i32 %11)
%13 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 2
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 2, i32 %14)
%16 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 3
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 3, i32 %17)
%19 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 4
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 4, i32 %20)
%22 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 5
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 5, i32 %23)
%25 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 6
%26 = load i32, i32* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 6, i32 %26)
%28 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 7
%29 = load i32, i32* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 7, i32 %29)
%31 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 8
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8, i32 %32)
%34 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 9
%35 = load i32, i32* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 9, i32 %35)
%37 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 10
%38 = load i32, i32* %37
%39 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 10, i32 %38)
%40 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 11
%41 = load i32, i32* %40
%42 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 11, i32 %41)
%43 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 12
%44 = load i32, i32* %43
%45 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 12, i32 %44)
%46 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 13
%47 = load i32, i32* %46
%48 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 13, i32 %47)
%49 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 14
%50 = load i32, i32* %49
%51 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 14, i32 %50)
ret i32 0
}