user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<turn>:
  endbr64
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mulss  D42(%rip),%xmm0
  movl   $0x0,0x10(%rsp)
  movl   $0x0,0x14(%rsp)
  cvtss2sd %xmm0,%xmm0
  divsd  D31(%rip),%xmm0
  cvttsd2si %xmm0,%ebp
  call   <reset_motor_encoders@plt>
  cmp    $0x1,%ebx
  je     L30
  pxor   %xmm6,%xmm6
  cvtsi2sd %ebp,%xmm6
  movsd  %xmm6,0x8(%rsp)
  jmp    L67
  nopw   0x0(%rax,%rax,1)
L36:
  movsd  D62(%rip),%xmm1
  subsd  %xmm0,%xmm1
  mulsd  D88(%rip),%xmm1
  cvttsd2si %xmm1,%esi
  add    $0xf,%esi
L74:
  mov    %esi,%edi
  neg    %edi
  call   <set_motors@plt>
  xor    %eax,%eax
  call   <log_trail@plt>
L67:
  mov    0x10(%rsp),%edi
  call   <fabs@plt>
  movsd  0x8(%rsp),%xmm2
  comisd %xmm0,%xmm2
  jbe    L9
  mov    0x14(%rsp),%edi
  call   <fabs@plt>
  movsd  0x8(%rsp),%xmm2
  comisd %xmm0,%xmm2
  jbe    L9
  lea    0x14(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  call   <get_motor_encoders@plt>
  mov    0x10(%rsp),%edi
  call   <fabs@plt>
  movsd  D67(%rip),%xmm3
  divsd  0x8(%rsp),%xmm0
  comisd %xmm0,%xmm3
  jb     L36
  addsd  %xmm0,%xmm0
  mulsd  D88(%rip),%xmm0
  cvttsd2si %xmm0,%esi
  add    $0xf,%esi
  jmp    L74
  nopw   0x0(%rax,%rax,1)
L9:
  xor    %edi,%edi
  xor    %esi,%esi
  call   <set_motors@plt>
  mov    $0x9c40,%edi
  call   <usleep@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L56
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L30:
  pxor   %xmm7,%xmm7
  cvtsi2sd %ebp,%xmm7
  movsd  %xmm7,0x8(%rsp)
  jmp    L24
L118:
  addsd  %xmm0,%xmm0
  mulsd  D88(%rip),%xmm0
  cvttsd2si %xmm0,%edi
  add    $0xf,%edi
L13:
  mov    %edi,%esi
  neg    %esi
  call   <set_motors@plt>
  xor    %eax,%eax
  call   <log_trail@plt>
L24:
  mov    0x10(%rsp),%edi
  call   <fabs@plt>
  movsd  0x8(%rsp),%xmm4
  comisd %xmm0,%xmm4
  jbe    L9
  mov    0x14(%rsp),%edi
  call   <fabs@plt>
  movsd  0x8(%rsp),%xmm5
  comisd %xmm0,%xmm5
  jbe    L9
  lea    0x14(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  call   <get_motor_encoders@plt>
  mov    0x10(%rsp),%edi
  call   <fabs@plt>
  movsd  D67(%rip),%xmm7
  divsd  0x8(%rsp),%xmm0
  comisd %xmm0,%xmm7
  jae    L118
  movsd  D62(%rip),%xmm1
  subsd  %xmm0,%xmm1
  mulsd  D88(%rip),%xmm1
  cvttsd2si %xmm1,%edi
  add    $0xf,%edi
  jmp    L13
L56:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D42
datatype: byte[4]
name: unpack_data
arguments: data_tag: D31
datatype: f32[2]
name: unpack_data
arguments: data_tag: D62
datatype: f32[2]
name: unpack_data
arguments: data_tag: D88
datatype: f32[2]
name: unpack_data
arguments: data_tag: D67
datatype: f64

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

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

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

tool: {"D88": [0.0,2.890625]}

tool: D67: 0.5

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);
}
```