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

```asm
<decode_state>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  lea    D350(%rip),%rsi
  call   <scan_file@plt>
  mov    %eax,%r15d
  lea    D330(%rip),%rsi
  mov    %rbx,%rdi
  call   <scan_file@plt>
  mov    %eax,0x4(%rsp)
  lea    D51(%rip),%rsi
  mov    %rbx,%rdi
  call   <scan_file@plt>
  mov    %eax,%ebp
  lea    D390(%rip),%rsi
  mov    %rbx,%rdi
  call   <scan_file@plt>
  mov    %eax,0x8(%rsp)
  lea    D262(%rip),%rsi
  mov    %rbx,%rdi
  call   <scan_file@plt>
  mov    %eax,%r14d
  lea    D267(%rip),%rsi
  mov    %rbx,%rdi
  call   <scan_file@plt>
  mov    %eax,0xc(%rsp)
  lea    D179(%rip),%rsi
  mov    %rbx,%rdi
  call   <scan_file@plt>
  mov    %eax,%r13d
  lea    D148(%rip),%rsi
  mov    %rbx,%rdi
  call   <scan_file@plt>
  mov    %eax,0x10(%rsp)
  lea    D195(%rip),%rsi
  mov    %rbx,%rdi
  call   <scan_file@plt>
  mov    %eax,0x14(%rsp)
  lea    D198(%rip),%rsi
  mov    %rbx,%rdi
  call   <scan_file@plt>
  mov    %eax,%r12d
  lea    D241(%rip),%rsi
  mov    %rbx,%rdi
  call   <scan_file@plt>
  mov    %eax,0x18(%rsp)
  lea    D274(%rip),%rsi
  mov    %rbx,%rdi
  call   <scan_file@plt>
  mov    %eax,0x1c(%rsp)
  mov    %rbx,%rsi
  lea    D35(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r15d,%edx
  mov    0x10(%rsp),%esi
  lea    D123(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x4(%rsp),%edx
  mov    0x14(%rsp),%esi
  lea    D263(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movswl %r14w,%r8d
  mov    %r14d,%ecx
  mov    0x8(%rsp),%edx
  mov    0x18(%rsp),%esi
  lea    D407(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movswl %r13w,%r8d
  mov    %r13d,%ecx
  mov    0xc(%rsp),%edx
  mov    0x1c(%rsp),%esi
  lea    D349(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   $0x2,%bpl
  lea    D193(%rip),%rcx
  lea    D266(%rip),%rax
  cmove  %rax,%rcx
  test   $0x1,%bpl
  lea    D442(%rip),%rdx
  lea    D396(%rip),%rax
  cmove  %rax,%rdx
  mov    %ebp,%esi
  lea    D296(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   $0xc,%bpl
  je     L24
L17:
  test   $0x80,%bpl
  lea    D431(%rip),%r8
  lea    D445(%rip),%rax
  cmove  %rax,%r8
  test   $0x40,%bpl
  lea    D53(%rip),%rcx
  cmove  %rax,%rcx
  test   $0x20,%bpl
  lea    D22(%rip),%rdx
  cmove  %rax,%rdx
  test   $0x10,%bpl
  lea    D79(%rip),%rsi
  lea    D299(%rip),%rax
  cmove  %rax,%rsi
  lea    D281(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  and    $0xf00,%esi
  cmp    $0x9,%esi
  ja     L75
L73:
  and    $0x7000,%ebp
  cmp    $0x7,%ebp
  ja     L41
  mov    %ebp,%eax
  lea    D33(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L24:
  lea    D426(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L17
L75:
  lea    D14(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L73
  lea    D161(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L54:
  lea    D65(%rip),%rdi
  call   <puts@plt>
  test   $0x8,%r12b
  lea    D306(%rip),%r9
  lea    D445(%rip),%rax
  cmove  %rax,%r9
  test   $0x4,%r12b
  lea    D80(%rip),%r8
  cmove  %rax,%r8
  test   $0x2,%r12b
  lea    D257(%rip),%rcx
  cmove  %rax,%rcx
  test   $0x1,%r12b
  lea    D125(%rip),%rdx
  cmove  %rax,%rdx
  mov    %r12d,%esi
  lea    D118(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  lea    D400(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L54
  lea    D109(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L54
  lea    D270(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L54
  lea    D383(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L54
L41:
  mov    %ebp,%esi
  lea    D434(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L54
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D350
datatype: string
name: extract_symbolic_data
arguments: data_label: D330
datatype: string
name: extract_symbolic_data
arguments: data_label: D51
datatype: string
name: extract_symbolic_data
arguments: data_label: D390
datatype: string
name: extract_symbolic_data
arguments: data_label: D262
datatype: string
name: extract_symbolic_data
arguments: data_label: D267
datatype: string
name: extract_symbolic_data
arguments: data_label: D179
datatype: string
name: extract_symbolic_data
arguments: data_label: D148
datatype: string
name: extract_symbolic_data
arguments: data_label: D195
datatype: string
name: extract_symbolic_data
arguments: data_label: D198
datatype: string
name: extract_symbolic_data
arguments: data_label: D241
datatype: string
name: extract_symbolic_data
arguments: data_label: D274
datatype: string
name: extract_symbolic_data
arguments: data_label: D35
datatype: string
name: extract_symbolic_data
arguments: data_label: D123
datatype: string
name: extract_symbolic_data
arguments: data_label: D263
datatype: string
name: extract_symbolic_data
arguments: data_label: D407
datatype: string
name: extract_symbolic_data
arguments: data_label: D349
datatype: string
name: extract_symbolic_data
arguments: data_label: D193
datatype: string
name: extract_symbolic_data
arguments: data_label: D266
datatype: string
name: extract_symbolic_data
arguments: data_label: D442
datatype: string
name: extract_symbolic_data
arguments: data_label: D396
datatype: string
name: extract_symbolic_data
arguments: data_label: D296
datatype: string
name: extract_symbolic_data
arguments: data_label: D431
datatype: string
name: extract_symbolic_data
arguments: data_label: D445
datatype: string
name: extract_symbolic_data
arguments: data_label: D53
datatype: string
name: extract_symbolic_data
arguments: data_label: D22
datatype: string
name: extract_symbolic_data
arguments: data_label: D79
datatype: string
name: extract_symbolic_data
arguments: data_label: D299
datatype: string
name: extract_symbolic_data
arguments: data_label: D281
datatype: string
name: extract_symbolic_data
arguments: data_label: D426
datatype: string
name: extract_symbolic_data
arguments: data_label: D14
datatype: string
name: extract_symbolic_data
arguments: data_label: D161
datatype: string
name: extract_symbolic_data
arguments: data_label: D65
datatype: string
name: extract_symbolic_data
arguments: data_label: D306
datatype: string
name: extract_symbolic_data
arguments: data_label: D80
datatype: string
name: extract_symbolic_data
arguments: data_label: D257
datatype: string
name: extract_symbolic_data
arguments: data_label: D125
datatype: string
name: extract_symbolic_data
arguments: data_label: D118
datatype: string
name: extract_symbolic_data
arguments: data_label: D400
datatype: string
name: extract_symbolic_data
arguments: data_label: D109
datatype: string
name: extract_symbolic_data
arguments: data_label: D270
datatype: string
name: extract_symbolic_data
arguments: data_label: D383
datatype: string
name: extract_symbolic_data
arguments: data_label: D434
datatype: string

tool: D350: NEXT_DESC_PTR

tool: D330: START_ADDR

tool: D51: CONFIG

tool: D390: X_COUNT

tool: D262: X_MODIFY

tool: D267: Y_COUNT

tool: D179: Y_MODIFY

tool: D148: CURR_DESC_PTR

tool: D195: CURR_ADDR

tool: D198: IRQ_STATUS

tool: D241: CURR_X_COUNT

tool: D274: CURR_Y_COUNT

tool: D35:   --- %s ---


tool: D123: desc: curr: 0x%08x  next: 0x%08x


tool: D263: addr: curr: 0x%08x start: 0x%08x


tool: D407: X: curr: 0x%04x count: 0x%04x mod: 0x%04x (%i)


tool: D349: Y: curr: 0x%04x count: 0x%04x mod: 0x%04x (%i)


tool: D193: write

tool: D266: read

tool: D442: en

tool: D396: dis

tool: D296: dma config: 0x%04x (%sabled %s 

tool: D431: interrupt 

tool: 

tool: D53: di_sel 

tool: D22: sync 

tool: D79: 2D

tool: D299: 1D

tool: D281: %s %s%s%s

tool: D426: 8-bit 

tool: D14: NDSIZE:INVALID:%i 

tool: D161: stop

tool: D65: )

tool: D306: run 

tool: D80: dfetch 

tool: D257: err 

tool: D125: done 

tool: D118: irq status: 0x%04x (%s%s%s%s)


tool: D400: autobuffer

tool: D109: descriptor_array

tool: D270: descriptor_list_small

tool: D383: descriptor_list_large

tool: D434: FLOW:INVALID:%i

assistant: ```c
void decode_state(const char *prefix) {
  unsigned int NEXT_DESC_PTR = scan_file(prefix, "NEXT_DESC_PTR");
  unsigned int START_ADDR = scan_file(prefix, "START_ADDR");
  unsigned int CONFIG = scan_file(prefix, "CONFIG");
  unsigned int X_COUNT = scan_file(prefix, "X_COUNT");
  unsigned int X_MODIFY = scan_file(prefix, "X_MODIFY");
  unsigned int Y_COUNT = scan_file(prefix, "Y_COUNT");
  unsigned int Y_MODIFY = scan_file(prefix, "Y_MODIFY");
  unsigned int CURR_DESC_PTR = scan_file(prefix, "CURR_DESC_PTR");
  unsigned int CURR_ADDR = scan_file(prefix, "CURR_ADDR");
  unsigned int IRQ_STATUS = scan_file(prefix, "IRQ_STATUS");
  unsigned int CURR_X_COUNT = scan_file(prefix, "CURR_X_COUNT");
  unsigned int CURR_Y_COUNT = scan_file(prefix, "CURR_Y_COUNT");
  printf("  --- %s ---\n", prefix);
  printf("desc: curr: 0x%08x  next: 0x%08x\n", CURR_DESC_PTR, NEXT_DESC_PTR);
  printf("addr: curr: 0x%08x start: 0x%08x\n", CURR_ADDR, START_ADDR);
  printf("X: curr: 0x%04x count: 0x%04x mod: 0x%04x (%i)\n", CURR_X_COUNT, X_COUNT, X_MODIFY, (short)X_MODIFY);
  printf("Y: curr: 0x%04x count: 0x%04x mod: 0x%04x (%i)\n", CURR_Y_COUNT, Y_COUNT, Y_MODIFY, (short)Y_MODIFY);
  printf("dma config: 0x%04x (%sabled %s ", CONFIG, (CONFIG & (1 << 0)) ? "en" : "dis", (CONFIG & (0x1 << 1)) ? "write" : "read");
  switch (CONFIG & (0x3 << 2)) {
  case 0x3:
    printf("WDSIZE:INVALID ");
    break;
  case 0x2:
    printf("32-bit ");
    break;
  case 0x1:
    printf("16-bit ");
    break;
  case 0x0:
    printf("8-bit ");
    break;
  }
  printf("%s %s%s%s", (CONFIG & (0x1 << 4)) ? "2D" : "1D", (CONFIG & (0x1 << 5)) ? "sync " : "", (CONFIG & (0x1 << 6)) ? "di_sel " : "", (CONFIG & (0x1 << 7)) ? "interrupt " : "");
  unsigned int NDSIZE = CONFIG & (0xF << 8);
  if (NDSIZE > 0 && NDSIZE < 10)
    printf("NDSIZE_%i ", NDSIZE);
  else if (NDSIZE >= 10)
    printf("NDSIZE:INVALID:%i ", NDSIZE);
  unsigned int FLOW = CONFIG & (0x7 << 12);
  switch (FLOW) {
  case 0:
    printf("stop");
    break;
  case 1:
    printf("autobuffer");
    break;
  case 4:
    printf("descriptor_array");
    break;
  case 6:
    printf("descriptor_list_small");
    break;
  case 7:
    printf("descriptor_list_large");
    break;
  default:
    printf("FLOW:INVALID:%i", FLOW);
  }
  printf(")\n");
  printf("irq status: 0x%04x (%s%s%s%s)\n", IRQ_STATUS, (IRQ_STATUS & (0x1 << 0)) ? "done " : "", (IRQ_STATUS & (0x1 << 1)) ? "err " : "", (IRQ_STATUS & (0x1 << 2)) ? "dfetch " : "", (IRQ_STATUS & (0x1 << 3)) ? "run " : "");
}
```