#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 < 4; i++) {
    for (j = 0; j < 4; j++) {
      for (k = 0; k < 4; 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   $0x4,-0xc(%rbp)
jge    11e2 <initialize+0xc2>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    11cf <initialize+0xaf>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-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)
add    $0x8,%rbx
cmp    $0x20,%rbx
jne    1140 <initialize+0x20>
add    $0x1,%r15
cmp    $0x4,%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, 4
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, 4
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, 4
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, %59
%3 = phi i64 [ 0, %1 ], [ %60, %59 ]
%4 = getelementptr inbounds double***, double**** %0, i64 %3
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %57, %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 = add nuw nsw i64 %6, 1
%58 = icmp eq i64 %57, 4
br i1 %58, label %59, label %5
59: ; preds = %5
%60 = add nuw nsw i64 %3, 1
%61 = icmp eq i64 %60, 4
br i1 %61, label %62, label %2
62: ; preds = %59
ret void
}