#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*/ d;
typedef int /*<<< orphan*/ c;
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ counting_sorti_simple(int *, int);
int /*<<< orphan*/ counting_sortu_simple(unsigned int *, int);
int /*<<< orphan*/ printvinl(int *, int);
int /*<<< orphan*/ printvunl(unsigned int *, int);
int main() {
  int a[] = {4, 3, 2, 1};
  int b[] = {0, 4, 1, 3, 1, 2, 4, 1};
  int c[] = {0, -1, 4, 0, 2, -3, 8};
  unsigned d[] = {1, 2, 3, 0};
  counting_sorti_simple(a, (sizeof(a) / sizeof(a[0])));
  printvinl(a, (sizeof(a) / sizeof(a[0])));
  counting_sorti_simple(b, (sizeof(b) / sizeof(b[0])));
  printvinl(b, (sizeof(b) / sizeof(b[0])));
  counting_sorti_simple(c, (sizeof(c) / sizeof(c[0])));
  printvinl(c, (sizeof(c) / sizeof(c[0])));
  counting_sortu_simple(d, (sizeof(d) / sizeof(d[0])));
  printvunl(d, (sizeof(d) / sizeof(d[0])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xea1(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe9e(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe9b(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe98(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe95(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe92(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe90(%rip),%eax
mov    %eax,-0x48(%rbp)
mov    0xe8e(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe8b(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <counting_sorti_simple@plt>
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1060 <printvinl@plt>
lea    -0x40(%rbp),%rdi
mov    $0x8,%esi
call   1040 <counting_sorti_simple@plt>
lea    -0x40(%rbp),%rdi
mov    $0x8,%esi
call   1060 <printvinl@plt>
lea    -0x60(%rbp),%rdi
mov    $0x7,%esi
call   1040 <counting_sorti_simple@plt>
lea    -0x60(%rbp),%rdi
mov    $0x7,%esi
call   1060 <printvinl@plt>
lea    -0x70(%rbp),%rdi
mov    $0x4,%esi
call   1030 <counting_sortu_simple@plt>
lea    -0x70(%rbp),%rdi
mov    $0x4,%esi
call   1050 <printvunl@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movups 0xecc(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <counting_sorti_simple@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1060 <printvinl@plt>
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <counting_sorti_simple@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1060 <printvinl@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <counting_sorti_simple@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1060 <printvinl@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <counting_sortu_simple@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <printvunl@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [4 x i32] [i32 4, i32 3, i32 2, i32 1]
@__const.main.b = [8 x i32] [i32 0, i32 4, i32 1, i32 3, i32 1, i32 2, i32 4, i32 1]
@__const.main.c = [7 x i32] [i32 0, i32 -1, i32 4, i32 0, i32 2, i32 -3, i32 8]
@__const.main.d = [4 x i32] [i32 1, i32 2, i32 3, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca [8 x i32]
%4 = alloca [7 x i32]
%5 = alloca [4 x i32]
store i32 0, i32* %1
%6 = bitcast [4 x i32]* %2 to i8*
%7 = bitcast [8 x i32]* %3 to i8*
%8 = bitcast [7 x i32]* %4 to i8*
%9 = bitcast [4 x i32]* %5 to i8*
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%11 = call i32 @counting_sorti_simple(i32* %10, i32 4)
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%13 = call i32 @printvinl(i32* %12, i32 4)
%14 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%15 = call i32 @counting_sorti_simple(i32* %14, i32 8)
%16 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%17 = call i32 @printvinl(i32* %16, i32 8)
%18 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 0
%19 = call i32 @counting_sorti_simple(i32* %18, i32 7)
%20 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 0
%21 = call i32 @printvinl(i32* %20, i32 7)
%22 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%23 = call i32 @counting_sortu_simple(i32* %22, i32 4)
%24 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%25 = call i32 @printvunl(i32* %24, i32 4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [4 x i32] [i32 4, i32 3, i32 2, i32 1]
@__const.main.b = [8 x i32] [i32 0, i32 4, i32 1, i32 3, i32 1, i32 2, i32 4, i32 1]
@__const.main.c = [7 x i32] [i32 0, i32 -1, i32 4, i32 0, i32 2, i32 -3, i32 8]
@__const.main.d = [4 x i32] [i32 1, i32 2, i32 3, i32 0]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca [8 x i32]
%3 = alloca [7 x i32]
%4 = alloca [4 x i32]
%5 = bitcast [4 x i32]* %1 to i8*
%6 = bitcast [8 x i32]* %2 to i8*
%7 = bitcast [7 x i32]* %3 to i8*
%8 = bitcast [4 x i32]* %4 to i8*
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%10 = call i32 @counting_sorti_simple(i32* %9, i32 4)
%11 = call i32 @printvinl(i32* %9, i32 4)
%12 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%13 = call i32 @counting_sorti_simple(i32* %12, i32 8)
%14 = call i32 @printvinl(i32* %12, i32 8)
%15 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%16 = call i32 @counting_sorti_simple(i32* %15, i32 7)
%17 = call i32 @printvinl(i32* %15, i32 7)
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%19 = call i32 @counting_sortu_simple(i32* %18, i32 4)
%20 = call i32 @printvunl(i32* %18, i32 4)
ret i32 0
}