#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 */
int /*<<< orphan*/ calculateRange(int *, int);
int /*<<< orphan*/ calculateWages(int *, int *, int);
int main() {
  int sales[20] = {2000, 2400, 1500, 10600, 1552, 2120, 1875, 7500,
                   4690, 9000, 2130, 4000,  5800, 500,  1250, 3000};
  int wages[20] = {0};
  calculateWages(sales, wages, 20);
  calculateRange(wages, 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1030 <memset@plt>
lea    -0x60(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    $0x14,%edx
call   1060 <calculateWages@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x14,%esi
call   1040 <calculateRange@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xa0,%rsp
movaps 0xf11(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xef2(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xe9b(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0x50(%rsp),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
mov    $0x14,%edx
call   1040 <calculateWages@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <calculateRange@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.sales = [20 x i32] [i32 2000, i32 2400, i32 1500, i32 10600, i32 1552, i32 2120, i32 1875, i32 7500, i32 4690, i32 9000, i32 2130, i32 4000, i32 5800, i32 500, i32 1250, i32 3000, i32 0, i32 0, i32 0, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
%3 = alloca [20 x i32]
store i32 0, i32* %1
%4 = bitcast [20 x i32]* %2 to i8*
%5 = bitcast [20 x i32]* %3 to i8*
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%8 = call i32 @calculateWages(i32* %6, i32* %7, i32 20)
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%10 = call i32 @calculateRange(i32* %9, i32 20)
ret i32 0
}

LLVM IR (-O2):
@__const.main.sales = [20 x i32] [i32 2000, i32 2400, i32 1500, i32 10600, i32 1552, i32 2120, i32 1875, i32 7500, i32 4690, i32 9000, i32 2130, i32 4000, i32 5800, i32 500, i32 1250, i32 3000, i32 0, i32 0, i32 0, i32 0]
define i32 @main() {
%1 = alloca [20 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [20 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%7 = call i32 @calculateWages(i32* %5, i32* %6, i32 20)
%8 = call i32 @calculateRange(i32* %6, i32 20)
ret i32 0
}