void reset_arrays(int *ptCount, double ptArray[10000][25],
                  double phiArray[10000][25], double rapArray[10000][25],
                  int chArray[10000][25]) {
  int i, j;
  for (i = 0; i < 25; i++)
    ptCount[i] = 0;
  for (i = 0; i < 10000; i++)
    for (j = 0; j < 25; j++) {
      ptArray[i][j] = 0.0;
      phiArray[i][j] = 0.0;
      chArray[i][j] = 0;
    }
}


x86 assembly (clang, -O0):
<reset_arrays>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x19,-0x2c(%rbp)
jge    1146 <reset_arrays+0x46>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    111f <reset_arrays+0x1f>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x2710,-0x2c(%rbp)
jge    11e2 <reset_arrays+0xe2>
movl   $0x0,-0x30(%rbp)
cmpl   $0x19,-0x30(%rbp)
jge    11cf <reset_arrays+0xcf>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0xc8,%rcx,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0xc8,%rcx,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
imul   $0x64,%rcx,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1161 <reset_arrays+0x61>
jmp    11d4 <reset_arrays+0xd4>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    114d <reset_arrays+0x4d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_arrays>:
push   %r15
push   %r14
push   %r12
push   %rbx
xorps  %xmm0,%xmm0
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x0,0x60(%rdi)
xor    %r9d,%r9d
mov    %r8,%rcx
mov    %rdx,%rdi
mov    %rsi,%rax
jmp    1162 <reset_arrays+0x62>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r9
add    $0xc8,%rax
add    $0xc8,%rdi
add    $0x64,%rcx
cmp    $0x2710,%r9
je     132b <reset_arrays+0x22b>
imul   $0xc8,%r9,%rbx
lea    (%rdx,%rbx,1),%r14
add    $0xc8,%r14
lea    (%rdx,%rbx,1),%r10
lea    (%rsi,%rbx,1),%r11
add    $0xc8,%r11
lea    (%rsi,%rbx,1),%r15
cmp    %r14,%r15
jae    11a0 <reset_arrays+0xa0>
cmp    %r11,%r10
jae    11a0 <reset_arrays+0xa0>
xor    %ebx,%ebx
jmp    12a2 <reset_arrays+0x1a2>
nopl   0x0(%rax,%rax,1)
movups %xmm0,(%rsi,%rbx,1)
movups %xmm0,(%rdx,%rbx,1)
imul   $0x64,%r9,%r12
movq   $0x0,(%r8,%r12,1)
movups %xmm0,0x10(%rsi,%rbx,1)
movups %xmm0,0x10(%rdx,%rbx,1)
movq   $0x0,0x8(%r8,%r12,1)
movups %xmm0,0x20(%rsi,%rbx,1)
movups %xmm0,0x20(%rdx,%rbx,1)
movq   $0x0,0x10(%r8,%r12,1)
movups %xmm0,0x30(%rsi,%rbx,1)
movups %xmm0,0x30(%rdx,%rbx,1)
movq   $0x0,0x18(%r8,%r12,1)
movups %xmm0,0x40(%rsi,%rbx,1)
movups %xmm0,0x40(%rdx,%rbx,1)
movq   $0x0,0x20(%r8,%r12,1)
movups %xmm0,0x50(%rsi,%rbx,1)
movups %xmm0,0x50(%rdx,%rbx,1)
movq   $0x0,0x28(%r8,%r12,1)
movups %xmm0,0x60(%rsi,%rbx,1)
movups %xmm0,0x60(%rdx,%rbx,1)
movq   $0x0,0x30(%r8,%r12,1)
movups %xmm0,0x70(%rsi,%rbx,1)
movups %xmm0,0x70(%rdx,%rbx,1)
movq   $0x0,0x38(%r8,%r12,1)
movups %xmm0,0x80(%rsi,%rbx,1)
movups %xmm0,0x80(%rdx,%rbx,1)
movq   $0x0,0x40(%r8,%r12,1)
movups %xmm0,0x90(%rsi,%rbx,1)
movups %xmm0,0x90(%rdx,%rbx,1)
movq   $0x0,0x48(%r8,%r12,1)
movups %xmm0,0xa0(%rsi,%rbx,1)
movups %xmm0,0xa0(%rdx,%rbx,1)
movq   $0x0,0x50(%r8,%r12,1)
movups %xmm0,0xb0(%rsi,%rbx,1)
movups %xmm0,0xb0(%rdx,%rbx,1)
movq   $0x0,0x58(%r8,%r12,1)
mov    $0x18,%ebx
imul   $0x64,%r9,%r12
add    %r8,%r12
movq   $0x0,(%r15,%rbx,8)
movq   $0x0,(%r10,%rbx,8)
movl   $0x0,(%r12,%rbx,4)
cmp    %r14,%r15
jae    1140 <reset_arrays+0x40>
cmp    %r11,%r10
jae    1140 <reset_arrays+0x40>
add    $0xffffffffffffffe8,%rbx
nopw   0x0(%rax,%rax,1)
movq   $0x0,0xc8(%rax,%rbx,8)
movq   $0x0,0xc8(%rdi,%rbx,8)
movl   $0x0,0x64(%rcx,%rbx,4)
movq   $0x0,0xd0(%rax,%rbx,8)
movq   $0x0,0xd0(%rdi,%rbx,8)
movl   $0x0,0x68(%rcx,%rbx,4)
add    $0x2,%rbx
jne    12e0 <reset_arrays+0x1e0>
jmp    1140 <reset_arrays+0x40>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @reset_arrays(i32* %0, [25 x double]* %1, [25 x double]* %2, [25 x double]* %3, [25 x i32]* %4) {
%6 = alloca i32*
%7 = alloca [25 x double]*
%8 = alloca [25 x double]*
%9 = alloca [25 x double]*
%10 = alloca [25 x i32]*
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %6
store [25 x double]* %1, [25 x double]** %7
store [25 x double]* %2, [25 x double]** %8
store [25 x double]* %3, [25 x double]** %9
store [25 x i32]* %4, [25 x i32]** %10
store i32 0, i32* %11
br label %13
13: ; preds = %21, %5
%14 = load i32, i32* %11
%15 = icmp slt i32 %14, 25
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i32*, i32** %6
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 0, i32* %20
br label %21
21: ; preds = %16
%22 = load i32, i32* %11
%23 = add nsw i32 %22, 1
store i32 %23, i32* %11
br label %13
24: ; preds = %13
store i32 0, i32* %11
br label %25
25: ; preds = %58, %24
%26 = load i32, i32* %11
%27 = icmp slt i32 %26, 10000
br i1 %27, label %28, label %61
28: ; preds = %25
store i32 0, i32* %12
br label %29
29: ; preds = %54, %28
%30 = load i32, i32* %12
%31 = icmp slt i32 %30, 25
br i1 %31, label %32, label %57
32: ; preds = %29
%33 = load [25 x double]*, [25 x double]** %7
%34 = load i32, i32* %11
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [25 x double], [25 x double]* %33, i64 %35
%37 = load i32, i32* %12
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [25 x double], [25 x double]* %36, i64 0, i64 %38
store double 0.000000e+00, double* %39
%40 = load [25 x double]*, [25 x double]** %8
%41 = load i32, i32* %11
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [25 x double], [25 x double]* %40, i64 %42
%44 = load i32, i32* %12
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [25 x double], [25 x double]* %43, i64 0, i64 %45
store double 0.000000e+00, double* %46
%47 = load [25 x i32]*, [25 x i32]** %10
%48 = load i32, i32* %11
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [25 x i32], [25 x i32]* %47, i64 %49
%51 = load i32, i32* %12
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [25 x i32], [25 x i32]* %50, i64 0, i64 %52
store i32 0, i32* %53
br label %54
54: ; preds = %32
%55 = load i32, i32* %12
%56 = add nsw i32 %55, 1
store i32 %56, i32* %12
br label %29
57: ; preds = %29
br label %58
58: ; preds = %57
%59 = load i32, i32* %11
%60 = add nsw i32 %59, 1
store i32 %60, i32* %11
br label %25
61: ; preds = %25
ret void
}

