#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*/ find_abundant_sums(int *, int *);
int /*<<< orphan*/ find_abundants(int *);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, float);
float timeit();
int main(int argc, char *argv[]) {
  float start = timeit();
  int answer, i;
  int abun_array[28124];
  int abun_sum_array[(28124 * 2)];
  memset(abun_array, 0, (28124 * sizeof(int)));
  memset(abun_sum_array, 0, ((28124 * 2) * sizeof(int)));
  find_abundants(abun_array);
  find_abundant_sums(abun_array, abun_sum_array);
  for (i = 0, answer = 0; i < 28124; i++)
    answer += abun_sum_array[i] == 0 ? i : 0;
  float stop = timeit();
  printf("Answer: %d\n", answer);
  printf("Time: %f\n", stop - start);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x52680,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <timeit@plt>
movss  %xmm0,-0x14(%rbp)
lea    -0x1b790(%rbp),%rdi
xor    %esi,%esi
mov    $0x1b770,%edx
call   1050 <memset@plt>
lea    -0x52670(%rbp),%rdi
xor    %esi,%esi
mov    $0x36ee0,%edx
call   1050 <memset@plt>
lea    -0x1b790(%rbp),%rdi
call   1060 <find_abundants@plt>
lea    -0x1b790(%rbp),%rdi
lea    -0x52670(%rbp),%rsi
call   1030 <find_abundant_sums@plt>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x6ddc,-0x1c(%rbp)
jge    121c <main+0xcc>
movslq -0x1c(%rbp),%rax
cmpl   $0x0,-0x52670(%rbp,%rax,4)
jne    11f5 <main+0xa5>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x52678(%rbp)
jmp    1202 <main+0xb2>
xor    %eax,%eax
mov    %eax,-0x52678(%rbp)
jmp    1202 <main+0xb2>
mov    -0x52678(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11c8 <main+0x78>
mov    $0x0,%al
call   1070 <timeit@plt>
movss  %xmm0,-0x52674(%rbp)
ff
cvtsi2ssl -0x18(%rbp),%xmm0
lea    0xdc9(%rip),%rdi
call   1040 <printf@plt>
movss  -0x52674(%rbp),%xmm0
ff
subss  -0x14(%rbp),%xmm0
lea    0xdbc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x52680,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x52668,%rsp
xor    %eax,%eax
call   1070 <timeit@plt>
movd   %xmm0,0xc(%rsp)
lea    0x36ef0(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1b770,%edx
call   1050 <memset@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x36ee0,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
call   1060 <find_abundants@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <find_abundant_sums@plt>
movdqa 0xe53(%rip),%xmm5
pxor   %xmm1,%xmm1
mov    $0xc,%eax
movdqa 0xe51(%rip),%xmm10
movdqa 0xe58(%rip),%xmm8
movdqa 0xe5f(%rip),%xmm9
movdqa 0xe66(%rip),%xmm11
pxor   %xmm6,%xmm6
pxor   %xmm3,%xmm3
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movdqa %xmm5,%xmm0
paddd  %xmm10,%xmm0
movdqa -0x20(%rsp,%rax,4),%xmm4
pcmpeqd %xmm1,%xmm4
movdqa -0x10(%rsp,%rax,4),%xmm7
pcmpeqd %xmm1,%xmm7
pand   %xmm0,%xmm7
paddd  %xmm3,%xmm7
pand   %xmm5,%xmm4
paddd  %xmm6,%xmm4
cmp    $0x6ddc,%rax
je     1265 <main+0x115>
movdqa %xmm5,%xmm0
paddd  %xmm8,%xmm0
movdqa %xmm5,%xmm2
paddd  %xmm9,%xmm2
movdqa (%rsp,%rax,4),%xmm6
pcmpeqd %xmm1,%xmm6
pand   %xmm0,%xmm6
movdqa 0x10(%rsp,%rax,4),%xmm3
pcmpeqd %xmm1,%xmm3
pand   %xmm2,%xmm3
paddd  %xmm4,%xmm6
paddd  %xmm7,%xmm3
paddd  %xmm11,%xmm5
add    $0x10,%rax
jmp    11f0 <main+0xa0>
paddd  %xmm4,%xmm7
pshufd $0xee,%xmm7,%xmm0
paddd  %xmm7,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
lea    0x6dd8(%rax),%ecx
cmpl   $0x0,0x1b770(%rsp)
cmovne %eax,%ecx
lea    0x6dd9(%rcx),%eax
cmpl   $0x0,0x1b774(%rsp)
cmovne %ecx,%eax
cmpl   $0x0,0x1b778(%rsp)
lea    0x6dda(%rax),%ecx
cmovne %eax,%ecx
lea    0x6ddb(%rcx),%ebx
cmpl   $0x0,0x1b77c(%rsp)
cmovne %ecx,%ebx
xor    %eax,%eax
call   1070 <timeit@plt>
movd   %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
lea    0xd72(%rip),%rdi
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
lea    0xd66(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x52668,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Answer: %d\0A\00"
@.str.1 = [10 x i8] c"Time: %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
%9 = alloca [28124 x i32]
%10 = alloca [56248 x i32]
%11 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call float (...) @timeit()
store float %12, float* %6
%13 = getelementptr inbounds [28124 x i32], [28124 x i32]* %9, i64 0, i64 0
%14 = call i32 @memset(i32* %13, i32 0, i32 112496)
%15 = getelementptr inbounds [56248 x i32], [56248 x i32]* %10, i64 0, i64 0
%16 = call i32 @memset(i32* %15, i32 0, i32 224992)
%17 = getelementptr inbounds [28124 x i32], [28124 x i32]* %9, i64 0, i64 0
%18 = call i32 @find_abundants(i32* %17)
%19 = getelementptr inbounds [28124 x i32], [28124 x i32]* %9, i64 0, i64 0
%20 = getelementptr inbounds [56248 x i32], [56248 x i32]* %10, i64 0, i64 0
%21 = call i32 @find_abundant_sums(i32* %19, i32* %20)
store i32 0, i32* %8
store i32 0, i32* %7
br label %22
22: ; preds = %38, %2
%23 = load i32, i32* %8
%24 = icmp slt i32 %23, 28124
br i1 %24, label %25, label %41
25: ; preds = %22
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [56248 x i32], [56248 x i32]* %10, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %25
%32 = load i32, i32* %8
br label %34
33: ; preds = %25
br label %34
34: ; preds = %33, %31
%35 = phi i32 [ %32, %31 ], [ 0, %33 ]
%36 = load i32, i32* %7
%37 = add nsw i32 %36, %35
store i32 %37, i32* %7
br label %38
38: ; preds = %34
%39 = load i32, i32* %8
%40 = add nsw i32 %39, 1
store i32 %40, i32* %8
br label %22
41: ; preds = %22
%42 = call float (...) @timeit()
store float %42, float* %11
%43 = load i32, i32* %7
%44 = sitofp i32 %43 to float
%45 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %44)
%46 = load float, float* %11
%47 = load float, float* %6
%48 = fsub float %46, %47
%49 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), float %48)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Answer: %d\0A\00"
@.str.1 = [10 x i8] c"Time: %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [28124 x i32]
%4 = alloca [56248 x i32]
%5 = tail call float (...) @timeit()
%6 = bitcast [28124 x i32]* %3 to i8*
%7 = bitcast [56248 x i32]* %4 to i8*
%8 = getelementptr inbounds [28124 x i32], [28124 x i32]* %3, i64 0, i64 0
%9 = call i32 @memset(i32* %8, i32 0, i32 112496)
%10 = getelementptr inbounds [56248 x i32], [56248 x i32]* %4, i64 0, i64 0
%11 = call i32 @memset(i32* %10, i32 0, i32 224992)
%12 = call i32 @find_abundants(i32* %8)
%13 = call i32 @find_abundant_sums(i32* %8, i32* %10)
br label %14
14: ; preds = %34, %2
%15 = phi i64 [ 0, %2 ], [ %49, %34 ]
%16 = phi <4 x i32> [ zeroinitializer, %2 ], [ %47, %34 ]
%17 = phi <4 x i32> [ zeroinitializer, %2 ], [ %48, %34 ]
%18 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %2 ], [ %50, %34 ]
%19 = add <4 x i32> %18, <i32 4, i32 4, i32 4, i32 4>
%20 = getelementptr inbounds [56248 x i32], [56248 x i32]* %4, i64 0, i64 %15
%21 = bitcast i32* %20 to <4 x i32>*
%22 = load <4 x i32>, <4 x i32>* %21
%23 = getelementptr inbounds i32, i32* %20, i64 4
%24 = bitcast i32* %23 to <4 x i32>*
%25 = load <4 x i32>, <4 x i32>* %24
%26 = icmp eq <4 x i32> %22, zeroinitializer
%27 = icmp eq <4 x i32> %25, zeroinitializer
%28 = select <4 x i1> %26, <4 x i32> %18, <4 x i32> zeroinitializer
%29 = select <4 x i1> %27, <4 x i32> %19, <4 x i32> zeroinitializer
%30 = add <4 x i32> %28, %16
%31 = add <4 x i32> %29, %17
%32 = or i64 %15, 8
%33 = icmp eq i64 %32, 28120
br i1 %33, label %51, label %34
34: ; preds = %14
%35 = add <4 x i32> %18, <i32 8, i32 8, i32 8, i32 8>
%36 = add <4 x i32> %18, <i32 12, i32 12, i32 12, i32 12>
%37 = getelementptr inbounds [56248 x i32], [56248 x i32]* %4, i64 0, i64 %32
%38 = bitcast i32* %37 to <4 x i32>*
%39 = load <4 x i32>, <4 x i32>* %38
%40 = getelementptr inbounds i32, i32* %37, i64 4
%41 = bitcast i32* %40 to <4 x i32>*
%42 = load <4 x i32>, <4 x i32>* %41
%43 = icmp eq <4 x i32> %39, zeroinitializer
%44 = icmp eq <4 x i32> %42, zeroinitializer
%45 = select <4 x i1> %43, <4 x i32> %35, <4 x i32> zeroinitializer
%46 = select <4 x i1> %44, <4 x i32> %36, <4 x i32> zeroinitializer
%47 = add <4 x i32> %45, %30
%48 = add <4 x i32> %46, %31
%49 = add nuw nsw i64 %15, 16
%50 = add <4 x i32> %18, <i32 16, i32 16, i32 16, i32 16>
br label %14
51: ; preds = %14
%52 = add <4 x i32> %31, %30
%53 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %52)
%54 = getelementptr inbounds [56248 x i32], [56248 x i32]* %4, i64 0, i64 28120
%55 = load i32, i32* %54
%56 = icmp eq i32 %55, 0
%57 = select i1 %56, i32 28120, i32 0
%58 = add nuw nsw i32 %57, %53
%59 = getelementptr inbounds [56248 x i32], [56248 x i32]* %4, i64 0, i64 28121
%60 = load i32, i32* %59
%61 = icmp eq i32 %60, 0
%62 = select i1 %61, i32 28121, i32 0
%63 = add nuw nsw i32 %62, %58
%64 = getelementptr inbounds [56248 x i32], [56248 x i32]* %4, i64 0, i64 28122
%65 = load i32, i32* %64
%66 = icmp eq i32 %65, 0
%67 = select i1 %66, i32 28122, i32 0
%68 = add nuw nsw i32 %67, %63
%69 = getelementptr inbounds [56248 x i32], [56248 x i32]* %4, i64 0, i64 28123
%70 = load i32, i32* %69
%71 = icmp eq i32 %70, 0
%72 = select i1 %71, i32 28123, i32 0
%73 = add nuw nsw i32 %72, %68
%74 = call float (...) @timeit()
%75 = sitofp i32 %73 to float
%76 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %75)
%77 = fsub float %74, %5
%78 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), float %77)
ret i32 0
}