user: 请从给定的汇编指令推导出C源代码:

```asm
<dodecode>:
  endbr64
  lea    0x1(%rdx),%eax
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %edx,%r14d
  push   %r13
  push   %r12
  mov    %ecx,%r12d
  mov    %edx,%ecx
  push   %rbp
  imul   %r12d,%ecx
  mov    %rsi,%rbp
  push   %rbx
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  lea    0x1(%r12),%eax
  mov    %eax,%r13d
  sub    $0x18,%rsp
  sar    %ebx
  shr    $0x1f,%r13d
  mov    %r8,(%rsp)
  add    %eax,%r13d
  mov    %ecx,0x8(%rsp)
  sar    %r13d
  test   %ecx,%ecx
  jle    L121
  movslq %ecx,%rdx
  xor    %esi,%esi
  mov    %rbp,%rdi
  shl    $0x2,%rdx
  call   <memset@plt>
L121:
  xor    %eax,%eax
  call   <start_inputing_bits@plt>
  mov    (%rsp),%rax
  mov    %r13d,%r8d
  mov    %ebx,%ecx
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  movzbl (%rax),%r9d
  call   <qtree_decode@plt>
  mov    %eax,%r8d
  test   %eax,%eax
  je     L59
L1:
  add    $0x18,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L59:
  mov    %r12d,%esi
  mov    %ebx,%ecx
  mov    %r12d,%edx
  shr    $0x1f,%esi
  mov    %esi,%eax
  add    %r12d,%eax
  mov    %eax,%edi
  movslq %r13d,%rax
  lea    0x0(%rbp,%rax,4),%rsi
  mov    (%rsp),%rax
  sar    %edi
  mov    %edi,%r8d
  mov    %edi,0xc(%rsp)
  mov    %r15,%rdi
  movzbl 0x1(%rax),%r9d
  call   <qtree_decode@plt>
  mov    %eax,%r8d
  test   %eax,%eax
  jne    L1
  imul   %r12d,%ebx
  mov    %r14d,%esi
  mov    %r13d,%r8d
  mov    %r12d,%edx
  shr    $0x1f,%esi
  mov    %r15,%rdi
  add    %esi,%r14d
  movslq %ebx,%rax
  sar    %r14d
  lea    0x0(%rbp,%rax,4),%rsi
  mov    (%rsp),%rax
  mov    %r14d,%ecx
  movzbl 0x1(%rax),%r9d
  call   <qtree_decode@plt>
  mov    %eax,%r8d
  test   %eax,%eax
  jne    L1
  add    %r13d,%ebx
  mov    0xc(%rsp),%r8d
  mov    %r14d,%ecx
  mov    %r12d,%edx
  movslq %ebx,%rax
  mov    %r15,%rdi
  lea    0x0(%rbp,%rax,4),%rsi
  mov    (%rsp),%rax
  movzbl 0x2(%rax),%r9d
  call   <qtree_decode@plt>
  mov    %eax,%r8d
  test   %eax,%eax
  jne    L1
  mov    %r15,%rdi
  mov    %eax,(%rsp)
  call   <input_nybble@plt>
  mov    (%rsp),%r8d
  test   %rax,%rax
  jne    L97
  xor    %eax,%eax
  mov    %r8d,(%rsp)
  call   <start_inputing_bits@plt>
  mov    0x8(%rsp),%eax
  mov    (%rsp),%r8d
  test   %eax,%eax
  jle    L1
  sub    $0x1,%eax
  lea    0x4(%rbp,%rax,4),%rbx
  jmp    L122
  nopl   0x0(%rax,%rax,1)
L96:
  add    $0x4,%rbp
  cmp    %rbx,%rbp
  je     L1
L122:
  mov    0x0(%rbp),%eax
  test   %eax,%eax
  je     L96
  mov    %r15,%rdi
  mov    %r8d,(%rsp)
  call   <input_bit@plt>
  mov    (%rsp),%r8d
  test   %rax,%rax
  je     L96
  negl   0x0(%rbp)
  jmp    L96
L97:
  lea    D9(%rip),%rdi
  call   <ffpmsg@plt>
  mov    (%rsp),%r8d
  jmp    L1
```

tool_calls: name: unpack_data
arguments: data_label: D9
type: string

tool: D9: dodecode: bad bit plane values

assistant: ```c
int dodecode(unsigned char *infile, int a[], int nx, int ny, unsigned char nbitplanes[3]) {
  int i, nel, nx2, ny2, stat;
  nel = nx * ny;
  nx2 = (nx + 1) / 2;
  ny2 = (ny + 1) / 2;
  for (i = 0; i < nel; i++)
    a[i] = 0;
  start_inputing_bits();
  stat = qtree_decode(infile, &a[0], ny, nx2, ny2, nbitplanes[0]);
  if (stat)
    return (stat);
  stat = qtree_decode(infile, &a[ny2], ny, nx2, ny / 2, nbitplanes[1]);
  if (stat)
    return (stat);
  stat = qtree_decode(infile, &a[ny * nx2], ny, nx / 2, ny2, nbitplanes[1]);
  if (stat)
    return (stat);
  stat = qtree_decode(infile, &a[ny * nx2 + ny2], ny, nx / 2, ny / 2, nbitplanes[2]);
  if (stat)
    return (stat);
  if (input_nybble(infile) != 0) {
    ffpmsg("dodecode: bad bit plane values");
    return (0);
  }
  start_inputing_bits();
  for (i = 0; i < nel; i++) {
    if (a[i]) {
      if (input_bit(infile))
        a[i] = -a[i];
    }
  }
  return (0);
}
```