#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*/ fixup1zone(int, int, int, double *);
void fixup(double (*pv)[(((128) > 1) ? ((128) + 2 * (2)) : (1))]
                       [(((1) > 1) ? ((1) + 2 * (2)) : (1))][(9)]) {
  int i, j, k;
#pragma omp parallel for schedule(static, N1 *N2 *N3 / nthreads)               \
    collapse(3) default(none) shared(pv, nthreads) private(i, j, k)
  for (i = 0; i < (128); i++)
    for (j = 0; j < (128); j++)
      for (k = 0; k < (1); k++) {
        fixup1zone(i, j, k, pv[i][j][k]);
      }
}


x86 assembly (clang, -O0):
<fixup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    11bf <fixup+0xaf>
movl   $0x0,-0x10(%rbp)
cmpl   $0x80,-0x10(%rbp)
jge    11ac <fixup+0x9c>
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jge    1199 <fixup+0x89>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rax
imul   $0x2520,%rax,%rax
add    %rax,%rcx
movslq -0x10(%rbp),%rax
imul   $0x48,%rax,%rax
add    %rax,%rcx
movslq -0x14(%rbp),%rax
imul   $0x48,%rax,%rax
add    %rax,%rcx
call   1030 <fixup1zone@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <fixup+0x3b>
jmp    119e <fixup+0x8e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <fixup+0x27>
jmp    11b1 <fixup+0xa1>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <fixup+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixup>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %r15d,%r15d
xchg   %ax,%ax
mov    %r14,%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15d,%edi
mov    %ebx,%esi
xor    %edx,%edx
mov    %r12,%rcx
call   1030 <fixup1zone@plt>
add    $0x1,%rbx
add    $0x48,%r12
cmp    $0x80,%rbx
jne    1130 <fixup+0x20>
add    $0x1,%r15
add    $0x2520,%r14
cmp    $0x80,%r15
jne    1120 <fixup+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fixup([132 x [1 x [9 x double]]]* %0) {
%2 = alloca [132 x [1 x [9 x double]]]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store [132 x [1 x [9 x double]]]* %0, [132 x [1 x [9 x double]]]** %2
store i32 0, i32* %3
br label %6
6: ; preds = %41, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 128
br i1 %8, label %9, label %44
9: ; preds = %6
store i32 0, i32* %4
br label %10
10: ; preds = %37, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 128
br i1 %12, label %13, label %40
13: ; preds = %10
store i32 0, i32* %5
br label %14
14: ; preds = %33, %13
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, 1
br i1 %16, label %17, label %36
17: ; preds = %14
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = load [132 x [1 x [9 x double]]]*, [132 x [1 x [9 x double]]]** %2
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [132 x [1 x [9 x double]]], [132 x [1 x [9 x double]]]* %21, i64 %23
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [132 x [1 x [9 x double]]], [132 x [1 x [9 x double]]]* %24, i64 0, i64 %26
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [1 x [9 x double]], [1 x [9 x double]]* %27, i64 0, i64 %29
%31 = getelementptr inbounds [9 x double], [9 x double]* %30, i64 0, i64 0
%32 = call i32 @fixup1zone(i32 %18, i32 %19, i32 %20, double* %31)
br label %33
33: ; preds = %17
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %14
36: ; preds = %14
br label %37
37: ; preds = %36
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %10
40: ; preds = %10
br label %41
41: ; preds = %40
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 1
store i32 %43, i32* %3
br label %6
44: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @fixup([132 x [1 x [9 x double]]]* %0) {
br label %2
2: ; preds = %1, %12
%3 = phi i64 [ 0, %1 ], [ %13, %12 ]
%4 = trunc i64 %3 to i32
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %10, %5 ]
%7 = getelementptr inbounds [132 x [1 x [9 x double]]], [132 x [1 x [9 x double]]]* %0, i64 %3, i64 %6, i64 0, i64 0
%8 = trunc i64 %6 to i32
%9 = tail call i32 @fixup1zone(i32 %4, i32 %8, i32 0, double* %7)
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, 128
br i1 %11, label %12, label %5
12: ; preds = %5
%13 = add nuw nsw i64 %3, 1
%14 = icmp eq i64 %13, 128
br i1 %14, label %15, label %2
15: ; preds = %12
ret void
}