user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r15
  lea    D71(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x7d8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x7c8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r14
  lea    0x60(%rsp),%r15
  lea    0xc0(%rsp),%r12
  call   <puts@plt>
  mov    $0x32,%esi
  xor    %eax,%eax
  lea    D102(%rip),%rdi
  call   <printf@plt>
  mov    $0x32,%ecx
  xor    %eax,%eax
  mov    $0xc,%edx
  mov    $0x2,%esi
  lea    D126(%rip),%rdi
  lea    0x120(%rsp),%r13
  call   <printf@plt>
  lea    D171(%rip),%rdi
  call   <puts@plt>
  lea    D160(%rip),%rdi
  call   <puts@plt>
  movsd  D144(%rip),%xmm1
  jmp    L67
  nopl   0x0(%rax,%rax,1)
L6:
  cmp    $0x6,%ebx
  je     L88
  cmp    $0x3,%ebx
  je     L81
  cmp    $0x9,%ebx
  je     L66
  lea    (%rbx,%rbx,1),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  D11(%rip),%xmm0
  divsd  D137(%rip),%xmm0
  cvttsd2si %xmm0,%ebp
  mov    %ebp,%edi
  call   <cos@plt>
  mov    %ebp,%edi
  movsd  %xmm0,(%r14,%rbx,8)
  call   <sin@plt>
  mov    D144(%rip),%rax
  movq   $0x0,(%r12,%rbx,8)
  movsd  %xmm0,(%r15,%rbx,8)
  mov    %rax,0x0(%r13,%rbx,8)
  movq   %rax,%xmm1
  cmp    $0xb,%rbx
  je     L128
  nop
L24:
  add    $0x1,%rbx
L67:
  test   %rbx,%rbx
  jne    L6
  movq   $0x0,0x60(%rsp)
  mov    D0(%rip),%rax
  mov    %rax,(%rsp)
L32:
  movq   $0x0,(%r12,%rbx,8)
  movsd  %xmm1,0x0(%r13,%rbx,8)
  jmp    L24
  nopw   0x0(%rax,%rax,1)
L88:
  mov    D161(%rip),%rax
  movq   $0x0,0x90(%rsp)
  mov    %rax,0x30(%rsp)
  jmp    L32
  nopw   0x0(%rax,%rax,1)
L66:
  movq   $0x0,0x48(%rsp)
  mov    D161(%rip),%rax
  mov    %rax,0xa8(%rsp)
  jmp    L32
  nopw   0x0(%rax,%rax,1)
L81:
  movq   $0x0,0x18(%rsp)
  mov    D0(%rip),%rax
  mov    %rax,0x78(%rsp)
  jmp    L32
  nop
L128:
  mov    %r13,%r8
  mov    %r12,%rcx
  mov    %r15,%rdx
  mov    %r14,%rsi
  mov    $0xc,%edi
  xor    %ebx,%ebx
  lea    D48(%rip),%rbp
  call   <sort_by_distance@plt>
  lea    D75(%rip),%rdi
  call   <puts@plt>
  nopl   0x0(%rax,%rax,1)
L55:
  movsd  (%r14,%rbx,1),%xmm0
  movsd  0x0(%r13,%rbx,1),%xmm3
  mov    %rbp,%rdi
  mov    $0x4,%eax
  movsd  (%r12,%rbx,1),%xmm2
  movsd  (%r15,%rbx,1),%xmm1
  add    $0x8,%rbx
  call   <printf@plt>
  cmp    $0x60,%rbx
  jne    L55
  lea    D17(%rip),%rdi
  lea    0x630(%rsp),%r15
  xor    %ebx,%ebx
  call   <puts@plt>
  lea    0x4a0(%rsp),%r14
  lea    D75(%rip),%rdi
  lea    0x310(%rsp),%r13
  lea    0x180(%rsp),%r12
  call   <puts@plt>
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    $0x32,%r8d
  mov    %r12,%rdi
  call   <spherical_quadrature_points@plt>
  mov    %r15,%r8
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    $0x32,%edi
  call   <sort_by_distance@plt>
  nopw   0x0(%rax,%rax,1)
L21:
  movsd  (%r12,%rbx,1),%xmm0
  movsd  (%r15,%rbx,1),%xmm3
  mov    %rbp,%rdi
  mov    $0x4,%eax
  movsd  (%r14,%rbx,1),%xmm2
  movsd  0x0(%r13,%rbx,1),%xmm1
  add    $0x8,%rbx
  call   <printf@plt>
  cmp    $0x190,%rbx
  jne    L21
  lea    D130(%rip),%rdi
  call   <puts@plt>
  lea    D105(%rip),%rdi
  call   <puts@plt>
  mov    0x7c8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x7d8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D71
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D102
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D126
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D171
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D160
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D144
type_guessed: byte[8]
name: extract_symbolic_data
arguments: data_label: D11
type_guessed: f64
name: extract_symbolic_data
arguments: data_label: D137
type_guessed: f32[2]
name: extract_symbolic_data
arguments: data_label: D0
type_guessed: f64
name: extract_symbolic_data
arguments: data_label: D161
type_guessed: f32[2]
name: extract_symbolic_data
arguments: data_label: D48
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D75
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D17
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D130
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D105
type_guessed: string

tool: D71: /* For 1d, 2d, and 3d, quadrature points and weights on a unit sphere.
   There are num_sphere_quad[dim-1] points i, with the i-th point at
   (x,y,z) = (sphere_quad[dim-1][i][ 0, 1, 2 ]), and with a quadrature
   weight sphere_quad[dim-1][i][3]. */


tool: D102: #define NQUAD %d


tool: D126: static const int num_sphere_quad[3] = { %d, %d, %d };



tool: D171: static const double sphere_quad[3][NQUAD][4] = {

tool: D160:     { {1,0,0,0.5}, {-1,0,0,0.5} },

tool: {"D144": [0x55,0x55,0x55,0x55,0x55,0x55,0xb5,0x3f]}

tool: D11: 3.141592653589793

tool: {"D137": [0.0,2.625]}

tool: D0: 1

tool: {"D161": [0.0,-1.875]}

tool: D48:         { %0.20g, %0.20g, %0.20g, %0.20g },


tool: D75:     {

tool: D17:     },

tool: D130:     }

tool: D105: };

