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

```asm
<parse_bytes>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  lea    D7(%rip),%rsi
  mov    %rbp,%rdi
  movslq %eax,%rbx
  call   <strcmp@plt>
  test   %eax,%eax
  je     L305
  add    %rbp,%rbx
  cmp    %rbx,%rbp
  jb     L203
  jmp    L186
  nopl   0x0(%rax,%rax,1)
L37:
  sub    $0x1,%rbx
  cmp    %rbx,%rbp
  je     L224
L203:
  movsbl -0x1(%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L37
L186:
  cmp    %rbx,%rbp
  je     L224
  movsbl -0x1(%rbx),%edi
  call   <tolower@plt>
  cmp    $0x6d,%eax
  je     L153
  jg     L143
  cmp    $0x67,%eax
  je     L151
  cmp    $0x6b,%eax
  jne    L94
  movsd  D61(%rip),%xmm4
  sub    $0x1,%rbx
  movsd  %xmm4,0x8(%rsp)
L266:
  cmp    %rbx,%rbp
  jb     L189
  jmp    L72
  nopw   0x0(%rax,%rax,1)
L152:
  add    $0x1,%rbp
  cmp    %rbx,%rbp
  je     L224
L189:
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L152
  cmp    %rbx,%rbp
  jb     L91
  jmp    L72
  nopw   0x0(%rax,%rax,1)
L195:
  sub    $0x1,%rbx
  cmp    %rbx,%rbp
  je     L224
L91:
  movsbl -0x1(%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L195
L72:
  cmp    %rbp,%rbx
  je     L224
L182:
  lea    0x10(%rsp),%rsi
  mov    %rbp,%rdi
  call   <strtod@plt>
  cmp    %rbp,0x10(%rsp)
  je     L224
  mulsd  0x8(%rsp),%xmm0
  movsd  D48(%rip),%xmm1
  comisd %xmm1,%xmm0
  jae    L19
  cvttsd2si %xmm0,%rax
  mov    %rax,(%r12)
L100:
  mov    $0x1,%eax
  jmp    L190
  nopl   0x0(%rax)
L143:
  cmp    $0x74,%eax
  jne    L94
  movsd  D58(%rip),%xmm7
  sub    $0x1,%rbx
  movsd  %xmm7,0x8(%rsp)
  jmp    L266
  nopl   0x0(%rax)
L224:
  xor    %eax,%eax
L190:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L154
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nop
L305:
  movq   $0x0,(%r12)
  mov    $0x1,%eax
  jmp    L190
  nop
L19:
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rax
  mov    %rax,(%r12)
  btcq   $0x3f,(%r12)
  jmp    L100
  nopl   (%rax)
L94:
  movsd  D45(%rip),%xmm3
  movsd  %xmm3,0x8(%rsp)
  cmp    %rbx,%rbp
  jb     L189
  jmp    L182
  nopl   0x0(%rax)
L151:
  movsd  D25(%rip),%xmm6
  sub    $0x1,%rbx
  movsd  %xmm6,0x8(%rsp)
  jmp    L266
  nop
L153:
  movsd  D4(%rip),%xmm5
  sub    $0x1,%rbx
  movsd  %xmm5,0x8(%rsp)
  jmp    L266
L154:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D7
datatype: string
name: read_data
arguments: data_tag: D61
datatype: f64
name: read_data
arguments: data_tag: D48
datatype: byte[8]
name: read_data
arguments: data_tag: D58
datatype: f64
name: read_data
arguments: data_tag: D45
datatype: byte[8]
name: read_data
arguments: data_tag: D25
datatype: f64
name: read_data
arguments: data_tag: D4
datatype: f64

tool: D7: inf

tool: D61: 1024

tool: {"D48": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x43]}

tool: D58: 1099511627776

tool: {"D45": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: D25: 1073741824

tool: D4: 1048576

assistant: ```c
int parse_bytes(const char *val, unsigned long *result) {
  double number, mult;
  const char *end = val + strlen(val);
  char *endptr;
  if (!strcmp(val, "inf")) {
    *result = 0;
    return 1;
  }
  while (val < end && isspace(end[-1]))
    --end;
  if (val == end)
    return 0;
  switch (tolower(end[-1])) {
  case 'k':
    --end, mult = 1024.0;
    break;
  case 'm':
    --end, mult = 1048576.0;
    break;
  case 'g':
    --end, mult = 1073741824.0;
    break;
  case 't':
    --end, mult = 1099511627776.0;
    break;
  default:
    mult = 1;
  }
  while (val < end && isspace(*val))
    ++val;
  while (val < end && isspace(end[-1]))
    --end;
  if (val == end)
    return 0;
  number = strtod(val, &endptr);
  if (val == endptr)
    return 0;
  *result = (unsigned long)(number * mult);
  return 1;
}
```