user: 请将以下的汇编代码转换成C语言代码：

```asm
<decode_state>:
  endbr64
  push   %r15
  lea    D147(%rip),%rsi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  call   <scan_file@plt>
  lea    D144(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,0x1c(%rsp)
  call   <scan_file@plt>
  lea    D418(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,0x18(%rsp)
  call   <scan_file@plt>
  lea    D70(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%ebx
  call   <scan_file@plt>
  lea    D222(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,0x14(%rsp)
  call   <scan_file@plt>
  lea    D366(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%r14d
  call   <scan_file@plt>
  lea    D437(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%r15d
  call   <scan_file@plt>
  lea    D237(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%r13d
  call   <scan_file@plt>
  lea    D356(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,0x10(%rsp)
  call   <scan_file@plt>
  lea    D98(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,0xc(%rsp)
  call   <scan_file@plt>
  lea    D21(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%r12d
  call   <scan_file@plt>
  lea    D282(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,0x8(%rsp)
  call   <scan_file@plt>
  mov    %rbp,%rsi
  lea    D160(%rip),%rdi
  mov    %eax,0x4(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x1c(%rsp),%edx
  mov    0x10(%rsp),%esi
  xor    %eax,%eax
  lea    D189(%rip),%rdi
  call   <printf@plt>
  mov    0x18(%rsp),%edx
  mov    0xc(%rsp),%esi
  xor    %eax,%eax
  lea    D213(%rip),%rdi
  call   <printf@plt>
  mov    0x14(%rsp),%edx
  mov    0x8(%rsp),%esi
  mov    %r14d,%ecx
  movswl %r14w,%r8d
  lea    D54(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x4(%rsp),%esi
  mov    %r13d,%ecx
  mov    %r15d,%edx
  lea    D79(%rip),%rdi
  xor    %eax,%eax
  movswl %r13w,%r8d
  call   <printf@plt>
  test   $0x2,%bl
  mov    %ebx,%esi
  lea    D108(%rip),%rax
  lea    D57(%rip),%rcx
  lea    D113(%rip),%rdx
  cmove  %rax,%rcx
  test   $0x1,%bl
  lea    D265(%rip),%rax
  cmove  %rax,%rdx
  lea    D256(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  test   $0xc,%bl
  je     L47
L10:
  lea    D425(%rip),%rax
  test   $0x80,%bl
  lea    D212(%rip),%r8
  cmove  %rax,%r8
  lea    D217(%rip),%rcx
  test   $0x40,%bl
  cmove  %rax,%rcx
  lea    D127(%rip),%rdx
  test   $0x20,%bl
  cmove  %rax,%rdx
  lea    D15(%rip),%rsi
  test   $0x10,%bl
  lea    D351(%rip),%rax
  lea    D340(%rip),%rdi
  cmove  %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebx,%esi
  and    $0xf00,%esi
  cmp    $0x9,%esi
  ja     L12
  and    $0x7000,%ebx
  cmp    $0x7,%ebx
  ja     L93
L5:
  lea    D300(%rip),%rdx
  mov    %ebx,%eax
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  nopl   0x0(%rax,%rax,1)
L12:
  lea    D88(%rip),%rdi
  xor    %eax,%eax
  and    $0x7000,%ebx
  call   <printf@plt>
  cmp    $0x7,%ebx
  jbe    L5
  nopl   0x0(%rax)
L93:
  mov    %ebx,%esi
  lea    D420(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L13:
  lea    D382(%rip),%rdi
  call   <puts@plt>
  lea    D425(%rip),%rax
  test   $0x8,%r12b
  lea    D117(%rip),%r9
  cmove  %rax,%r9
  test   $0x4,%r12b
  lea    D182(%rip),%r8
  mov    %r12d,%esi
  cmove  %rax,%r8
  lea    D375(%rip),%rcx
  test   $0x2,%r12b
  cmove  %rax,%rcx
  lea    D402(%rip),%rdx
  test   $0x1,%r12b
  cmove  %rax,%rdx
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  lea    D56(%rip),%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <printf@plt>
  xchg   %ax,%ax
L47:
  lea    D174(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L10
  nopl   0x0(%rax,%rax,1)
  lea    D426(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L13
  nopl   0x0(%rax,%rax,1)
  lea    D254(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L13
  nopl   0x0(%rax,%rax,1)
  lea    D191(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L13
  nopl   0x0(%rax,%rax,1)
  lea    D323(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L13
  nopl   0x0(%rax,%rax,1)
  lea    D289(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L13
```

