#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 < 6; i++) {
    for (j = 0; j < 6; j++) {
      for (k = 0; k < 6; 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   $0x6,-0xc(%rbp)
jge    11e2 <initialize+0xc2>
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    11cf <initialize+0xaf>
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-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   %rbx
mov    %rdi,%r14
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
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,%rbx,1),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
call   1040 <rng_phi@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%rbx,1),%rax
mov    (%rax),%rax
movsd  %xmm0,0x8(%rax)
xor    %eax,%eax
call   1030 <rng_theta@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%rbx,1),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
call   1040 <rng_phi@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%rbx,1),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,0x8(%rax)
xor    %eax,%eax
call   1030 <rng_theta@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%rbx,1),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
call   1040 <rng_phi@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%rbx,1),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x8(%rax)
xor    %eax,%eax
call   1030 <rng_theta@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%rbx,1),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
call   1040 <rng_phi@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%rbx,1),%rax
mov    0x18(%rax),%rax
movsd  %xmm0,0x8(%rax)
xor    %eax,%eax
call   1030 <rng_theta@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%rbx,1),%rax
mov    0x20(%rax),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
call   1040 <rng_phi@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%rbx,1),%rax
mov    0x20(%rax),%rax
movsd  %xmm0,0x8(%rax)
xor    %eax,%eax
call   1030 <rng_theta@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%rbx,1),%rax
mov    0x28(%rax),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
call   1040 <rng_phi@plt>
mov    (%r14,%r15,8),%rax
mov    (%rax,%rbx,1),%rax
mov    0x28(%rax),%rax
movsd  %xmm0,0x8(%rax)
add    $0x8,%rbx
cmp    $0x30,%rbx
jne    1140 <initialize+0x20>
add    $0x1,%r15
cmp    $0x6,%r15
jne    1130 <initialize+0x10>
pop    %rbx
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, 6
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, 6
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, 6
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, %85
%3 = phi i64 [ 0, %1 ], [ %86, %85 ]
%4 = getelementptr inbounds double***, double**** %0, i64 %3
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %83, %5 ]
%7 = tail call double (...) @rng_theta()
%8 = load double***, double**** %4
%9 = getelementptr inbounds double**, double*** %8, i64 %6
%10 = load double**, double*** %9
%11 = load double*, double** %10
store double %7, double* %11
%12 = tail call double (...) @rng_phi()
%13 = load double***, double**** %4
%14 = getelementptr inbounds double**, double*** %13, i64 %6
%15 = load double**, double*** %14
%16 = load double*, double** %15
%17 = getelementptr inbounds double, double* %16, i64 1
store double %12, double* %17
%18 = tail call double (...) @rng_theta()
%19 = load double***, double**** %4
%20 = getelementptr inbounds double**, double*** %19, i64 %6
%21 = load double**, double*** %20
%22 = getelementptr inbounds double*, double** %21, i64 1
%23 = load double*, double** %22
store double %18, double* %23
%24 = tail call double (...) @rng_phi()
%25 = load double***, double**** %4
%26 = getelementptr inbounds double**, double*** %25, i64 %6
%27 = load double**, double*** %26
%28 = getelementptr inbounds double*, double** %27, i64 1
%29 = load double*, double** %28
%30 = getelementptr inbounds double, double* %29, i64 1
store double %24, double* %30
%31 = tail call double (...) @rng_theta()
%32 = load double***, double**** %4
%33 = getelementptr inbounds double**, double*** %32, i64 %6
%34 = load double**, double*** %33
%35 = getelementptr inbounds double*, double** %34, i64 2
%36 = load double*, double** %35
store double %31, double* %36
%37 = tail call double (...) @rng_phi()
%38 = load double***, double**** %4
%39 = getelementptr inbounds double**, double*** %38, i64 %6
%40 = load double**, double*** %39
%41 = getelementptr inbounds double*, double** %40, i64 2
%42 = load double*, double** %41
%43 = getelementptr inbounds double, double* %42, i64 1
store double %37, double* %43
%44 = tail call double (...) @rng_theta()
%45 = load double***, double**** %4
%46 = getelementptr inbounds double**, double*** %45, i64 %6
%47 = load double**, double*** %46
%48 = getelementptr inbounds double*, double** %47, i64 3
%49 = load double*, double** %48
store double %44, double* %49
%50 = tail call double (...) @rng_phi()
%51 = load double***, double**** %4
%52 = getelementptr inbounds double**, double*** %51, i64 %6
%53 = load double**, double*** %52
%54 = getelementptr inbounds double*, double** %53, i64 3
%55 = load double*, double** %54
%56 = getelementptr inbounds double, double* %55, i64 1
store double %50, double* %56
%57 = tail call double (...) @rng_theta()
%58 = load double***, double**** %4
%59 = getelementptr inbounds double**, double*** %58, i64 %6
%60 = load double**, double*** %59
%61 = getelementptr inbounds double*, double** %60, i64 4
%62 = load double*, double** %61
store double %57, double* %62
%63 = tail call double (...) @rng_phi()
%64 = load double***, double**** %4
%65 = getelementptr inbounds double**, double*** %64, i64 %6
%66 = load double**, double*** %65
%67 = getelementptr inbounds double*, double** %66, i64 4
%68 = load double*, double** %67
%69 = getelementptr inbounds double, double* %68, i64 1
store double %63, double* %69
%70 = tail call double (...) @rng_theta()
%71 = load double***, double**** %4
%72 = getelementptr inbounds double**, double*** %71, i64 %6
%73 = load double**, double*** %72
%74 = getelementptr inbounds double*, double** %73, i64 5
%75 = load double*, double** %74
store double %70, double* %75
%76 = tail call double (...) @rng_phi()
%77 = load double***, double**** %4
%78 = getelementptr inbounds double**, double*** %77, i64 %6
%79 = load double**, double*** %78
%80 = getelementptr inbounds double*, double** %79, i64 5
%81 = load double*, double** %80
%82 = getelementptr inbounds double, double* %81, i64 1
store double %76, double* %82
%83 = add nuw nsw i64 %6, 1
%84 = icmp eq i64 %83, 6
br i1 %84, label %85, label %5
85: ; preds = %5
%86 = add nuw nsw i64 %3, 1
%87 = icmp eq i64 %86, 6
br i1 %87, label %88, label %2
88: ; preds = %85
ret void
}