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

/* Variables and functions */
int maxSumDivThree(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[] = {366, 809, 6,   792, 822, 181, 210, 588, 344, 618, 341, 410, 121,
               864, 191, 749, 637, 169, 123, 472, 358, 908, 235, 914, 322, 946,
               738, 754, 908, 272, 267, 326, 587, 267, 803, 281, 586, 707, 94,
               627, 724, 469, 568, 57,  103, 984, 787, 552, 14,  545, 866, 494,
               263, 157, 479, 823, 835, 100, 495, 773, 729, 921, 348, 871, 91,
               386, 183, 979, 716, 806, 639, 290, 612, 322, 289, 910, 484, 300,
               195, 546, 499, 213, 8,   623, 490, 473, 603, 721, 793, 418, 551,
               331, 598, 670, 960, 483, 154, 317, 834, 352};
  printf("size %d\n", sizeof(arr));
  int ret = maxSumDivThree(arr, sizeof(arr));
  printf("ret %d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x190,%edx
call   1040 <memcpy@plt>
lea    0x102f(%rip),%rdi
mov    $0x190,%esi
call   1030 <printf@plt>
lea    -0x1a0(%rbp),%rdi
mov    $0x190,%esi
call   1050 <maxSumDivThree@plt>
mov    %eax,-0x1a4(%rbp)
mov    -0x1a4(%rbp),%esi
lea    0x100a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x190,%rsp
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x190,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
lea    0x103a(%rip),%rdi
mov    $0x190,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x190,%esi
call   1050 <maxSumDivThree@plt>
lea    0x1025(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [100 x i32] [i32 366, i32 809, i32 6, i32 792, i32 822, i32 181, i32 210, i32 588, i32 344, i32 618, i32 341, i32 410, i32 121, i32 864, i32 191, i32 749, i32 637, i32 169, i32 123, i32 472, i32 358, i32 908, i32 235, i32 914, i32 322, i32 946, i32 738, i32 754, i32 908, i32 272, i32 267, i32 326, i32 587, i32 267, i32 803, i32 281, i32 586, i32 707, i32 94, i32 627, i32 724, i32 469, i32 568, i32 57, i32 103, i32 984, i32 787, i32 552, i32 14, i32 545, i32 866, i32 494, i32 263, i32 157, i32 479, i32 823, i32 835, i32 100, i32 495, i32 773, i32 729, i32 921, i32 348, i32 871, i32 91, i32 386, i32 183, i32 979, i32 716, i32 806, i32 639, i32 290, i32 612, i32 322, i32 289, i32 910, i32 484, i32 300, i32 195, i32 546, i32 499, i32 213, i32 8, i32 623, i32 490, i32 473, i32 603, i32 721, i32 793, i32 418, i32 551, i32 331, i32 598, i32 670, i32 960, i32 483, i32 154, i32 317, i32 834, i32 352]
@.str = [9 x i8] c"size %d\0A\00"
@.str.1 = [8 x i8] c"ret %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [100 x i32]* %2 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 400)
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%7 = call i32 @maxSumDivThree(i32* %6, i32 400)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [100 x i32] [i32 366, i32 809, i32 6, i32 792, i32 822, i32 181, i32 210, i32 588, i32 344, i32 618, i32 341, i32 410, i32 121, i32 864, i32 191, i32 749, i32 637, i32 169, i32 123, i32 472, i32 358, i32 908, i32 235, i32 914, i32 322, i32 946, i32 738, i32 754, i32 908, i32 272, i32 267, i32 326, i32 587, i32 267, i32 803, i32 281, i32 586, i32 707, i32 94, i32 627, i32 724, i32 469, i32 568, i32 57, i32 103, i32 984, i32 787, i32 552, i32 14, i32 545, i32 866, i32 494, i32 263, i32 157, i32 479, i32 823, i32 835, i32 100, i32 495, i32 773, i32 729, i32 921, i32 348, i32 871, i32 91, i32 386, i32 183, i32 979, i32 716, i32 806, i32 639, i32 290, i32 612, i32 322, i32 289, i32 910, i32 484, i32 300, i32 195, i32 546, i32 499, i32 213, i32 8, i32 623, i32 490, i32 473, i32 603, i32 721, i32 793, i32 418, i32 551, i32 331, i32 598, i32 670, i32 960, i32 483, i32 154, i32 317, i32 834, i32 352]
@.str = [9 x i8] c"size %d\0A\00"
@.str.1 = [8 x i8] c"ret %d\0A\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 400)
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%5 = call i32 @maxSumDivThree(i32* %4, i32 400)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}