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

```asm
<next_move>:
  endbr64
  push   %r15
  mov    %edi,%r15d
  push   %r14
  mov    %rdx,%r14
  push   %r13
  lea    -0x5(%rdi),%r13d
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x28,%rsp
  movss  D50(%rip),%xmm1
  mov    %rdx,0x18(%rsp)
  movss  %xmm1,0x4(%rsp)
L34:
  mov    %ebx,%r12d
  sub    %r15d,%r12d
  cmpb   $0x64,(%r14)
  je     L16
L72:
  cmpb   $0x64,0x1(%r14)
  je     L113
L204:
  cmpb   $0x64,0x2(%r14)
  je     L133
L82:
  cmpb   $0x64,0x3(%r14)
  je     L115
L67:
  cmpb   $0x64,0x4(%r14)
  je     L172
L122:
  sub    $0x1,%r15d
  add    $0x5,%r14
  cmp    %r15d,%r13d
  jne    L34
  movss  0x4(%rsp),%xmm7
  ucomiss D16(%rip),%xmm7
  jp     L58
  je     L73
L58:
  lea    D29(%rip),%rdi
  cmp    0x8(%rsp),%ebp
  jl     L215
  lea    D14(%rip),%rdi
  cmp    0xc(%rsp),%ebx
  jl     L215
  lea    D62(%rip),%rdi
  jg     L215
  cmp    0x8(%rsp),%ebp
  jg     L120
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L120:
  lea    D4(%rip),%rdi
L215:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <printf@plt>
  nop
L172:
  mov    $0x2,%esi
  mov    %r15d,%edi
  call   <pow@plt>
  lea    -0x4(%rbp),%edi
  mov    $0x2,%esi
  mov    %rax,0x10(%rsp)
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  add    0x10(%rsp),%rax
  cvtsi2ss %rax,%xmm0
  call   <sqrt@plt>
  movss  0x4(%rsp),%xmm6
  comiss %xmm0,%xmm6
  jbe    L122
  mov    %r12d,0xc(%rsp)
  movl   $0x4,0x8(%rsp)
  movss  %xmm0,0x4(%rsp)
  jmp    L122
  nopl   0x0(%rax)
L115:
  mov    $0x2,%esi
  mov    %r15d,%edi
  call   <pow@plt>
  lea    -0x3(%rbp),%edi
  mov    $0x2,%esi
  mov    %rax,0x10(%rsp)
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  add    0x10(%rsp),%rax
  cvtsi2ss %rax,%xmm0
  call   <sqrt@plt>
  movss  0x4(%rsp),%xmm5
  comiss %xmm0,%xmm5
  jbe    L67
  mov    %r12d,0xc(%rsp)
  movl   $0x3,0x8(%rsp)
  movss  %xmm0,0x4(%rsp)
  jmp    L67
  nopl   0x0(%rax)
L133:
  mov    $0x2,%esi
  mov    %r15d,%edi
  call   <pow@plt>
  lea    -0x2(%rbp),%edi
  mov    $0x2,%esi
  mov    %rax,0x10(%rsp)
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  add    0x10(%rsp),%rax
  cvtsi2ss %rax,%xmm0
  call   <sqrt@plt>
  movss  0x4(%rsp),%xmm4
  comiss %xmm0,%xmm4
  jbe    L82
  mov    %r12d,0xc(%rsp)
  movl   $0x2,0x8(%rsp)
  movss  %xmm0,0x4(%rsp)
  jmp    L82
  nopl   0x0(%rax)
L113:
  mov    $0x2,%esi
  mov    %r15d,%edi
  call   <pow@plt>
  lea    -0x1(%rbp),%edi
  mov    $0x2,%esi
  mov    %rax,0x10(%rsp)
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  add    0x10(%rsp),%rax
  cvtsi2ss %rax,%xmm0
  call   <sqrt@plt>
  movss  0x4(%rsp),%xmm3
  comiss %xmm0,%xmm3
  jbe    L204
  mov    %r12d,0xc(%rsp)
  movl   $0x1,0x8(%rsp)
  movss  %xmm0,0x4(%rsp)
  jmp    L204
  nopl   0x0(%rax)
L16:
  mov    $0x2,%esi
  mov    %r15d,%edi
  call   <pow@plt>
  mov    $0x2,%esi
  mov    %ebp,%edi
  mov    %rax,0x10(%rsp)
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  add    0x10(%rsp),%rax
  cvtsi2ss %rax,%xmm0
  call   <sqrt@plt>
  movss  0x4(%rsp),%xmm2
  comiss %xmm0,%xmm2
  jbe    L72
  mov    %r12d,0xc(%rsp)
  movl   $0x0,0x8(%rsp)
  movss  %xmm0,0x4(%rsp)
  jmp    L72
  nopl   0x0(%rax,%rax,1)
L73:
  lea    D46(%rip),%rdi
  call   <printf@plt>
  movslq 0xc(%rsp),%r15
  movslq 0x8(%rsp),%r14
  lea    (%r15,%r15,4),%rax
  add    0x18(%rsp),%rax
  movb   $0x2d,(%rax,%r14,1)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D50
type_guessed: f32
name: unpack_data
arguments: data_tag: D16
type_guessed: byte[4]
name: unpack_data
arguments: data_tag: D29
type_guessed: string
name: unpack_data
arguments: data_tag: D14
type_guessed: string
name: unpack_data
arguments: data_tag: D62
type_guessed: string
name: unpack_data
arguments: data_tag: D4
type_guessed: string
name: unpack_data
arguments: data_tag: D46
type_guessed: string

tool: D50: 100

tool: {"D16": [0x00,0x00,0x00,0x00]}

tool: D29: RIGHT


tool: D14: DOWN


tool: D62: UP


tool: D4: LEFT


tool: D46: CLEAN


assistant: ```c
void next_move(int posr, int posc, char board[5][5]) {
  int i, j, k, l, nexx, nexy;
  float dis, min = 100;
  for (i = 0; i < 5; i++) {
    for (j = 0; j < 5; j++) {
      if (board[i][j] == 'd') {
        dis = sqrt((float)(pow(posr - i, 2) + pow(posc - j, 2)));
        if (dis < min) {
          min = dis;
          nexx = i;
          nexy = j;
        }
      }
    }
  }
  if (min == 0) {
    printf("CLEAN\n");
    board[nexx][nexy] = '-';
  } else if (nexy > posc)
    printf("RIGHT\n");
  else if (nexx > posr)
    printf("DOWN\n");
  else if (nexx < posr)
    printf("UP\n");
  else if (nexy < posc)
    printf("LEFT\n");
}
```