#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*/ findMaxSub(int *, int /*<<< orphan*/, int, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int A[] = {1, -10, 3, 4, -6, 8, -1, 20, 11, -6};
  int ret[3];
  findMaxSub(A, 0, 9, ret);
  printf("%d  %d  %d", ret[0], ret[1], ret[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x3c(%rbp),%rcx
xor    %esi,%esi
mov    $0x9,%edx
call   1030 <findMaxSub@plt>
mov    -0x3c(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x34(%rbp),%ecx
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0x4(%rsp),%rcx
xor    %esi,%esi
mov    $0x9,%edx
call   1030 <findMaxSub@plt>
mov    0x4(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [10 x i32] [i32 1, i32 -10, i32 3, i32 4, i32 -6, i32 8, i32 -1, i32 20, i32 11, i32 -6]
@.str = [11 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [3 x i32]
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%7 = call i32 @findMaxSub(i32* %5, i32 0, i32 9, i32* %6)
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [10 x i32] [i32 1, i32 -10, i32 3, i32 4, i32 -6, i32 8, i32 -1, i32 20, i32 11, i32 -6]
@.str = [11 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = call i32 @findMaxSub(i32* %5, i32 0, i32 9, i32* %6)
%8 = load i32, i32* %6
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10, i32 %12)
ret i32 0
}