tool_calls: name: read_data
arguments: data_tag: D147
data_type: string
name: read_data
arguments: data_tag: D144
data_type: string
name: read_data
arguments: data_tag: D418
data_type: string
name: read_data
arguments: data_tag: D70
data_type: string
name: read_data
arguments: data_tag: D222
data_type: string
name: read_data
arguments: data_tag: D366
data_type: string
name: read_data
arguments: data_tag: D437
data_type: string
name: read_data
arguments: data_tag: D237
data_type: string
name: read_data
arguments: data_tag: D356
data_type: string
name: read_data
arguments: data_tag: D98
data_type: string
name: read_data
arguments: data_tag: D21
data_type: string
name: read_data
arguments: data_tag: D282
data_type: string
name: read_data
arguments: data_tag: D160
data_type: string
name: read_data
arguments: data_tag: D189
data_type: string
name: read_data
arguments: data_tag: D213
data_type: string
name: read_data
arguments: data_tag: D54
data_type: string
name: read_data
arguments: data_tag: D79
data_type: string
name: read_data
arguments: data_tag: D108
data_type: string
name: read_data
arguments: data_tag: D57
data_type: string
name: read_data
arguments: data_tag: D113
data_type: string
name: read_data
arguments: data_tag: D265
data_type: string
name: read_data
arguments: data_tag: D256
data_type: string
name: read_data
arguments: data_tag: D425
data_type: string
name: read_data
arguments: data_tag: D212
data_type: string
name: read_data
arguments: data_tag: D217
data_type: string
name: read_data
arguments: data_tag: D127
data_type: string
name: read_data
arguments: data_tag: D15
data_type: string
name: read_data
arguments: data_tag: D351
data_type: string
name: read_data
arguments: data_tag: D340
data_type: string
name: read_data
arguments: data_tag: D88
data_type: string
name: read_data
arguments: data_tag: D420
data_type: string
name: read_data
arguments: data_tag: D382
data_type: string
name: read_data
arguments: data_tag: D117
data_type: string
name: read_data
arguments: data_tag: D182
data_type: string
name: read_data
arguments: data_tag: D375
data_type: string
name: read_data
arguments: data_tag: D402
data_type: string
name: read_data
arguments: data_tag: D56
data_type: string
name: read_data
arguments: data_tag: D174
data_type: string
name: read_data
arguments: data_tag: D426
data_type: string
name: read_data
arguments: data_tag: D254
data_type: string
name: read_data
arguments: data_tag: D191
data_type: string
name: read_data
arguments: data_tag: D323
data_type: string
name: read_data
arguments: data_tag: D289
data_type: string

tool: D147: NEXT_DESC_PTR

tool: D144: START_ADDR

tool: D418: CONFIG

tool: D70: X_COUNT

tool: D222: X_MODIFY

tool: D366: Y_COUNT

tool: D437: Y_MODIFY

tool: D237: CURR_DESC_PTR

tool: D356: CURR_ADDR

tool: D98: IRQ_STATUS

tool: D21: CURR_X_COUNT

tool: D282: CURR_Y_COUNT

tool: D160:   --- %s ---


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


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


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


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


tool: D108: read

tool: D57: write

tool: D113: en

tool: D265: dis

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

tool: 

tool: D212: interrupt 

tool: D217: di_sel 

tool: D127: sync 

tool: D15: 2D

tool: D351: 1D

tool: D340: %s %s%s%s

tool: D88: NDSIZE:INVALID:%i 

tool: D420: FLOW:INVALID:%i

tool: D382: )

tool: D117: run 

tool: D182: dfetch 

tool: D375: err 

tool: D402: done 

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


tool: D174: 8-bit 

tool: D426: stop

tool: D254: autobuffer

tool: D191: descriptor_array

tool: D323: descriptor_list_small

tool: D289: descriptor_list_large

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