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

/* Variables and functions */
int /*<<< orphan*/ countingSort(int *, int);
int /*<<< orphan*/ square(int *, int);
int main(void) {
  int a[] = {-5, -4, -3, -2};
  int size = sizeof(a) / sizeof(*a);
  int b[] = {-2, -1, 0, 1, 2};
  int n = sizeof(b) / sizeof(*b);
  square(a, size);
  square(b, n);
  countingSort(a, size);
  countingSort(b, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x4,-0x24(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0x30(%rbp)
movl   $0x5,-0x44(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <square@plt>
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1030 <square@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <countingSort@plt>
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1040 <countingSort@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xee7(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x4,%esi
call   1030 <square@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <square@plt>
mov    %r14,%rdi
mov    $0x4,%esi
call   1040 <countingSort@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <countingSort@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.a = [4 x i32] [i32 -5, i32 -4, i32 -3, i32 -2]
@__const.main.b = [5 x i32] [i32 -2, i32 -1, i32 0, i32 1, i32 2]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [4 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%6 = call i32 @square(i32* %5, i32 4)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @square(i32* %7, i32 5)
%9 = call i32 @countingSort(i32* %5, i32 4)
%10 = call i32 @countingSort(i32* %7, i32 5)
ret i32 0
}