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

```asm
<wheelSwitchFormat>:
  endbr64
  push   %r14
  mov    $0x20,%ecx
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x120,%rsp
  movss  D27(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  movl   $0x6,(%rsi)
  movl   $0x2,(%rdx)
  mov    %cx,0xe(%rsp)
  call   <strchr@plt>
  test   %rax,%rax
  je     L127
  movss  D13(%rip),%xmm0
  mov    %rax,%rdi
  mov    %rax,%rbx
  call   <strchr@plt>
  test   %rax,%rax
  je     L127
  mov    %rbx,%rdx
  lea    0x10(%rsp),%r14
  mov    %r13,%rsi
  movb   $0x0,0x10(%rsp)
  sub    %r13,%rdx
  mov    %r14,%rdi
  add    $0x1,%edx
  call   <strncat@plt>
  lea    0x2(%rbx),%rax
  movabs $0x1200900000000,%rcx
  nopl   0x0(%rax,%rax,1)
L71:
  movzbl -0x1(%rax),%edx
  lea    -0x1(%rax),%r13
  cmp    $0x2b,%dl
  je     L134
  cmp    $0x30,%dl
  ja     L88
  bt     %rdx,%rcx
  jb     L148
L88:
  lea    0xe(%rsp),%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  mov    %r12,%rcx
  mov    %rbp,%rdx
  mov    %r13,%rdi
  lea    D38(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x2,%eax
  je     L76
  cmp    $0x1,%eax
  je     L131
L94:
  movl   $0x6,0x0(%rbp)
  movl   $0x2,(%r12)
  jmp    L140
  nopl   0x0(%rax)
L134:
  movb   $0x2b,0xe(%rsp)
L148:
  add    $0x1,%rax
  jmp    L71
  nopl   0x0(%rax,%rax,1)
L127:
  lea    0x10(%rsp),%rdi
  lea    D22(%rip),%rsi
  call   <strcpy@plt>
L140:
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L85
  add    $0x120,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L76:
  mov    0x0(%rbp),%edx
  test   %edx,%edx
  jns    L22
  movl   $0x6,0x0(%rbp)
L22:
  mov    (%r12),%edx
  test   %edx,%edx
  jns    L30
  movl   $0x2,(%r12)
  mov    $0x2,%edx
L30:
  mov    0x0(%rbp),%eax
  cmp    %eax,%edx
  jl     L140
  sub    $0x1,%eax
  mov    %eax,(%r12)
  jns    L140
L146:
  movl   $0x0,(%r12)
  jmp    L140
  nopl   (%rax)
L131:
  mov    0x0(%rbp),%eax
  test   %eax,%eax
  jns    L146
  jmp    L94
L85:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D27
type_infered: byte[4]
name: retrieve_data
arguments: data_label: D13
type_infered: byte[4]
name: retrieve_data
arguments: data_label: D38
type_infered: string
name: retrieve_data
arguments: data_label: D22
type_infered: string

tool: {"D27": [0x00,0x00,0x14,0x42]}

tool: {"D13": [0x00,0x00,0xcc,0x42]}

tool: D38: %d.%d

tool: D22: % 6.2f

assistant: ```c
void wheelSwitchFormat(char *format, int *width, int *precision) {
  char *percent = NULL, *fpart = NULL, *ad;
  char format_used[255];
  char flag_char[2] = " ";
  int nparsed = 0;
  *width = 6;
  *precision = 2;
  percent = strchr(format, '%');
  if (percent != NULL) {
    fpart = strchr(percent, 'f');
  }
  if (percent == NULL || fpart == NULL) {
    strcpy(format_used, "% 6.2f");
  } else {
    format_used[0] = '\0';
    strncat(format_used, format, percent - format + 1);
    ad = percent + 1;
    while (1) {
      if (*ad == '+') {
        flag_char[0] = '+';
        ad++;
      } else if (*ad == ' ' || *ad == '#' || *ad == '0' || *ad == '-') {
        ad++;
      } else {
        break;
      }
    }
    strcat(format_used, flag_char);
    nparsed = sscanf(ad, "%d.%d", width, precision);
    if (nparsed == 2) {
      if (*width < 0)
        *width = 6;
      if (*precision < 0)
        *precision = 2;
      if (*precision > *width - 1)
        *precision = *width - 1;
      if (*precision < 0)
        *precision = 0;
    } else if (nparsed == 1) {
      if (*width < 0) {
        *width = 6;
        *precision = 2;
      } else {
        *precision = 0;
      }
    } else {
      *width = 6;
      *precision = 2;
    }
  }
}
```