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  D123(%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,-0x1e0(%rbp)
  cmp    %rax,%rsp
  je     L215
L288:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L288
L215:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,%rax
  mov    %rsp,-0x210(%rbp)
  cmp    %rax,%rsp
  je     L237
L198:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L198
L237:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,%rax
  mov    %rsp,-0x218(%rbp)
  cmp    %rax,%rsp
  je     L112
L207:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L207
L112:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,%rax
  mov    %rsp,-0x220(%rbp)
  cmp    %rax,%rsp
  je     L304
L223:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L223
L304:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,%rax
  mov    %rsp,-0x200(%rbp)
  cmp    %rax,%rsp
  je     L91
L81:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L81
L91:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,%rax
  mov    %rsp,-0x208(%rbp)
  cmp    %rax,%rsp
  je     L324
L272:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L272
L324:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,%rax
  mov    %rsp,-0x228(%rbp)
  cmp    %rax,%rsp
  je     L210
L136:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L136
L210:
  sub    $0x7d0,%rsp
  orq    $0x0,0x7c8(%rsp)
  mov    %rsp,-0x230(%rbp)
  lea    -0x48(%rbp),%r14
  lea    -0x50(%rbp),%r13
  movq   $0x0,-0x1f8(%rbp)
L102:
  movl   $0x1e,-0x234(%rbp)
L225:
  movl   $0xfa,-0x1e8(%rbp)
  nopl   0x0(%rax,%rax,1)
L154:
  mov    -0x1f0(%rbp),%rax
  movl   $0x0,-0x1e4(%rbp)
  mov    %rax,-0xb8(%rbp)
L114:
  mov    -0x1e4(%rbp),%edx
  mov    -0x1f0(%rbp),%rcx
  mov    %r13,%r12
  mov    %r14,%r13
  movq   $0x0,-0x1d8(%rbp)
  lea    0x3(%rdx),%eax
  add    $0x1,%edx
  mov    %edx,-0x1e4(%rbp)
  and    $0x3,%eax
  and    $0x3,%edx
  lea    (%rcx,%rdx,8),%rdx
  lea    (%rcx,%rax,8),%rax
  mov    %rdx,-0x1a8(%rbp)
  mov    %rax,-0x1b0(%rbp)
L187:
  mov    -0x1d8(%rbp),%rdx
  xor    %r14d,%r14d
  lea    0x0(,%rdx,8),%rax
  mov    %rax,-0x58(%rbp)
  mov    %edx,%eax
  add    $0x1,%eax
  and    $0x3,%eax
  shl    $0x3,%rax
  mov    %rax,-0x198(%rbp)
  mov    %edx,%eax
  add    $0x3,%eax
  and    $0x3,%eax
  shl    $0x3,%rax
  mov    %rax,-0x1a0(%rbp)
L77:
  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    $0x3,%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    0x3(%r14),%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    %edx,%eax
  movsd  -0x50(%rbp),%xmm8
  movsd  -0x48(%rbp),%xmm14
  and    $0x3,%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  D123(%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
  jb     L278
  mov    -0x190(%rbp),%rax
  movapd -0xb0(%rbp),%xmm5
  mov    (%rax,%r14,8),%rdx
  movups %xmm5,(%rdx)
  movsd  D123(%rip),%xmm5
  addsd  -0x70(%rbp),%xmm5
  movsd  %xmm5,-0x70(%rbp)
L71:
  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  D123(%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     L118
  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  D123(%rip),%xmm7
  addsd  -0x70(%rbp),%xmm7
  movsd  %xmm2,(%rax)
  movsd  %xmm7,-0x70(%rbp)
L170:
  add    $0x1,%r14
  cmp    $0x4,%r14
  jne    L77
  addq   $0x1,-0x1d8(%rbp)
  mov    -0x1d8(%rbp),%rax
  cmp    $0x4,%rax
  jne    L187
  addq   $0x8,-0xb8(%rbp)
  cmpl   $0x4,-0x1e4(%rbp)
  mov    %r13,%r14
  mov    %r12,%r13
  jne    L114
  subl   $0x1,-0x1e8(%rbp)
  jne    L154
  subl   $0x1,-0x234(%rbp)
  jne    L225
  pxor   %xmm4,%xmm4
  mov    $0x1,%edx
  movapd %xmm4,%xmm2
  movapd %xmm4,%xmm3
  movapd %xmm4,%xmm1
L26:
  mov    -0x1f0(%rbp),%rdi
  mov    %rdx,%rax
  and    $0x3,%eax
  mov    (%rdi,%rax,8),%r10
  lea    0x2(%rdx),%eax
  mov    -0x8(%rdi,%rdx,8),%rcx
  and    $0x3,%eax
  mov    (%rdi,%rax,8),%r9
  mov    $0x1,%eax
L162:
  mov    -0x8(%r9,%rax,8),%rdi
  mov    %rax,%rsi
  mov    -0x8(%rcx,%rax,8),%r12
  mov    $0x1,%ebx
  and    $0x3,%esi
  mov    -0x8(%r10,%rax,8),%r15
  mov    %rdi,-0x58(%rbp)
  mov    (%rcx,%rsi,8),%rdi
  lea    0x2(%rax),%esi
  and    $0x3,%esi
  mov    %rdi,-0x60(%rbp)
  mov    (%rcx,%rsi,8),%rdi
  mov    %rdi,-0x68(%rbp)
L124:
  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    $0x3,%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    0x2(%rbx),%esi
  movsd  -0x50(%rbp),%xmm4
  mov    %r14,%rdi
  and    $0x3,%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    $0x5,%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    L124
  add    $0x1,%rax
  cmp    $0x5,%rax
  jne    L162
  add    $0x1,%rdx
  cmp    $0x5,%rdx
  jne    L26
  mulsd  D81(%rip),%xmm4
  mov    -0x1f8(%rbp),%rax
  pxor   %xmm5,%xmm5
  mov    -0x228(%rbp),%rdx
  mulsd  D106(%rip),%xmm1
  mulsd  D106(%rip),%xmm3
  mulsd  D106(%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     L235
  sqrtsd %xmm0,%xmm0
  mov    -0x200(%rbp),%rdx
L263:
  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    L102
  pxor   %xmm1,%xmm1
  xor    %r12d,%r12d
  lea    D193(%rip),%r13
  movapd %xmm1,%xmm10
  movapd %xmm1,%xmm9
  movapd %xmm1,%xmm7
  movapd %xmm1,%xmm2
  movapd %xmm1,%xmm6
  movapd %xmm1,%xmm4
  lea    D127(%rip),%rbx
L338:
  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    L338
  movsd  D113(%rip),%xmm5
  movapd %xmm9,%xmm11
  movsd  -0x248(%rbp),%xmm15
  lea    D95(%rip),%rdi
  mulsd  %xmm9,%xmm11
  movslq -0x238(%rbp),%rax
  divsd  %xmm5,%xmm4
  movapd %xmm15,%xmm0
  mulsd  %xmm15,%xmm0
  lea    (%rax,%rax,2),%rdx
  mulsd  D188(%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  -0x1e0(%rbp),%xmm0
  unpcklpd %xmm4,%xmm1
  movups %xmm1,(%rbx)
  mulsd  D106(%rip),%xmm4
  movapd %xmm2,%xmm1
  unpcklpd %xmm7,%xmm1
  movups %xmm1,0x20(%rbx)
  movapd %xmm2,%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  D106(%rip),%xmm2
  unpcklpd %xmm4,%xmm1
  movups %xmm1,0x30(%rbx)
  unpcklpd %xmm3,%xmm2
  mulsd  D106(%rip),%xmm3
  movups %xmm2,0x40(%rbx)
  unpcklpd %xmm0,%xmm3
  movups %xmm3,0x50(%rbx)
  call   <printf@plt>
  movsd  D106(%rip),%xmm0
  mulsd  0x58(%rbx),%xmm0
  lea    D73(%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    L186
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L118:
  mulsd  -0x1e0(%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     L170
  mov    -0xb8(%rbp),%rax
  mov    -0x58(%rbp),%rdx
  movsd  D123(%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)
  jmp    L170
L278:
  mulsd  -0x1e0(%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    L231
  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
  mov    -0x1b8(%rbp),%rdx
  mov    (%rax,%rdx,8),%rcx
  mov    -0x1c0(%rbp),%rdx
  mov    %rcx,-0xc8(%rbp)
  mov    (%rax,%rdx,8),%rbx
  jmp    L71
  nopl   0x0(%rax)
L231:
  mov    -0xb8(%rbp),%rax
  mov    -0x58(%rbp),%rsi
  mov    -0xd0(%rbp),%rdi
  movapd -0xb0(%rbp),%xmm6
  mov    (%rax),%rdx
  movsd  D123(%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
  mov    -0x1b8(%rbp),%rdx
  mov    (%rax,%rdx,8),%rdx
  mov    %rdx,-0xc8(%rbp)
  mov    -0x1c0(%rbp),%rdx
  mov    (%rax,%rdx,8),%rbx
  jmp    L71
L235:
  call   <sqrt@plt>
  mov    -0x200(%rbp),%rdx
  mov    -0x1f8(%rbp),%rax
  jmp    L263
L186:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D123
type_infered: f64
name: parse_data
arguments: data_label: D81
type_infered: f32[2]
name: parse_data
arguments: data_label: D106
type_infered: f32[2]
name: parse_data
arguments: data_label: D193
type_infered: string
name: parse_data
arguments: data_label: D127
type_infered: string
name: parse_data
arguments: data_label: D113
type_infered: f32[2]
name: parse_data
arguments: data_label: D95
type_infered: string
name: parse_data
arguments: data_label: D188
type_infered: f32[2]
name: parse_data
arguments: data_label: D73
type_infered: string

tool: D123: 1

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

tool: {"D106": [0.0,1.125]}

tool: D193: eSum 1: %f


tool: D127: eSum 2: %f


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

tool: D95: Chi: %f


tool: {"D188": [0.0,3.25]}

tool: D73: 		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)64;
  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 < 4; sw1++) {
          for (sw2 = 0; sw2 < 4; sw2++) {
            for (sw3 = 0; sw3 < 4; sw3++) {
              i = sw1;
              j = sw2;
              k = sw3;
              ip = (i + 4 - 1) % 4;
              im = (i + 1) % 4;
              jp = (j + 4 - 1) % 4;
              jm = (j + 1) % 4;
              kp = (k + 4 - 1) % 4;
              km = (k + 1) % 4;
              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 < 4; sw1++) {
      for (sw2 = 0; sw2 < 4; sw2++) {
        for (sw3 = 0; sw3 < 4; sw3++) {
          i = sw1;
          j = sw2;
          k = sw3;
          ip = (i + 4 - 1) % 4;
          im = (i + 1) % 4;
          jp = (j + 4 - 1) % 4;
          jm = (j + 1) % 4;
          kp = (k + 4 - 1) % 4;
          km = (k + 1) % 4;
          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);
}
```