assistant: ```c
int main(void) {
  int i;
  double x2[12], y2[12], z2[12], w2[12];
  double x3[50], y3[50], z3[50], w3[50];
  printf("/* For 1d, 2d, and 3d, quadrature points and weights on a unit sphere.\n"
         "   There are num_sphere_quad[dim-1] points i, with the i-th point at\n"
         "   (x,y,z) = (sphere_quad[dim-1][i][ 0, 1, 2 ]), and with a quadrature\n"
         "   weight sphere_quad[dim-1][i][3]. */\n\n");
  printf("#define NQUAD %d\n", ((50) > (((2) > (12) ? (2) : (12))) ? (50) : (((2) > (12) ? (2) : (12)))));
  printf("static const int num_sphere_quad[3] = { %d, %d, %d };\n\n", 2, 12, 50);
  printf("static const double sphere_quad[3][NQUAD][4] = {\n");
  printf("    { {1,0,0,0.5}, {-1,0,0,0.5} },\n");
  for (i = 0; i < 12; ++i) {
    if (i == 0) {
      x2[i] = 1;
      y2[i] = 0;
    } else if (2 * i == 12) {
      x2[i] = -1;
      y2[i] = 0;
    } else if (4 * i == 12) {
      y2[i] = 1;
      x2[i] = 0;
    } else if (4 * i == 3 * 12) {
      y2[i] = -1;
      x2[i] = 0;
    } else {
      x2[i] = cos(2 * i * 3.141592653589793238462643383279502884197 / 12);
      y2[i] = sin(2 * i * 3.141592653589793238462643383279502884197 / 12);
    }
    z2[i] = 0.0;
    w2[i] = 1.0 / 12;
  }
  sort_by_distance(12, x2, y2, z2, w2);
  printf("    {\n");
  for (i = 0; i < 12; ++i) {
    printf("        { %0.20g, %0.20g, %0.20g, %0.20g },\n", x2[i], y2[i], z2[i], w2[i]);
  }
  printf("    },\n");
  printf("    {\n");
  spherical_quadrature_points(x3, y3, z3, w3, 50);
  sort_by_distance(50, x3, y3, z3, w3);
  for (i = 0; i < 50; ++i) {
    printf("        { %0.20g, %0.20g, %0.20g, %0.20g },\n", x3[i], y3[i], z3[i], w3[i]);
  }
  printf("    }\n");
  printf("};\n");
  return 0;
}
```