#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 */
double rng_phi();
double rng_theta();
void initialize(double ****lattice) {
  int i, j, k;
  for (i = 0; i < 20; i++) {
    for (j = 0; j < 20; j++) {
      for (k = 0; k < 20; k++) {
        lattice[i][j][k][0] = rng_theta();
        lattice[i][j][k][1] = rng_phi();
      }
    }
  }
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    11e2 <initialize+0xc2>
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    11cf <initialize+0xaf>
movl   $0x0,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    11bc <initialize+0x9c>
mov    $0x0,%al
call   1030 <rng_theta@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    $0x0,%al
call   1040 <rng_phi@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1155 <initialize+0x35>
jmp    11c1 <initialize+0xa1>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <initialize+0x24>
jmp    11d4 <initialize+0xb4>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <initialize+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %r15d,%r15d
xchg   %ax,%ax
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rng_theta@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%r12,8),%rax
mov    (%rax,%rbx,8),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
call   1040 <rng_phi@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%r12,8),%rax
mov    (%rax,%rbx,8),%rax
movsd  %xmm0,0x8(%rax)
add    $0x1,%rbx
cmp    $0x14,%rbx
jne    1150 <initialize+0x30>
add    $0x1,%r12
cmp    $0x14,%r12
jne    1140 <initialize+0x20>
add    $0x1,%r15
cmp    $0x14,%r15
jne    1130 <initialize+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @initialize(double**** nocapture %0) {
br label %2
2: ; preds = %1, %27
%3 = phi i64 [ 0, %1 ], [ %28, %27 ]
%4 = getelementptr inbounds double***, double**** %0, i64 %3
br label %5
5: ; preds = %2, %24
%6 = phi i64 [ 0, %2 ], [ %25, %24 ]
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %22, %7 ]
%9 = tail call double (...) @rng_theta()
%10 = load double***, double**** %4
%11 = getelementptr inbounds double**, double*** %10, i64 %6
%12 = load double**, double*** %11
%13 = getelementptr inbounds double*, double** %12, i64 %8
%14 = load double*, double** %13
store double %9, double* %14
%15 = tail call double (...) @rng_phi()
%16 = load double***, double**** %4
%17 = getelementptr inbounds double**, double*** %16, i64 %6
%18 = load double**, double*** %17
%19 = getelementptr inbounds double*, double** %18, i64 %8
%20 = load double*, double** %19
%21 = getelementptr inbounds double, double* %20, i64 1
store double %15, double* %21
%22 = add nuw nsw i64 %8, 1
%23 = icmp eq i64 %22, 20
br i1 %23, label %24, label %7
24: ; preds = %7
%25 = add nuw nsw i64 %6, 1
%26 = icmp eq i64 %25, 20
br i1 %26, label %27, label %5
27: ; preds = %24
%28 = add nuw nsw i64 %3, 1
%29 = icmp eq i64 %28, 20
br i1 %29, label %30, label %2
30: ; preds = %27
ret void
}