LLVM IR (-O2):
define void @reset_arrays(i32* nocapture writeonly %0, [25 x double]* nocapture writeonly %1, [25 x double]* nocapture writeonly %2, [25 x double]* nocapture readnone %3, [25 x i32]* nocapture writeonly %4) {
%6 = bitcast i32* %0 to i8*
br label %7
7: ; preds = %5, %108
%8 = phi i64 [ 0, %5 ], [ %109, %108 ]
%9 = add nuw i64 %8, 1
%10 = getelementptr [25 x double], [25 x double]* %2, i64 %9, i64 0
%11 = getelementptr [25 x double], [25 x double]* %2, i64 %8, i64 0
%12 = getelementptr [25 x double], [25 x double]* %1, i64 %9, i64 0
%13 = getelementptr [25 x double], [25 x double]* %1, i64 %8, i64 0
%14 = icmp ult double* %13, %10
%15 = icmp ult double* %11, %12
%16 = and i1 %14, %15
br i1 %16, label %90, label %17
17: ; preds = %7
%18 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 0
%19 = bitcast double* %18 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %19
%20 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 0
%21 = bitcast double* %20 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %21
%22 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 0
%23 = bitcast i32* %22 to <2 x i32>*
store <2 x i32> zeroinitializer, <2 x i32>* %23
%24 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 2
%25 = bitcast double* %24 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %25
%26 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 2
%27 = bitcast double* %26 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %27
%28 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 2
%29 = bitcast i32* %28 to <2 x i32>*
store <2 x i32> zeroinitializer, <2 x i32>* %29
%30 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 4
%31 = bitcast double* %30 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %31
%32 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 4
%33 = bitcast double* %32 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %33
%34 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 4
%35 = bitcast i32* %34 to <2 x i32>*
store <2 x i32> zeroinitializer, <2 x i32>* %35
%36 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 6
%37 = bitcast double* %36 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %37
%38 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 6
%39 = bitcast double* %38 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %39
%40 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 6
%41 = bitcast i32* %40 to <2 x i32>*
store <2 x i32> zeroinitializer, <2 x i32>* %41
%42 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 8
%43 = bitcast double* %42 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %43
%44 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 8
%45 = bitcast double* %44 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %45
%46 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 8
%47 = bitcast i32* %46 to <2 x i32>*
store <2 x i32> zeroinitializer, <2 x i32>* %47
%48 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 10
%49 = bitcast double* %48 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %49
%50 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 10
%51 = bitcast double* %50 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %51
%52 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 10
%53 = bitcast i32* %52 to <2 x i32>*
store <2 x i32> zeroinitializer, <2 x i32>* %53
%54 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 12
%55 = bitcast double* %54 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %55
%56 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 12
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %57
%58 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 12
%59 = bitcast i32* %58 to <2 x i32>*
store <2 x i32> zeroinitializer, <2 x i32>* %59
%60 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 14
%61 = bitcast double* %60 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %61
%62 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 14
%63 = bitcast double* %62 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %63
%64 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 14
%65 = bitcast i32* %64 to <2 x i32>*
store <2 x i32> zeroinitializer, <2 x i32>* %65
%66 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 16
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %67
%68 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 16
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %69
%70 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 16
%71 = bitcast i32* %70 to <2 x i32>*
store <2 x i32> zeroinitializer, <2 x i32>* %71
%72 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 18
%73 = bitcast double* %72 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %73
%74 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 18
%75 = bitcast double* %74 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %75
%76 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 18
%77 = bitcast i32* %76 to <2 x i32>*
store <2 x i32> zeroinitializer, <2 x i32>* %77
%78 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 20
%79 = bitcast double* %78 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %79
%80 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 20
%81 = bitcast double* %80 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %81
%82 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 20
%83 = bitcast i32* %82 to <2 x i32>*
store <2 x i32> zeroinitializer, <2 x i32>* %83
%84 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 22
%85 = bitcast double* %84 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %85
%86 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 22
%87 = bitcast double* %86 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %87
%88 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 22
%89 = bitcast i32* %88 to <2 x i32>*
store <2 x i32> zeroinitializer, <2 x i32>* %89
br label %90
90: ; preds = %17, %7
%91 = phi i64 [ 0, %7 ], [ 24, %17 ]
%92 = and i1 %14, %15
%93 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 %91
store double 0.000000e+00, double* %93
%94 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 %91
store double 0.000000e+00, double* %94
%95 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 %91
store i32 0, i32* %95
%96 = or i64 %91, 1
br i1 %92, label %97, label %108
97: ; preds = %90, %97
%98 = phi i64 [ %106, %97 ], [ %96, %90 ]
%99 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 %98
store double 0.000000e+00, double* %99
%100 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 %98
store double 0.000000e+00, double* %100
%101 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 %98
store i32 0, i32* %101
%102 = add nuw nsw i64 %98, 1
%103 = getelementptr inbounds [25 x double], [25 x double]* %1, i64 %8, i64 %102
store double 0.000000e+00, double* %103
%104 = getelementptr inbounds [25 x double], [25 x double]* %2, i64 %8, i64 %102
store double 0.000000e+00, double* %104
%105 = getelementptr inbounds [25 x i32], [25 x i32]* %4, i64 %8, i64 %102
store i32 0, i32* %105
%106 = add nuw nsw i64 %98, 2
%107 = icmp eq i64 %106, 25
br i1 %107, label %108, label %97
108: ; preds = %97, %90
%109 = add nuw nsw i64 %8, 1
%110 = icmp eq i64 %109, 10000
br i1 %110, label %111, label %7
111: ; preds = %108
ret void
}