user: Demonstrate the C code that generates the assembly output below:

```asm
<measurement>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x228,%rsp
  movsd  D81(%rip),%xmm5
  mov    %rdi,-0x1f0(%rbp)
  mov    %rsi,-0x240(%rbp)
  divsd  %xmm0,%xmm5
  mov    %r8d,-0x238(%rbp)
  movsd  %xmm0,-0x248(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  movsd  %xmm5,-0x1d8(%rbp)
  cmp    %rax,%rsp
  je     L19
L164:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L164
L19:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,%rax
  mov    %rsp,-0x210(%rbp)
  cmp    %rax,%rsp
  je     L84
L105:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L105
L84:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,%rax
  mov    %rsp,-0x218(%rbp)
  cmp    %rax,%rsp
  je     L135
L87:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L87
L135:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,%rax
  mov    %rsp,-0x220(%rbp)
  cmp    %rax,%rsp
  je     L335
L220:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L220
L335:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,%rax
  mov    %rsp,-0x200(%rbp)
  cmp    %rax,%rsp
  je     L88
L12:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L12
L88:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,%rax
  mov    %rsp,-0x208(%rbp)
  cmp    %rax,%rsp
  je     L102
L79:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L79
L102:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,%rax
  mov    %rsp,-0x228(%rbp)
  cmp    %rax,%rsp
  je     L254
L97:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L97
L254:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,-0x230(%rbp)
  lea    -0x48(%rbp),%r14
  lea    -0x50(%rbp),%r13
  movq   $0x0,-0x1f8(%rbp)
L321:
  movl   $0x1e,-0x1e8(%rbp)
L261:
  movl   $0xfa,-0x234(%rbp)
L62:
  mov    -0x1f0(%rbp),%rax
  movl   $0x0,-0x1e4(%rbp)
  mov    %rax,-0xb8(%rbp)
L271:
  mov    -0x1e4(%rbp),%edx
  mov    -0x1f0(%rbp),%rcx
  mov    %r13,%r12
  mov    %r14,%r13
  movq   $0x0,-0x1e0(%rbp)
  lea    0xf(%rdx),%eax
  add    $0x1,%edx
  mov    %edx,-0x1e4(%rbp)
  and    $0xf,%eax
  and    $0xf,%edx
  lea    (%rcx,%rdx,8),%rdx
  lea    (%rcx,%rax,8),%rax
  mov    %rdx,-0x1a8(%rbp)
  mov    %rax,-0x1b0(%rbp)
  nopl   0x0(%rax)
L17:
  mov    -0x1e0(%rbp),%rdx
  xor    %r14d,%r14d
  lea    0x0(,%rdx,8),%rax
  mov    %rax,-0x58(%rbp)
  mov    %edx,%eax
  add    $0x1,%eax
  and    $0xf,%eax
  shl    $0x3,%rax
  mov    %rax,-0x198(%rbp)
  mov    %edx,%eax
  add    $0xf,%eax
  and    $0xf,%eax
  shl    $0x3,%rax
  mov    %rax,-0x1a0(%rbp)
  jmp    L137
  nopl   0x0(%rax)
L311:
  mov    -0x190(%rbp),%rax
  movapd -0xb0(%rbp),%xmm5
  mov    (%rax,%r14,8),%rdx
  movups %xmm5,(%rdx)
  movsd  D81(%rip),%xmm5
  addsd  -0x70(%rbp),%xmm5
  movsd  %xmm5,-0x70(%rbp)
L276:
  movsd  -0xa0(%rbp),%xmm0
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    %rax,-0x160(%rbp)
  call   <sincos@plt>
  mov    -0x78(%rbp),%rax
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x48(%rbp),%xmm2
  movsd  -0x50(%rbp),%xmm1
  movsd  (%rax),%xmm0
  movsd  %xmm2,-0x150(%rbp)
  movsd  %xmm1,-0x158(%rbp)
  call   <sincos@plt>
  mov    -0x78(%rbp),%rax
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x50(%rbp),%xmm1
  movsd  -0x48(%rbp),%xmm9
  movsd  0x8(%rax),%xmm0
  movsd  %xmm1,-0xb0(%rbp)
  movsd  %xmm9,-0x148(%rbp)
  call   <sincos@plt>
  mov    -0x80(%rbp),%rax
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x50(%rbp),%xmm12
  movsd  -0x48(%rbp),%xmm5
  movsd  (%rax),%xmm0
  movsd  %xmm12,-0x140(%rbp)
  movsd  %xmm5,-0x78(%rbp)
  call   <sincos@plt>
  mov    -0x80(%rbp),%rax
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x48(%rbp),%xmm8
  movsd  -0x50(%rbp),%xmm7
  movsd  0x8(%rax),%xmm0
  movsd  %xmm8,-0x138(%rbp)
  movsd  %xmm7,-0xf0(%rbp)
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm2
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    -0xc0(%rbp),%rax
  movsd  -0x50(%rbp),%xmm10
  movsd  %xmm2,-0xd8(%rbp)
  movsd  %xmm10,-0x130(%rbp)
  movsd  (%rax),%xmm0
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm7
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x50(%rbp),%xmm3
  movsd  (%r15),%xmm0
  movsd  %xmm7,-0x128(%rbp)
  movsd  %xmm3,-0xe0(%rbp)
  call   <sincos@plt>
  movsd  -0x50(%rbp),%xmm4
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  0x8(%r15),%xmm0
  movsd  %xmm4,-0xc0(%rbp)
  movsd  -0x48(%rbp),%xmm4
  movsd  %xmm4,-0x120(%rbp)
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm6
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    -0xc8(%rbp),%r15
  movsd  -0x50(%rbp),%xmm11
  movsd  %xmm6,-0x110(%rbp)
  movsd  %xmm11,-0x118(%rbp)
  movsd  (%r15),%xmm0
  call   <sincos@plt>
  movsd  -0x50(%rbp),%xmm0
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x48(%rbp),%xmm5
  movsd  %xmm0,-0xc8(%rbp)
  movsd  0x8(%r15),%xmm0
  movsd  %xmm5,-0x108(%rbp)
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm2
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  (%rbx),%xmm0
  mov    -0x50(%rbp),%r15
  movsd  %xmm2,-0xe8(%rbp)
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm3
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x50(%rbp),%xmm13
  movsd  0x8(%rbx),%xmm0
  movsd  %xmm3,-0x100(%rbp)
  movsd  %xmm13,-0x80(%rbp)
  call   <sincos@plt>
  movsd  -0x128(%rbp),%xmm7
  movsd  -0x140(%rbp),%xmm12
  movsd  -0x148(%rbp),%xmm9
  movsd  -0x78(%rbp),%xmm6
  movsd  -0x138(%rbp),%xmm8
  movapd %xmm12,%xmm0
  movsd  -0x130(%rbp),%xmm10
  mulsd  %xmm9,%xmm0
  movsd  -0x120(%rbp),%xmm4
  movsd  -0x118(%rbp),%xmm11
  mulsd  %xmm8,%xmm10
  movsd  -0x108(%rbp),%xmm5
  movsd  -0x100(%rbp),%xmm3
  movsd  -0x68(%rbp),%xmm14
  mulsd  %xmm9,%xmm6
  movsd  -0x158(%rbp),%xmm1
  mulsd  -0xd8(%rbp),%xmm8
  movsd  -0x150(%rbp),%xmm2
  mulsd  %xmm14,%xmm1
  subsd  -0x88(%rbp),%xmm1
  mulsd  %xmm14,%xmm2
  addsd  %xmm10,%xmm0
  movapd %xmm7,%xmm10
  subsd  -0x90(%rbp),%xmm2
  mulsd  %xmm11,%xmm10
  mulsd  %xmm4,%xmm11
  addsd  %xmm10,%xmm0
  movq   %r15,%xmm10
  mulsd  %xmm5,%xmm10
  addsd  %xmm11,%xmm0
  addsd  %xmm10,%xmm0
  movsd  -0x50(%rbp),%xmm10
  mulsd  %xmm3,%xmm10
  mulsd  -0x48(%rbp),%xmm3
  addsd  %xmm10,%xmm0
  mulsd  %xmm1,%xmm0
  movapd %xmm6,%xmm1
  movsd  -0x110(%rbp),%xmm6
  addsd  %xmm8,%xmm1
  mulsd  %xmm6,%xmm7
  mulsd  %xmm6,%xmm4
  addsd  %xmm7,%xmm1
  addsd  %xmm4,%xmm1
  movsd  -0xe8(%rbp),%xmm4
  mulsd  %xmm5,%xmm4
  movsd  D81(%rip),%xmm5
  addsd  -0xf8(%rbp),%xmm5
  movsd  %xmm5,-0xd8(%rbp)
  pxor   %xmm5,%xmm5
  addsd  %xmm4,%xmm1
  addsd  %xmm3,%xmm1
  mulsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  movsd  -0xb0(%rbp),%xmm1
  addsd  -0xf0(%rbp),%xmm1
  addsd  -0xe0(%rbp),%xmm1
  addsd  -0xc0(%rbp),%xmm1
  addsd  -0xc8(%rbp),%xmm1
  addsd  -0x80(%rbp),%xmm1
  mulsd  -0x98(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  comisd %xmm5,%xmm0
  jb     L221
  mov    -0xd0(%rbp),%rcx
  mov    -0x160(%rbp),%rax
  movsd  -0xa0(%rbp),%xmm7
  movsd  -0x60(%rbp),%xmm2
  mov    (%rax,%rcx,1),%rax
  movsd  %xmm7,0x8(%rax)
  movsd  D81(%rip),%xmm7
  addsd  -0x70(%rbp),%xmm7
  movsd  %xmm2,(%rax)
  movsd  %xmm7,-0x70(%rbp)
L241:
  add    $0x1,%r14
  cmp    $0x10,%r14
  je     L184
L137:
  lea    0x0(,%r14,8),%rax
  mov    -0x58(%rbp),%rbx
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    %rax,-0xd0(%rbp)
  mov    -0xb8(%rbp),%rax
  mov    (%rax),%rax
  mov    (%rax,%rbx,1),%rax
  mov    (%rax,%r14,8),%rax
  movsd  (%rax),%xmm6
  movupd (%rax),%xmm5
  movapd %xmm6,%xmm0
  movaps %xmm5,-0xb0(%rbp)
  movsd  %xmm6,-0x60(%rbp)
  call   <sincos@plt>
  movsd  -0x50(%rbp),%xmm1
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x48(%rbp),%xmm4
  movsd  -0xa8(%rbp),%xmm0
  movsd  %xmm1,-0x78(%rbp)
  movsd  %xmm4,-0x68(%rbp)
  call   <sincos@plt>
  xor    %eax,%eax
  mov    -0x50(%rbp),%r15
  mov    -0x48(%rbp),%rbx
  call   <rng_theta@plt>
  xor    %eax,%eax
  call   <rng_phi@plt>
  movsd  -0x68(%rbp),%xmm4
  mov    %r12,%rsi
  mov    %r13,%rdi
  pxor   %xmm7,%xmm7
  movq   %r15,%xmm5
  movsd  -0x78(%rbp),%xmm1
  mov    -0x1a8(%rbp),%rcx
  cvtsi2sd %eax,%xmm7
  mulsd  %xmm4,%xmm5
  mov    (%rcx),%rax
  subsd  %xmm1,%xmm1
  movapd %xmm7,%xmm6
  movsd  %xmm7,-0xa0(%rbp)
  movsd  -0x60(%rbp),%xmm7
  movsd  %xmm5,-0x88(%rbp)
  unpcklpd %xmm6,%xmm7
  movq   %rbx,%xmm6
  mov    -0x58(%rbp),%rbx
  movsd  %xmm1,-0x98(%rbp)
  mulsd  %xmm4,%xmm6
  movaps %xmm7,-0x1d0(%rbp)
  mov    (%rax,%rbx,1),%rax
  mov    (%rax,%r14,8),%r15
  movsd  (%r15),%xmm0
  movsd  %xmm6,-0x90(%rbp)
  mov    %r15,-0x78(%rbp)
  call   <sincos@plt>
  movsd  -0x50(%rbp),%xmm7
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  0x8(%r15),%xmm0
  movsd  %xmm7,-0x128(%rbp)
  movsd  -0x48(%rbp),%xmm7
  movsd  %xmm7,-0x188(%rbp)
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm3
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    -0x1b0(%rbp),%rcx
  movsd  -0x50(%rbp),%xmm11
  mov    %rbx,-0x58(%rbp)
  movsd  %xmm3,-0x120(%rbp)
  movsd  %xmm11,-0x180(%rbp)
  mov    (%rcx),%rax
  mov    (%rax,%rbx,1),%rax
  mov    (%rax,%r14,8),%r15
  movsd  (%r15),%xmm0
  mov    %r15,-0x80(%rbp)
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm3
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x50(%rbp),%xmm4
  movsd  0x8(%r15),%xmm0
  movsd  %xmm3,-0x178(%rbp)
  movsd  %xmm4,-0x118(%rbp)
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm0
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    -0xb8(%rbp),%rdx
  movsd  -0x50(%rbp),%xmm1
  movsd  %xmm0,-0x130(%rbp)
  mov    (%rdx),%rbx
  mov    -0x198(%rbp),%rdx
  movsd  %xmm1,-0x170(%rbp)
  mov    (%rbx,%rdx,1),%rax
  mov    (%rax,%r14,8),%r15
  movsd  (%r15),%xmm0
  mov    %r15,-0xc0(%rbp)
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm6
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x50(%rbp),%xmm12
  movsd  0x8(%r15),%xmm0
  movsd  %xmm6,-0x168(%rbp)
  movsd  %xmm12,-0x100(%rbp)
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm4
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    -0x1a0(%rbp),%rdx
  movsd  -0x50(%rbp),%xmm10
  movsd  %xmm4,-0xe8(%rbp)
  movsd  %xmm10,-0x160(%rbp)
  mov    (%rbx,%rdx,1),%rax
  mov    (%rax,%r14,8),%r15
  movsd  (%r15),%xmm0
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm5
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x50(%rbp),%xmm14
  movsd  0x8(%r15),%xmm0
  movsd  %xmm5,-0x158(%rbp)
  movsd  %xmm14,-0xe0(%rbp)
  call   <sincos@plt>
  mov    -0x58(%rbp),%rax
  lea    0x1(%r14),%edx
  mov    %r12,%rsi
  mov    %edx,%ecx
  movsd  -0x48(%rbp),%xmm0
  movsd  -0x50(%rbp),%xmm9
  mov    %r13,%rdi
  mov    (%rbx,%rax,1),%rax
  and    $0xf,%ecx
  movsd  %xmm0,-0x108(%rbp)
  mov    (%rax,%rcx,8),%rbx
  mov    %rcx,-0x1b8(%rbp)
  mov    %rax,-0x110(%rbp)
  movsd  (%rbx),%xmm0
  mov    %rbx,-0xc8(%rbp)
  movsd  %xmm9,-0x150(%rbp)
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm4
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x50(%rbp),%xmm9
  movsd  0x8(%rbx),%xmm0
  movsd  %xmm4,-0x148(%rbp)
  movsd  %xmm9,-0xf8(%rbp)
  call   <sincos@plt>
  lea    0xf(%r14),%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    %edx,%eax
  movsd  -0x50(%rbp),%xmm8
  movsd  -0x48(%rbp),%xmm14
  and    $0xf,%eax
  mov    %rax,%rdx
  mov    %rax,-0x1c0(%rbp)
  mov    -0x110(%rbp),%rax
  movsd  %xmm8,-0x140(%rbp)
  mov    (%rax,%rdx,8),%rbx
  mov    %rax,-0x190(%rbp)
  movsd  %xmm14,-0xf0(%rbp)
  movsd  (%rbx),%xmm0
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm2
  mov    %r12,%rsi
  mov    %r13,%rdi
  movsd  -0x50(%rbp),%xmm11
  movsd  0x8(%rbx),%xmm0
  movsd  %xmm2,-0x138(%rbp)
  movsd  %xmm11,-0x110(%rbp)
  call   <sincos@plt>
  movsd  -0x188(%rbp),%xmm7
  movsd  -0x180(%rbp),%xmm11
  movsd  -0x178(%rbp),%xmm3
  movsd  -0x50(%rbp),%xmm15
  movsd  -0x170(%rbp),%xmm1
  mulsd  %xmm7,%xmm11
  movsd  -0x168(%rbp),%xmm6
  movsd  -0x158(%rbp),%xmm5
  movsd  -0x148(%rbp),%xmm4
  mulsd  %xmm3,%xmm1
  movsd  -0x160(%rbp),%xmm10
  movsd  -0x150(%rbp),%xmm9
  movsd  -0x138(%rbp),%xmm2
  mulsd  -0x130(%rbp),%xmm3
  movsd  -0x140(%rbp),%xmm8
  mulsd  %xmm6,%xmm10
  movsd  -0x88(%rbp),%xmm13
  mulsd  %xmm5,%xmm9
  movapd %xmm11,%xmm0
  mulsd  %xmm4,%xmm8
  addsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm15
  movapd %xmm13,%xmm1
  subsd  %xmm13,%xmm1
  mulsd  -0x48(%rbp),%xmm2
  addsd  %xmm10,%xmm0
  addsd  %xmm9,%xmm0
  addsd  %xmm8,%xmm0
  addsd  %xmm15,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x120(%rbp),%xmm1
  mulsd  %xmm7,%xmm1
  movsd  -0x128(%rbp),%xmm7
  addsd  -0x118(%rbp),%xmm7
  addsd  %xmm3,%xmm1
  movsd  -0xe8(%rbp),%xmm3
  mulsd  %xmm6,%xmm3
  movsd  -0x90(%rbp),%xmm6
  addsd  %xmm3,%xmm1
  movsd  -0x108(%rbp),%xmm3
  mulsd  %xmm5,%xmm3
  addsd  %xmm3,%xmm1
  movsd  -0xf0(%rbp),%xmm3
  mulsd  %xmm4,%xmm3
  addsd  %xmm3,%xmm1
  addsd  %xmm2,%xmm1
  movapd %xmm6,%xmm2
  subsd  %xmm6,%xmm2
  mulsd  %xmm2,%xmm1
  movsd  D81(%rip),%xmm2
  addsd  -0xd8(%rbp),%xmm2
  addsd  %xmm1,%xmm0
  movsd  -0x100(%rbp),%xmm1
  addsd  %xmm7,%xmm1
  addsd  -0xe0(%rbp),%xmm1
  addsd  -0xf8(%rbp),%xmm1
  addsd  -0x110(%rbp),%xmm1
  movsd  %xmm2,-0xf8(%rbp)
  pxor   %xmm2,%xmm2
  mulsd  -0x98(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  comisd %xmm2,%xmm0
  jae    L311
  mulsd  -0x1d8(%rbp),%xmm0
  call   <exp@plt>
  movsd  -0x68(%rbp),%xmm6
  xor    %eax,%eax
  movapd %xmm0,%xmm1
  movapd %xmm6,%xmm0
  divsd  %xmm6,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x78(%rbp)
  call   <rng@plt>
  pxor   %xmm1,%xmm1
  movsd  -0x78(%rbp),%xmm0
  cvtsi2sd %eax,%xmm1
  comisd %xmm1,%xmm0
  jae    L322
  mov    -0x1a8(%rbp),%rax
  mov    -0x58(%rbp),%rsi
  mov    -0xd0(%rbp),%rcx
  mov    -0x198(%rbp),%rdx
  mov    (%rax),%rax
  mov    (%rax,%rsi,1),%rax
  mov    (%rax,%rcx,1),%rax
  mov    %rax,-0x78(%rbp)
  mov    -0x1b0(%rbp),%rax
  mov    (%rax),%rax
  mov    (%rax,%rsi,1),%rax
  mov    (%rax,%rcx,1),%rax
  mov    %rax,-0x80(%rbp)
  mov    -0xb8(%rbp),%rax
  mov    (%rax),%rax
  mov    (%rax,%rdx,1),%rdx
  mov    (%rdx,%rcx,1),%rdx
  mov    %rdx,-0xc0(%rbp)
  mov    -0x1a0(%rbp),%rdx
  mov    (%rax,%rdx,1),%rdx
  mov    (%rax,%rsi,1),%rax
  mov    (%rdx,%rcx,1),%r15
L237:
  mov    -0x1b8(%rbp),%rdx
  mov    (%rax,%rdx,8),%rdx
  mov    %rdx,-0xc8(%rbp)
  mov    -0x1c0(%rbp),%rdx
  mov    (%rax,%rdx,8),%rbx
  jmp    L276
  nopw   0x0(%rax,%rax,1)
L221:
  mulsd  -0x1d8(%rbp),%xmm0
  call   <exp@plt>
  xor    %eax,%eax
  movapd %xmm0,%xmm1
  movsd  -0x68(%rbp),%xmm0
  divsd  %xmm0,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  call   <rng@plt>
  pxor   %xmm1,%xmm1
  movsd  -0x60(%rbp),%xmm0
  cvtsi2sd %eax,%xmm1
  comisd %xmm1,%xmm0
  jb     L241
  mov    -0xb8(%rbp),%rax
  mov    -0x58(%rbp),%rdx
  add    $0x1,%r14
  movsd  D81(%rip),%xmm5
  addsd  -0x70(%rbp),%xmm5
  mov    (%rax),%rax
  movapd -0x1d0(%rbp),%xmm6
  mov    (%rax,%rdx,1),%rax
  mov    -0xd0(%rbp),%rdx
  movsd  %xmm5,-0x70(%rbp)
  mov    (%rax,%rdx,1),%rax
  movups %xmm6,(%rax)
  cmp    $0x10,%r14
  jne    L137
  nopl   0x0(%rax)
L184:
  addq   $0x1,-0x1e0(%rbp)
  mov    -0x1e0(%rbp),%rax
  cmp    $0x10,%rax
  jne    L17
  addq   $0x8,-0xb8(%rbp)
  cmpl   $0x10,-0x1e4(%rbp)
  mov    %r13,%r14
  mov    %r12,%r13
  jne    L271
  subl   $0x1,-0x234(%rbp)
  jne    L62
  subl   $0x1,-0x1e8(%rbp)
  jne    L261
  pxor   %xmm4,%xmm4
  mov    $0x1,%edx
  movapd %xmm4,%xmm2
  movapd %xmm4,%xmm3
  movapd %xmm4,%xmm1
L298:
  mov    -0x1f0(%rbp),%rdi
  mov    %rdx,%rax
  and    $0xf,%eax
  mov    (%rdi,%rax,8),%r10
  lea    0xe(%rdx),%eax
  mov    -0x8(%rdi,%rdx,8),%rcx
  and    $0xf,%eax
  mov    (%rdi,%rax,8),%r9
  mov    $0x1,%eax
L348:
  mov    -0x8(%r9,%rax,8),%rdi
  mov    %rax,%rsi
  mov    -0x8(%rcx,%rax,8),%r12
  mov    $0x1,%ebx
  and    $0xf,%esi
  mov    -0x8(%r10,%rax,8),%r15
  mov    %rdi,-0x58(%rbp)
  mov    (%rcx,%rsi,8),%rdi
  lea    0xe(%rax),%esi
  and    $0xf,%esi
  mov    %rdi,-0x60(%rbp)
  mov    (%rcx,%rsi,8),%rdi
  mov    %rdi,-0x68(%rbp)
L23:
  mov    -0x8(%r12,%rbx,8),%r8
  mov    %r13,%rsi
  mov    %r14,%rdi
  mov    %rdx,-0x198(%rbp)
  mov    %r9,-0x168(%rbp)
  movsd  (%r8),%xmm0
  mov    %r10,-0x160(%rbp)
  mov    %rcx,-0x158(%rbp)
  movsd  %xmm1,-0x178(%rbp)
  movsd  %xmm4,-0x170(%rbp)
  movsd  %xmm3,-0x180(%rbp)
  movsd  %xmm2,-0x188(%rbp)
  mov    %rax,-0x190(%rbp)
  mov    %r8,-0x80(%rbp)
  call   <sincos@plt>
  mov    -0x80(%rbp),%r8
  mov    %r13,%rsi
  mov    %r14,%rdi
  movsd  -0x50(%rbp),%xmm9
  movsd  -0x48(%rbp),%xmm5
  movsd  0x8(%r8),%xmm0
  movsd  %xmm9,-0x150(%rbp)
  movsd  %xmm5,-0x78(%rbp)
  call   <sincos@plt>
  movsd  -0x78(%rbp),%xmm5
  mov    %r13,%rsi
  mov    %r14,%rdi
  movsd  -0x50(%rbp),%xmm10
  mov    -0x8(%r15,%rbx,8),%r8
  mulsd  %xmm5,%xmm10
  movsd  (%r8),%xmm0
  mov    %r8,-0x78(%rbp)
  mulsd  -0x48(%rbp),%xmm5
  movsd  %xmm10,-0x148(%rbp)
  movsd  %xmm5,-0x140(%rbp)
  call   <sincos@plt>
  movsd  -0x50(%rbp),%xmm0
  mov    %r13,%rsi
  mov    %r14,%rdi
  mov    -0x78(%rbp),%r8
  movsd  -0x48(%rbp),%xmm15
  movsd  %xmm0,-0xb8(%rbp)
  movsd  %xmm15,-0x138(%rbp)
  movsd  0x8(%r8),%xmm0
  call   <sincos@plt>
  mov    -0x58(%rbp),%rax
  mov    %r13,%rsi
  mov    %r14,%rdi
  movsd  -0x50(%rbp),%xmm8
  movsd  -0x48(%rbp),%xmm5
  mov    -0x8(%rax,%rbx,8),%r8
  movsd  %xmm8,-0x130(%rbp)
  movsd  (%r8),%xmm0
  movsd  %xmm5,-0x88(%rbp)
  mov    %r8,-0x78(%rbp)
  call   <sincos@plt>
  mov    -0x78(%rbp),%r8
  mov    %r13,%rsi
  mov    %r14,%rdi
  movsd  -0x48(%rbp),%xmm14
  movsd  -0x50(%rbp),%xmm2
  movsd  0x8(%r8),%xmm0
  movsd  %xmm14,-0x128(%rbp)
  movsd  %xmm2,-0xf0(%rbp)
  call   <sincos@plt>
  mov    -0x60(%rbp),%rax
  mov    %r13,%rsi
  mov    %r14,%rdi
  movsd  -0x48(%rbp),%xmm2
  movsd  -0x50(%rbp),%xmm6
  mov    -0x8(%rax,%rbx,8),%r8
  movsd  %xmm2,-0x78(%rbp)
  movsd  (%r8),%xmm0
  mov    %r8,-0x80(%rbp)
  movsd  %xmm6,-0x120(%rbp)
  call   <sincos@plt>
  mov    -0x80(%rbp),%r8
  mov    %r13,%rsi
  mov    %r14,%rdi
  movsd  -0x48(%rbp),%xmm13
  movsd  -0x50(%rbp),%xmm6
  movsd  0x8(%r8),%xmm0
  movsd  %xmm13,-0x118(%rbp)
  movsd  %xmm6,-0xe8(%rbp)
  call   <sincos@plt>
  mov    -0x68(%rbp),%rax
  mov    %r13,%rsi
  mov    %r14,%rdi
  movsd  -0x50(%rbp),%xmm7
  movsd  -0x48(%rbp),%xmm6
  mov    -0x8(%rax,%rbx,8),%r8
  movsd  %xmm7,-0xb0(%rbp)
  movsd  (%r8),%xmm0
  movsd  %xmm6,-0xa0(%rbp)
  mov    %r8,-0x80(%rbp)
  call   <sincos@plt>
  mov    -0x80(%rbp),%r8
  mov    %r13,%rsi
  mov    %r14,%rdi
  movsd  -0x48(%rbp),%xmm12
  movsd  -0x50(%rbp),%xmm3
  movsd  0x8(%r8),%xmm0
  movsd  %xmm12,-0x110(%rbp)
  movsd  %xmm3,-0xc8(%rbp)
  call   <sincos@plt>
  mov    %rbx,%rsi
  movsd  -0x50(%rbp),%xmm6
  mov    %r14,%rdi
  and    $0xf,%esi
  movsd  -0x48(%rbp),%xmm3
  mov    (%r12,%rsi,8),%r8
  mov    %r13,%rsi
  movsd  %xmm6,-0xd0(%rbp)
  movsd  %xmm3,-0xe0(%rbp)
  movsd  (%r8),%xmm0
  mov    %r8,-0x90(%rbp)
  call   <sincos@plt>
  movsd  -0x50(%rbp),%xmm4
  mov    %r13,%rsi
  mov    %r14,%rdi
  mov    -0x90(%rbp),%r8
  movsd  -0x48(%rbp),%xmm11
  movsd  %xmm4,-0x80(%rbp)
  movsd  %xmm11,-0x108(%rbp)
  movsd  0x8(%r8),%xmm0
  call   <sincos@plt>
  lea    0xe(%rbx),%esi
  movsd  -0x50(%rbp),%xmm4
  mov    %r14,%rdi
  and    $0xf,%esi
  movsd  -0x48(%rbp),%xmm1
  add    $0x1,%rbx
  mov    (%r12,%rsi,8),%r8
  mov    %r13,%rsi
  movsd  %xmm4,-0x90(%rbp)
  movsd  %xmm1,-0x98(%rbp)
  movsd  (%r8),%xmm0
  mov    %r8,-0x100(%rbp)
  call   <sincos@plt>
  movsd  -0x48(%rbp),%xmm7
  mov    %r13,%rsi
  mov    %r14,%rdi
  mov    -0x100(%rbp),%r8
  movsd  -0x50(%rbp),%xmm15
  movsd  %xmm7,-0xf8(%rbp)
  movsd  %xmm15,-0xc0(%rbp)
  movsd  0x8(%r8),%xmm0
  call   <sincos@plt>
  movsd  -0x78(%rbp),%xmm2
  cmp    $0x11,%rbx
  movsd  -0x138(%rbp),%xmm15
  movsd  -0x128(%rbp),%xmm14
  mov    -0x158(%rbp),%rcx
  movsd  -0x120(%rbp),%xmm6
  movsd  -0xb0(%rbp),%xmm7
  movsd  -0x130(%rbp),%xmm8
  mulsd  %xmm14,%xmm2
  movsd  -0x118(%rbp),%xmm13
  mulsd  %xmm14,%xmm6
  movsd  -0x88(%rbp),%xmm5
  movsd  -0x110(%rbp),%xmm12
  mulsd  %xmm15,%xmm8
  movsd  -0xe0(%rbp),%xmm3
  movsd  -0x108(%rbp),%xmm11
  mulsd  %xmm13,%xmm7
  movsd  -0x98(%rbp),%xmm1
  movsd  -0x148(%rbp),%xmm10
  mulsd  %xmm15,%xmm5
  movsd  -0x170(%rbp),%xmm4
  movsd  -0x150(%rbp),%xmm9
  mulsd  %xmm12,%xmm3
  mulsd  %xmm11,%xmm1
  addsd  %xmm8,%xmm6
  movsd  -0xa0(%rbp),%xmm8
  movapd %xmm7,%xmm0
  movsd  -0xf8(%rbp),%xmm7
  mulsd  %xmm13,%xmm8
  addsd  %xmm6,%xmm0
  movsd  -0xd0(%rbp),%xmm6
  mulsd  %xmm12,%xmm6
  addsd  %xmm6,%xmm0
  movsd  -0x90(%rbp),%xmm6
  mulsd  %xmm11,%xmm6
  addsd  %xmm6,%xmm0
  movsd  -0x50(%rbp),%xmm6
  mulsd  %xmm7,%xmm6
  mulsd  -0x48(%rbp),%xmm7
  addsd  %xmm0,%xmm6
  movapd %xmm5,%xmm0
  movsd  -0x140(%rbp),%xmm5
  addsd  %xmm2,%xmm0
  movsd  -0x188(%rbp),%xmm2
  mulsd  %xmm10,%xmm6
  addsd  %xmm9,%xmm2
  addsd  %xmm8,%xmm0
  addsd  %xmm3,%xmm0
  movsd  -0x180(%rbp),%xmm3
  addsd  %xmm5,%xmm3
  addsd  %xmm1,%xmm0
  movsd  -0x178(%rbp),%xmm1
  addsd  %xmm10,%xmm1
  addsd  %xmm7,%xmm0
  mulsd  %xmm5,%xmm0
  addsd  %xmm0,%xmm6
  movsd  -0xb8(%rbp),%xmm0
  addsd  -0xf0(%rbp),%xmm0
  addsd  -0xe8(%rbp),%xmm0
  addsd  -0xc8(%rbp),%xmm0
  addsd  -0x80(%rbp),%xmm0
  addsd  -0xc0(%rbp),%xmm0
  mov    -0x160(%rbp),%r10
  mov    -0x168(%rbp),%r9
  mov    -0x190(%rbp),%rax
  mov    -0x198(%rbp),%rdx
  mulsd  %xmm9,%xmm0
  addsd  %xmm6,%xmm0
  subsd  %xmm0,%xmm4
  jne    L23
  add    $0x1,%rax
  cmp    $0x11,%rax
  jne    L348
  add    $0x1,%rdx
  cmp    $0x11,%rdx
  jne    L298
  mulsd  D166(%rip),%xmm4
  mov    -0x1f8(%rbp),%rax
  pxor   %xmm5,%xmm5
  mov    -0x228(%rbp),%rdx
  mulsd  D155(%rip),%xmm1
  mulsd  D155(%rip),%xmm3
  mulsd  D155(%rip),%xmm2
  movsd  %xmm4,(%rdx,%rax,1)
  mulsd  %xmm4,%xmm4
  mov    -0x230(%rbp),%rdx
  movsd  %xmm4,(%rdx,%rax,1)
  mov    -0x210(%rbp),%rdx
  movsd  %xmm1,(%rdx,%rax,1)
  mov    -0x218(%rbp),%rdx
  mulsd  %xmm1,%xmm1
  movsd  %xmm3,(%rdx,%rax,1)
  mulsd  %xmm3,%xmm3
  mov    -0x220(%rbp),%rdx
  movsd  %xmm2,(%rdx,%rax,1)
  mulsd  %xmm2,%xmm2
  addsd  %xmm3,%xmm1
  movapd %xmm1,%xmm0
  addsd  %xmm2,%xmm0
  ucomisd %xmm0,%xmm5
  ja     L223
  sqrtsd %xmm0,%xmm0
  mov    -0x200(%rbp),%rdx
L213:
  movsd  %xmm0,(%rdx,%rax,1)
  mulsd  %xmm0,%xmm0
  mov    -0x208(%rbp),%rdx
  movsd  %xmm0,(%rdx,%rax,1)
  add    $0x8,%rax
  mov    %rax,-0x1f8(%rbp)
  cmp    $0x7d0,%rax
  jne    L321
  pxor   %xmm1,%xmm1
  xor    %r12d,%r12d
  lea    D77(%rip),%r13
  movapd %xmm1,%xmm10
  movapd %xmm1,%xmm9
  movapd %xmm1,%xmm7
  movapd %xmm1,%xmm2
  movapd %xmm1,%xmm6
  movapd %xmm1,%xmm4
  lea    D195(%rip),%rbx
L108:
  movapd %xmm4,%xmm0
  mov    %r13,%rdi
  mov    $0x1,%eax
  movsd  %xmm1,-0x90(%rbp)
  movsd  %xmm10,-0x88(%rbp)
  movsd  %xmm9,-0x80(%rbp)
  movsd  %xmm7,-0x78(%rbp)
  movsd  %xmm2,-0x68(%rbp)
  movsd  %xmm6,-0x60(%rbp)
  movsd  %xmm4,-0x58(%rbp)
  call   <printf@plt>
  mov    -0x228(%rbp),%rax
  movsd  -0x58(%rbp),%xmm4
  mov    %rbx,%rdi
  addsd  (%rax,%r12,1),%xmm4
  mov    $0x1,%eax
  movapd %xmm4,%xmm0
  movsd  %xmm4,-0x58(%rbp)
  call   <printf@plt>
  movsd  -0x60(%rbp),%xmm6
  movsd  -0x68(%rbp),%xmm2
  mov    -0x230(%rbp),%rax
  movsd  -0x78(%rbp),%xmm7
  movsd  -0x80(%rbp),%xmm9
  movsd  -0x90(%rbp),%xmm1
  addsd  (%rax,%r12,1),%xmm6
  mov    -0x200(%rbp),%rax
  movsd  -0x88(%rbp),%xmm10
  movsd  -0x58(%rbp),%xmm4
  addsd  (%rax,%r12,1),%xmm2
  mov    -0x208(%rbp),%rax
  addsd  (%rax,%r12,1),%xmm7
  mov    -0x210(%rbp),%rax
  addsd  (%rax,%r12,1),%xmm9
  mov    -0x218(%rbp),%rax
  addsd  (%rax,%r12,1),%xmm10
  mov    -0x220(%rbp),%rax
  addsd  (%rax,%r12,1),%xmm1
  add    $0x8,%r12
  cmp    $0x7d0,%r12
  jne    L108
  movsd  D185(%rip),%xmm5
  movapd %xmm9,%xmm11
  movsd  -0x248(%rbp),%xmm15
  lea    D35(%rip),%rdi
  mulsd  %xmm9,%xmm11
  movslq -0x238(%rbp),%rax
  divsd  %xmm5,%xmm4
  movapd %xmm15,%xmm0
  mulsd  %xmm15,%xmm0
  lea    (%rax,%rax,2),%rdx
  mulsd  D189(%rip),%xmm0
  lea    (%rax,%rdx,4),%rax
  mov    -0x240(%rbp),%rdx
  lea    (%rdx,%rax,8),%rbx
  mov    $0x1,%eax
  divsd  %xmm5,%xmm6
  movapd %xmm4,%xmm8
  mulsd  %xmm4,%xmm8
  divsd  %xmm5,%xmm11
  movapd %xmm6,%xmm3
  unpcklpd %xmm8,%xmm6
  subsd  %xmm8,%xmm3
  movups %xmm6,0x10(%rbx)
  divsd  %xmm5,%xmm9
  divsd  %xmm5,%xmm10
  divsd  %xmm5,%xmm1
  divsd  %xmm5,%xmm2
  divsd  %xmm5,%xmm7
  divsd  %xmm0,%xmm3
  movapd %xmm11,%xmm0
  addsd  %xmm11,%xmm0
  addsd  %xmm11,%xmm0
  subsd  %xmm9,%xmm0
  subsd  %xmm10,%xmm0
  subsd  %xmm1,%xmm0
  movapd %xmm15,%xmm1
  mulsd  -0x1d8(%rbp),%xmm0
  unpcklpd %xmm4,%xmm1
  movups %xmm1,(%rbx)
  mulsd  D155(%rip),%xmm4
  movapd %xmm2,%xmm1
  unpcklpd %xmm7,%xmm1
  movups %xmm1,0x20(%rbx)
  movapd %xmm2,%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  D155(%rip),%xmm2
  unpcklpd %xmm4,%xmm1
  movups %xmm1,0x30(%rbx)
  unpcklpd %xmm3,%xmm2
  mulsd  D155(%rip),%xmm3
  movups %xmm2,0x40(%rbx)
  unpcklpd %xmm0,%xmm3
  movups %xmm3,0x50(%rbx)
  call   <printf@plt>
  movsd  D155(%rip),%xmm0
  mulsd  0x58(%rbx),%xmm0
  lea    D16(%rip),%rdi
  mov    $0x1,%eax
  movsd  %xmm0,0x60(%rbx)
  movsd  -0x70(%rbp),%xmm0
  divsd  -0xd8(%rbp),%xmm0
  call   <printf@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L49
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   (%rax)
L322:
  mov    -0xb8(%rbp),%rax
  mov    -0x58(%rbp),%rsi
  mov    -0xd0(%rbp),%rdi
  movapd -0xb0(%rbp),%xmm6
  mov    (%rax),%rdx
  movsd  D81(%rip),%xmm7
  addsd  -0x70(%rbp),%xmm7
  mov    (%rdx,%rsi,1),%rax
  mov    (%rax,%rdi,1),%rcx
  movsd  %xmm7,-0x70(%rbp)
  movups %xmm6,(%rcx)
  mov    -0x1a8(%rbp),%rcx
  mov    (%rcx),%rcx
  mov    (%rcx,%rsi,1),%rcx
  mov    (%rcx,%rdi,1),%rcx
  mov    %rcx,-0x78(%rbp)
  mov    -0x1b0(%rbp),%rcx
  mov    (%rcx),%rcx
  mov    (%rcx,%rsi,1),%rcx
  mov    (%rcx,%rdi,1),%rcx
  mov    %rcx,-0x80(%rbp)
  mov    -0x198(%rbp),%rcx
  mov    (%rdx,%rcx,1),%rcx
  mov    (%rcx,%rdi,1),%rcx
  mov    %rcx,-0xc0(%rbp)
  mov    -0x1a0(%rbp),%rcx
  mov    (%rdx,%rcx,1),%rdx
  mov    (%rdx,%rdi,1),%r15
  jmp    L237
L223:
  call   <sqrt@plt>
  mov    -0x200(%rbp),%rdx
  mov    -0x1f8(%rbp),%rax
  jmp    L213
L49:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D81
type_infered: f64
name: disassemble_data
arguments: label: D166
type_infered: f32[2]
name: disassemble_data
arguments: label: D155
type_infered: f32[2]
name: disassemble_data
arguments: label: D77
type_infered: string
name: disassemble_data
arguments: label: D195
type_infered: string
name: disassemble_data
arguments: label: D185
type_infered: f32[2]
name: disassemble_data
arguments: label: D35
type_infered: string
name: disassemble_data
arguments: label: D189
type_infered: f32[2]
name: disassemble_data
arguments: label: D16
type_infered: string

tool: D81: 1

tool: {"D166": [0.0,1.75]}

tool: {"D155": [0.0,0.6875]}

tool: D77: eSum 1: %f


tool: D195: eSum 2: %f


tool: {"D185": [0.0,3.73828125]}

tool: D35: Chi: %f


tool: {"D189": [0.0,5.5]}

tool: D16: 		Acceptance Ratio: %f


assistant: ```c
void measurement(double ****lattice, double data[][13], double temperature, double ***energy, double ***magnetization, int t) {
  int RUNS_ = (double)250;
  int N_ = (double)4096;
  int eq, sk, sw, sw1, sw2, sw3;
  int ii;
  int i, j, k, ip, im, jp, jm, kp, km;
  double theta, thetaPrime, phi, phiPrime;
  double spin1theta, spin1phi, spin2theta, spin2phi, spin3theta, spin3phi, spin4theta, spin4phi, spin5theta, spin5phi, spin6theta, spin6phi;
  double newSpin[2], currentSpin[2];
  double spinDiff[3], spinSum[3];
  double dotProduct;
  double deltaE;
  double prob;
  double randNum;
  double beta = 1.0 / temperature;
  double accept, test;
  double Mxsum = 0.0, Mysum = 0.0, Mzsum = 0.0;
  double spinX, spinY, spinZ;
  double X, Y, Z;
  double Mx[RUNS_], My[RUNS_], Mz[RUNS_];
  double m[RUNS_], m2[RUNS_], e[RUNS_], e2[RUNS_];
  double e_storage = 0;
  double eSum = 0, e2Sum = 0, mSum = 0, m2Sum = 0;
  double SxSum = 0, SySum = 0, SzSum = 0;
  double SxAvg, SyAvg, SzAvg;
  double SxAvgSqr, SyAvgSqr, SzAvgSqr;
  for (eq = 0; eq < 250; eq++) {
    for (sk = 1; sk <= 30; sk++) {
      for (sw = 0; sw < 250; sw++) {
        for (sw1 = 0; sw1 < 16; sw1++) {
          for (sw2 = 0; sw2 < 16; sw2++) {
            for (sw3 = 0; sw3 < 16; sw3++) {
              i = sw1;
              j = sw2;
              k = sw3;
              ip = (i + 16 - 1) % 16;
              im = (i + 1) % 16;
              jp = (j + 16 - 1) % 16;
              jm = (j + 1) % 16;
              kp = (k + 16 - 1) % 16;
              km = (k + 1) % 16;
              currentSpin[0] = lattice[i][j][k][0];
              currentSpin[1] = lattice[i][j][k][1];
              newSpin[0] = rng_theta();
              newSpin[1] = rng_phi();
              theta = currentSpin[0];
              phi = currentSpin[1];
              thetaPrime = theta;
              phiPrime = currentSpin[1];
              spinDiff[0] = sin(thetaPrime) * cos(phiPrime) - sin(theta) * cos(phi);
              spinDiff[1] = sin(thetaPrime) * sin(phiPrime) - sin(theta) * sin(phi);
              spinDiff[2] = cos(thetaPrime) - cos(theta);
              spin1theta = lattice[im][j][k][0];
              spin1phi = lattice[im][j][k][1];
              spin2theta = lattice[ip][j][k][0];
              spin2phi = lattice[ip][j][k][1];
              spin3theta = lattice[i][jm][k][0];
              spin3phi = lattice[i][jm][k][1];
              spin4theta = lattice[i][jp][k][0];
              spin4phi = lattice[i][jp][k][1];
              spin5theta = lattice[i][j][km][0];
              spin5phi = lattice[i][j][km][1];
              spin6theta = lattice[i][j][kp][0];
              spin6phi = lattice[i][j][kp][1];
              spinSum[0] = sin(spin1theta) * cos(spin1phi) + sin(spin2theta) * cos(spin2phi) + sin(spin3theta) * cos(spin3phi) + sin(spin4theta) * cos(spin4phi) + sin(spin5theta) * cos(spin5phi) + sin(spin6theta) * cos(spin6phi);
              spinSum[1] = sin(spin1theta) * sin(spin1phi) + sin(spin2theta) * sin(spin2phi) + sin(spin3theta) * sin(spin3phi) + sin(spin4theta) * sin(spin4phi) + sin(spin5theta) * sin(spin5phi) + sin(spin6theta) * sin(spin6phi);
              spinSum[2] = cos(spin1theta) + cos(spin2theta) + cos(spin3theta) + cos(spin4theta) + cos(spin5theta) + cos(spin6theta);
              dotProduct = spinDiff[0] * spinSum[0] + spinDiff[1] * spinSum[1] + spinDiff[2] * spinSum[2];
              deltaE = -1.0 * dotProduct;
              test++;
              if (deltaE <= 0) {
                lattice[i][j][k][0] = thetaPrime;
                lattice[i][j][k][1] = phiPrime;
                accept++;
              } else {
                prob = (sin(thetaPrime) / sin(theta)) * exp(-beta * deltaE);
                randNum = rng();
                if (randNum <= prob) {
                  lattice[i][j][k][0] = thetaPrime;
                  lattice[i][j][k][1] = phiPrime;
                  accept++;
                }
              }
              thetaPrime = theta;
              phiPrime = newSpin[1];
              spinDiff[0] = sin(thetaPrime) * cos(phiPrime) - sin(theta) * cos(phi);
              spinDiff[1] = sin(thetaPrime) * sin(phiPrime) - sin(theta) * sin(phi);
              spinDiff[2] = cos(thetaPrime) - cos(theta);
              spin1theta = lattice[im][j][k][0];
              spin1phi = lattice[im][j][k][1];
              spin2theta = lattice[ip][j][k][0];
              spin2phi = lattice[ip][j][k][1];
              spin3theta = lattice[i][jm][k][0];
              spin3phi = lattice[i][jm][k][1];
              spin4theta = lattice[i][jp][k][0];
              spin4phi = lattice[i][jp][k][1];
              spin5theta = lattice[i][j][km][0];
              spin5phi = lattice[i][j][km][1];
              spin6theta = lattice[i][j][kp][0];
              spin6phi = lattice[i][j][kp][1];
              spinSum[0] = sin(spin1theta) * cos(spin1phi) + sin(spin2theta) * cos(spin2phi) + sin(spin3theta) * cos(spin4phi) + sin(spin4theta) * cos(spin4phi) + sin(spin5theta) * cos(spin5phi) + sin(spin6theta) * cos(spin6phi);
              spinSum[1] = sin(spin1theta) * sin(spin1phi) + sin(spin2theta) * sin(spin2phi) + sin(spin3theta) * sin(spin4phi) + sin(spin4theta) * sin(spin4phi) + sin(spin5theta) * sin(spin5phi) + sin(spin6theta) * sin(spin6phi);
              spinSum[2] = cos(spin1theta) + cos(spin2theta) + cos(spin3theta) + cos(spin4theta) + cos(spin5theta) + cos(spin6theta);
              dotProduct = spinDiff[0] * spinSum[0] + spinDiff[1] * spinSum[1] + spinDiff[2] * spinSum[2];
              deltaE = -1.0 * dotProduct;
              test++;
              if (deltaE <= 0) {
                lattice[i][j][k][0] = thetaPrime;
                lattice[i][j][k][1] = phiPrime;
                accept++;
              } else {
                prob = (sin(thetaPrime) / sin(theta)) * exp(-beta * deltaE);
                randNum = rng();
                if (randNum <= prob) {
                  lattice[i][j][k][0] = thetaPrime;
                  lattice[i][j][k][1] = phiPrime;
                  accept++;
                }
              }
            }
          }
        }
      }
    }
    e_storage = 0;
    Mxsum = 0.0;
    Mysum = 0.0;
    Mzsum = 0.0;
    for (sw1 = 0; sw1 < 16; sw1++) {
      for (sw2 = 0; sw2 < 16; sw2++) {
        for (sw3 = 0; sw3 < 16; sw3++) {
          i = sw1;
          j = sw2;
          k = sw3;
          ip = (i + 16 - 1) % 16;
          im = (i + 1) % 16;
          jp = (j + 16 - 1) % 16;
          jm = (j + 1) % 16;
          kp = (k + 16 - 1) % 16;
          km = (k + 1) % 16;
          theta = lattice[i][j][k][0];
          phi = lattice[i][j][k][1];
          spinX = sin(theta) * cos(phi);
          spinY = sin(theta) * sin(phi);
          spinZ = cos(theta);
          spin1theta = lattice[im][j][k][0];
          spin1phi = lattice[im][j][k][1];
          spin2theta = lattice[ip][j][k][0];
          spin2phi = lattice[ip][j][k][1];
          spin3theta = lattice[i][jm][k][0];
          spin3phi = lattice[i][jm][k][1];
          spin4theta = lattice[i][jp][k][0];
          spin4phi = lattice[i][jp][k][1];
          spin5theta = lattice[i][j][km][0];
          spin5phi = lattice[i][j][km][1];
          spin6theta = lattice[i][j][kp][0];
          spin6phi = lattice[i][j][kp][1];
          spinSum[0] = sin(spin1theta) * cos(spin1phi) + sin(spin2theta) * cos(spin2phi) + sin(spin3theta) * cos(spin3phi) + sin(spin4theta) * cos(spin4phi) + sin(spin5theta) * cos(spin5phi) + sin(spin6theta) * cos(spin6phi);
          spinSum[1] = sin(spin1theta) * sin(spin1phi) + sin(spin2theta) * sin(spin2phi) + sin(spin3theta) * sin(spin3phi) + sin(spin4theta) * sin(spin4phi) + sin(spin5theta) * sin(spin5phi) + sin(spin6theta) * sin(spin6phi);
          spinSum[2] = cos(spin1theta) + cos(spin2theta) + cos(spin3theta) + cos(spin4theta) + cos(spin5theta) + cos(spin6theta);
          dotProduct = spinX * spinSum[0] + spinY * spinSum[1] + spinZ * spinSum[2];
          e_storage = e_storage + -1.0 * dotProduct;
          X = spinX;
          Y = spinY;
          Z = spinZ;
          Mxsum += X;
          Mysum += Y;
          Mzsum += Z;
        }
      }
    }
    e[eq] = e_storage / 2.0;
    e2[eq] = e[eq] * e[eq];
    Mx[eq] = Mxsum / N_;
    My[eq] = Mysum / N_;
    Mz[eq] = Mzsum / N_;
    m[eq] = sqrt(Mx[eq] * Mx[eq] + My[eq] * My[eq] + Mz[eq] * Mz[eq]);
    m2[eq] = m[eq] * m[eq];
    if (0) {
      printf("\t\tMeasurement runs (0-%d): %d\n", 250, eq);
    }
  }
  eSum = 0;
  e2Sum = 0;
  mSum = 0;
  m2Sum = 0;
  SxSum = 0;
  SySum = 0;
  SzSum = 0;
  for (ii = 0; ii < RUNS_; ii++) {
    printf("eSum 1: %f\n", eSum);
    eSum += e[ii];
    printf("eSum 2: %f\n", eSum);
    e2Sum += e2[ii];
    mSum += m[ii];
    m2Sum += m2[ii];
    SxSum += Mx[ii];
    SySum += My[ii];
    SzSum += Mz[ii];
  }
  SxAvg = SxSum / RUNS_;
  SyAvg = SySum / RUNS_;
  SzAvg = SzSum / RUNS_;
  SxAvgSqr = (SxSum * SxSum) / RUNS_;
  SyAvgSqr = (SxSum * SxSum) / RUNS_;
  SzAvgSqr = (SxSum * SxSum) / RUNS_;
  data[t][0] = temperature;
  data[t][1] = eSum / RUNS_;
  data[t][2] = e2Sum / RUNS_;
  data[t][3] = data[t][1] * data[t][1];
  data[t][4] = mSum / RUNS_;
  data[t][5] = m2Sum / RUNS_;
  data[t][6] = data[t][4] * data[t][4];
  data[t][7] = data[t][1] / N_;
  data[t][8] = data[t][4] / N_;
  data[t][9] = (data[t][2] - data[t][3]) / (temperature * temperature * N_);
  data[t][10] = data[t][9] / N_;
  data[t][11] = (1.0 / temperature) * (SxAvgSqr + SyAvgSqr + SzAvgSqr - SxAvg - SyAvg - SzAvg);
  printf("Chi: %f\n", data[t][11]);
  data[t][12] = data[t][11] / N_;
  printf("\t\tAcceptance Ratio: %f\n", accept / test);
}
```