user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<turn>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  movss  %xmm0,-0x34(%rbp)
  mov    %edi,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0xf,-0x1c(%rbp)
  movl   $0x19,-0x18(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  movss  -0x34(%rbp),%xmm1
  movss  D4(%rip),%xmm0
  mulss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  D38(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x14(%rbp)
  mov    $0x0,%eax
  call   <reset_motor_encoders@plt>
  jmp    L6
L42:
  lea    -0x24(%rbp),%rdx
  lea    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <get_motor_encoders@plt>
  mov    -0x28(%rbp),%eax
  mov    %eax,%edi
  call   <fabs@plt>
  movq   %xmm0,%rax
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x14(%rbp),%xmm1
  movq   %rax,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  D28(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  jb     L72
  movsd  -0x10(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x18(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L68
L72:
  movsd  D30(%rip),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x10(%rbp),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x18(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x20(%rbp)
L68:
  cmpl   $0x1,-0x38(%rbp)
  jne    L55
  mov    -0x20(%rbp),%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <set_motors@plt>
  jmp    L66
L55:
  mov    -0x20(%rbp),%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  mov    %eax,%esi
  mov    %edx,%edi
  call   <set_motors@plt>
L66:
  mov    $0x0,%eax
  call   <log_trail@plt>
L6:
  mov    -0x28(%rbp),%eax
  mov    %eax,%edi
  call   <fabs@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x14(%rbp),%xmm1
  comisd %xmm0,%xmm1
  jbe    L36
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <fabs@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x14(%rbp),%xmm1
  comisd %xmm0,%xmm1
  ja     L42
L36:
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <set_motors@plt>
  mov    $0x9c40,%edi
  call   <usleep@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L40
  call   <__stack_chk_fail@plt>
L40:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D4
data_type: byte[4]
name: unpack_data
arguments: data_tag: D38
data_type: f32[2]
name: unpack_data
arguments: data_tag: D28
data_type: f64
name: unpack_data
arguments: data_tag: D30
data_type: f32[2]

tool: {"D4": [0x00,0x00,0x52,0x43]}

tool: {"D38": [0.0,3.3515625]}

tool: D28: 0.5

tool: {"D30": [0.0,1.875]}

assistant: ```c
void turn(float targetAngle, int direction) {
  int slowSpd = 15;
  int fastSpd = 40 - 15;
  int currentSpd;
  double percentTurned = 0;
  int leftenc = 0;
  int rightenc = 0;
  int target = (double)(210 * targetAngle) / 90;
  reset_motor_encoders();
  while (fabs(leftenc) < target && fabs(rightenc) < target) {
    get_motor_encoders(&leftenc, &rightenc);
    percentTurned = fabs(leftenc) / (double)target;
    if (percentTurned <= 0.5) {
      currentSpd = slowSpd + (int)(2 * percentTurned * (double)fastSpd);
    } else {
      currentSpd = slowSpd + (int)((1 - percentTurned) * (double)fastSpd);
    }
    if (direction == 1) {
      set_motors(currentSpd, -currentSpd);
    } else {
      set_motors(-currentSpd, currentSpd);
    }
    log_trail();
  }
  set_motors(0, 0);
  usleep(40000);
}
```