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

```asm
<set_uvwp_surface>:
  endbr64
  push   %r15
  mov    %r8,%r15
  mov    %rcx,%r8
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %rdi,0x10(%rsp)
  mov    0xe8(%rsp),%r14d
  mov    %rsi,0x18(%rsp)
  mov    %rdx,0x20(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %rdx,%rcx
  mov    %rsi,%rdx
  mov    %rdi,%rsi
  mov    %r9d,(%rsp)
  mov    %r15,%rdi
  movsd  %xmm3,0x28(%rsp)
  movsd  %xmm4,0x30(%rsp)
  movsd  %xmm5,0x38(%rsp)
  movsd  %xmm6,0x40(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  push   %r14
  mov    0xe8(%rsp),%eax
  push   %rax
  call   <clean_empty_space@plt>
  pop    %rsi
  pop    %rdi
  cmpl   $0xffffffff,0xe0(%rsp)
  jl     L29
  lea    0x1(%r14),%eax
  mov    %r15,0x60(%rsp)
  xor    %ebp,%ebp
  mov    %eax,0x68(%rsp)
  movq   $0x0,0x58(%rsp)
  nopl   0x0(%rax)
L8:
  cmpl   $0xffffffff,(%rsp)
  jl     L206
  mov    0x58(%rsp),%rax
  movl   $0x0,0x4(%rsp)
  mov    0x60(%rsp),%r15
  mov    0x8(%rsp),%r12
  lea    0x0(,%rax,8),%rbx
  lea    0x8(%rbx),%rax
  mov    %rax,0x48(%rsp)
  lea    -0x8(%rbx),%rax
  mov    %rax,0x50(%rsp)
  nopl   0x0(%rax,%rax,1)
L175:
  mov    0x68(%rsp),%eax
  xor    %r13d,%r13d
  test   %eax,%eax
  jns    L24
  jmp    L198
L130:
  add    $0x1,%r13
  lea    -0x1(%r13),%eax
  cmp    %eax,%r14d
  jl     L198
L24:
  mov    (%r15),%rax
  mov    (%rax,%rbx,1),%rax
  mov    (%rax,%r13,4),%edi
  call   <issurface@plt>
  test   %rax,%rax
  je     L130
  mov    (%r15),%rax
  lea    0x84(%rsp),%rcx
  lea    0x7c(%rsp),%rsi
  lea    0x80(%rsp),%rdx
  mov    (%rax,%rbx,1),%rax
  mov    (%rax,%r13,4),%edi
  lea    0x94(%rsp),%rax
  push   %rax
  lea    0x98(%rsp),%rax
  push   %rax
  lea    0x9c(%rsp),%r9
  lea    0x98(%rsp),%r8
  call   <getsurfacetype@plt>
  pop    %rdx
  pop    %rcx
  mov    %eax,%ebp
  lea    0x0(,%r13,8),%rax
  cmp    $0x20,%ebp
  ja     L176
  lea    D8(%rip),%rsi
  mov    %ebp,%edx
  movslq (%rsi,%rdx,4),%rdx
  add    %rsi,%rdx
  notrack jmp *%rdx
  nopl   0x0(%rax)
L176:
  mov    (%r12),%rdx
  add    $0x1,%r13
  mov    (%rdx,%rbx,1),%rdx
  movq   $0x0,(%rdx,%rax,1)
  lea    -0x1(%r13),%eax
  cmp    %eax,%r14d
  jge    L24
  nopl   0x0(%rax)
L198:
  mov    0x4(%rsp),%ecx
  add    $0x8,%r15
  add    $0x8,%r12
  lea    0x1(%rcx),%eax
  cmp    %ecx,(%rsp)
  jl     L206
  mov    %eax,0x4(%rsp)
  jmp    L175
  nopl   0x0(%rax)
  mov    (%r12),%rdx
  mov    0x48(%rsp),%rcx
  mov    (%rdx,%rcx,1),%rcx
  mov    (%rdx,%rbx,1),%rdx
  movsd  (%rcx,%rax,1),%xmm0
  movsd  %xmm0,(%rdx,%rax,1)
  jmp    L130
  mov    -0x8(%r12),%rdx
  mov    (%rdx,%rbx,1),%rdx
  movsd  (%rdx,%rax,1),%xmm0
  mov    (%r12),%rdx
  mov    (%rdx,%rbx,1),%rdx
  movsd  %xmm0,(%rdx,%rax,1)
  jmp    L130
  mov    (%r12),%rdx
  mov    0x50(%rsp),%rcx
  mov    (%rdx,%rcx,1),%rcx
  mov    (%rdx,%rbx,1),%rdx
  movsd  (%rcx,%rax,1),%xmm0
  movsd  %xmm0,(%rdx,%rax,1)
  jmp    L130
  mov    (%r12),%rdx
  mov    (%rdx,%rbx,1),%rdx
  movsd  0x8(%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rdx,%rax,1)
  jmp    L130
  mov    (%r12),%rdx
  mov    (%rdx,%rbx,1),%rdx
  movsd  -0x8(%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rdx,%rax,1)
  jmp    L130
  nopl   0x0(%rax,%rax,1)
L206:
  addq   $0x1,0x58(%rsp)
  mov    0x58(%rsp),%rax
  sub    $0x1,%eax
  cmp    %eax,0xe0(%rsp)
  jge    L8
  mov    %ebp,0x6c(%rsp)
  mov    0x60(%rsp),%r15
L45:
  cmpl   $0x2,0xe0(%rsp)
  jle    L148
  movslq (%rsp),%rax
  cmp    $0x2,%eax
  jle    L148
  cmp    $0x2,%r14d
  jle    L148
  mov    0xe0(%rsp),%ecx
  mov    %r14d,0xe8(%rsp)
  movq   $0x0,0x50(%rsp)
  sub    $0x2,%ecx
  mov    %rax,0x48(%rsp)
  lea    -0x2(%r14),%eax
  mov    %rcx,0x58(%rsp)
  mov    %rax,%r13
  nopl   (%rax)
L14:
  mov    0x50(%rsp),%rax
  mov    $0x2,%ebx
  mov    %eax,%ecx
  lea    0x10(,%rax,8),%r12
  add    $0x2,%ecx
  mov    %ecx,0x68(%rsp)
  nopl   0x0(%rax,%rax,1)
L128:
  xor    %r14d,%r14d
  mov    %r15,%rax
  mov    %ebx,0x4(%rsp)
  mov    %r14,%r15
  mov    %rax,%r14
  jmp    L258
  nopw   0x0(%rax,%rax,1)
L52:
  add    $0x1,%r15
  cmp    %r15,%r13
  je     L78
L258:
  mov    (%r14,%rbx,8),%rax
  lea    0x2(%r15),%ebp
  mov    (%rax,%r12,1),%rax
  mov    0x8(%rax,%r15,4),%edi
  call   <issurface@plt>
  test   %rax,%rax
  je     L52
  sub    $0x8,%rsp
  mov    %r14,%r8
  add    $0x1,%r15
  mov    0xf0(%rsp),%eax
  push   %rax
  mov    0xf0(%rsp),%eax
  push   %rax
  mov    0x18(%rsp),%eax
  push   %rax
  push   %rbp
  mov    0x90(%rsp),%eax
  push   %rax
  movsd  0x68(%rsp),%xmm3
  movsd  0x60(%rsp),%xmm2
  movsd  0x58(%rsp),%xmm1
  movsd  0x70(%rsp),%xmm0
  mov    0x34(%rsp),%r9d
  mov    0x38(%rsp),%rcx
  mov    0x50(%rsp),%rdx
  mov    0x48(%rsp),%rsi
  mov    0x40(%rsp),%rdi
  call   <compute_surface_values@plt>
  add    $0x30,%rsp
  cmp    %r15,%r13
  jne    L258
L78:
  mov    %r14,%r15
  add    $0x1,%rbx
  cmp    %rbx,0x48(%rsp)
  jne    L128
  addq   $0x1,0x50(%rsp)
  mov    0x50(%rsp),%rax
  cmp    %rax,0x58(%rsp)
  jne    L14
L148:
  mov    0x6c(%rsp),%esi
  lea    D13(%rip),%rdi
  call   <printf@plt>
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L29:
  movl   $0x0,0x6c(%rsp)
  jmp    L45
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D13
type_infered: string

tool: D13: %d

assistant: ```c
void set_uvwp_surface(double ***U, double ***V, double ***W, double ***P, int ***Flag, double dx, double dy, double dz, int imax, int jmax, int kmax, double GX, double GY, double GZ, double dt, double Re) {
  clean_empty_space(Flag, U, V, W, P, imax, jmax, kmax);
  int i, j, k;
  int type = 0;
  int nx, ny, nz;
  int mx, my, mz;
  int num;
  for (j = 0; j <= jmax + 1; j++) {
    for (i = 0; i <= imax + 1; i++) {
      for (k = 0; k <= kmax + 1; k++) {
        if (issurface(Flag[i][j][k])) {
          type = getsurfacetype(Flag[i][j][k], &nx, &ny, &nz, &mx, &my, &mz, &num);
          switch (type) {
          case 32:
            P[i][j][k] = P[i - 1][j][k];
            break;
          case 16:
            P[i][j][k] = P[i][j + 1][k];
            break;
          case 8:
            P[i][j][k] = P[i][j - 1][k];
            break;
          case 4:
            P[i][j][k] = P[i][j + 1][k];
            break;
          case 1:
            P[i][j][k] = P[i][j][k - 1];
            break;
          case 2:
            P[i][j][k] = P[i][j][k + 1];
            break;
          default:
            P[i][j][k] = 0;
            break;
            P[i][j][k] = 0;
            break;
            P[i][j][k] = 0;
            break;
            P[i][j][k] = 0;
            break;
            P[i][j][k] = 0;
            break;
            P[i][j][k] = 0;
            break;
            P[i][j][k] = 0;
            break;
            break;
          }
        }
      }
    }
  }
  for (j = 2; j < jmax; j++) {
    for (i = 2; i < imax; i++) {
      for (k = 2; k < kmax; k++) {
        if (issurface(Flag[i][j][k])) {
          compute_surface_values(U, V, W, P, Flag, i, j, k, dt, GX, GY, GZ, imax, jmax, kmax);
        }
      }
    }
  }
  printf("%d", type);
}
```