user: 下面的汇编指令对应的C源代码是什么：

```asm
<rdsmv>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x5000(%rsp),%r11
L1085:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L1085
  sub    $0x118,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %rdx,%r12
  mov    %rcx,%r15
  mov    %rcx,(%rsp)
  mov    %r8,0x8(%rsp)
  mov    %r9,0x10(%rsp)
  mov    0x5150(%rsp),%rax
  mov    %rax,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x5108(%rsp)
  xor    %eax,%eax
  movl   $0x1,0x54(%rsp)
  call   <filec_getdebug@plt>
  mov    %eax,%r13d
  movq   $0x0,0x0(%rbp)
  movq   $0x0,(%r15)
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,0x44(%rsp)
  test   %r13d,%r13d
  jne    L522
  lea    0x4c(%rsp),%rcx
  lea    0x44(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    %rbx,%rsi
  mov    $0x0,%eax
  call   <dskbor_@plt>
  cmpl   $0x0,0x4c(%rsp)
  jne    L1156
  movl   $0x1,0x58(%rsp)
  lea    0x58(%rsp),%rsi
  lea    0x54(%rsp),%r14
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <dskbwr_@plt>
  movl   $0x200,0x3c(%rsp)
  mov    $0x200,%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    $0x40,%ecx
  mov    $0x0,%eax
  mov    %rbx,%rdi
  rep stos %rax,%es:(%rdi)
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <dskbr_@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L102
  movl   $0xfffffffe,0x4c(%rsp)
L705:
  lea    0x40(%rsp),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbcr_@plt>
  mov    0x0(%rbp),%rdi
  test   %rdi,%rdi
  je     L412
  call   <free@plt>
L412:
  mov    (%rsp),%rax
  mov    (%rax),%rdi
  test   %rdi,%rdi
  je     L303
  call   <free@plt>
  jmp    L303
L522:
  mov    %rbx,%rsi
  lea    D50(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x4c(%rsp),%rcx
  lea    0x44(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    %rbx,%rsi
  mov    $0x0,%eax
  call   <dskbor_@plt>
  mov    0x4c(%rsp),%edx
  test   %edx,%edx
  jne    L1465
  movl   $0x1,0x58(%rsp)
  lea    0x58(%rsp),%rsi
  lea    0x54(%rsp),%r14
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <dskbwr_@plt>
  movl   $0x200,0x3c(%rsp)
  mov    $0x200,%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    $0x40,%ecx
  mov    $0x0,%eax
  mov    %rbx,%rdi
  rep stos %rax,%es:(%rdi)
  lea    D565(%rip),%rdi
  call   <puts@plt>
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  mov    0x4c(%rsp),%esi
  lea    D616(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L102
  movl   $0xfffffffe,0x4c(%rsp)
L1473:
  lea    D521(%rip),%rdi
  call   <puts@plt>
L59:
  cmpl   $0x0,0x4c(%rsp)
  jne    L705
  lea    0x4c(%rsp),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbcr_@plt>
L303:
  test   %r13d,%r13d
  jne    L536
L113:
  mov    0x4c(%rsp),%eax
L785:
  mov    0x5108(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L289
  add    $0x5118,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L1465:
  mov    %rbx,%rsi
  lea    D364(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xfffffffd,%eax
  jmp    L785
L102:
  lea    0x48(%rsp),%rdi
  mov    %rbx,%rsi
  mov    $0x0,%eax
  call   <gethdl@plt>
  mov    %eax,0x4c(%rsp)
  test   %eax,%eax
  js     L531
  test   %r13d,%r13d
  jne    L351
L547:
  mov    0x48(%rsp),%r15d
  lea    0x3ff(%r15),%eax
  test   %r15d,%r15d
  cmovns %r15d,%eax
  and    $0xfffffc00,%eax
  lea    0x400(%rax),%edi
  mov    %edi,(%r12)
  movslq %edi,%rdi
  call   <malloc@plt>
  mov    %rax,%r14
  mov    %rax,0x0(%rbp)
  movslq (%r12),%rdx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    $0x40,%ecx
  mov    %r14,%rdi
  mov    %rbx,%rsi
  rep movsq %ds:(%rsi),%es:(%rdi)
  mov    %rbx,%rdi
  call   <free@plt>
  sub    $0x200,%r15d
  mov    %r15d,0x3c(%rsp)
  test   %r15d,%r15d
  jle    L1583
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x200(%r14),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  cmpl   $0x0,0x4c(%rsp)
  jne    L991
L1583:
  movl   $0x0,0x58(%rsp)
  lea    0x58(%rsp),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbwr_@plt>
  mov    0x8(%rsp),%rax
  movl   $0x0,(%rax)
  lea    0x60(%rsp),%rsi
  mov    0x0(%rbp),%rdx
  lea    D690(%rip),%rdi
  mov    $0x0,%eax
  call   <gethd@plt>
  cmpb   $0x0,0x60(%rsp)
  jne    L45
L1065:
  test   %r13d,%r13d
  je     L59
  lea    D372(%rip),%rdi
  call   <puts@plt>
  jmp    L1473
L351:
  mov    0x48(%rsp),%esi
  lea    D211(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L547
L45:
  lea    0x50(%rsp),%rdx
  lea    0x60(%rsp),%rdi
  lea    D516(%rip),%rsi
  mov    $0x0,%eax
  call   <sscanf@plt>
  mov    %eax,0x24(%rsp)
  cmp    $0x1,%eax
  jne    L1065
  test   %r13d,%r13d
  jne    L888
L922:
  mov    0x50(%rsp),%eax
  mov    0x8(%rsp),%rbx
  mov    %eax,(%rbx)
  movl   $0x0,0x40(%rsp)
  test   %eax,%eax
  jle    L862
  mov    0x24(%rsp),%ebx
  mov    $0x0,%eax
  lea    0xb0(%rsp),%r12
  lea    D607(%rip),%r14
  lea    0x60(%rsp),%r15
  mov    %r13d,0x8(%rsp)
  mov    0x10(%rsp),%r13
L800:
  lea    0x1(%rax),%edx
  mov    %r14,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    0x0(%rbp),%rdx
  mov    %r15,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <gethd@plt>
  cmpb   $0x0,0x60(%rsp)
  je     L879
  movslq 0x40(%rsp),%rax
  lea    0x0(%r13,%rax,4),%rdx
  lea    D516(%rip),%rsi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L879
  mov    0x40(%rsp),%eax
  movslq %eax,%rdx
  imul   0x0(%r13,%rdx,4),%ebx
  add    $0x1,%eax
  mov    %eax,0x40(%rsp)
  cmp    0x50(%rsp),%eax
  jl     L800
  mov    0x8(%rsp),%r13d
L160:
  lea    0x60(%rsp),%rsi
  mov    0x0(%rbp),%rdx
  lea    D86(%rip),%rdi
  mov    $0x0,%eax
  call   <gethd@plt>
  cmpb   $0x0,0x60(%rsp)
  je     L1529
  lea    0x60(%rsp),%rdi
  lea    D702(%rip),%rsi
  call   <strcmp@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  je     L1225
  lea    0x60(%rsp),%rdi
  lea    D393(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L219
  mov    0x24(%rsp),%r12d
  jmp    L1225
L888:
  mov    0x50(%rsp),%esi
  lea    D22(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L922
L879:
  mov    0x8(%rsp),%r13d
  test   %r13d,%r13d
  je     L59
  lea    0xb0(%rsp),%rsi
  lea    D715(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L1473
L862:
  mov    0x24(%rsp),%ebx
  jmp    L160
L1529:
  mov    $0xffffffff,%r12d
L1225:
  lea    0x60(%rsp),%rsi
  mov    0x0(%rbp),%rdx
  lea    D666(%rip),%rdi
  mov    $0x0,%eax
  call   <gethd@plt>
  test   %r13d,%r13d
  jne    L646
  lea    0x60(%rsp),%rdi
  lea    D249(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L140
L353:
  lea    0x60(%rsp),%rdi
  lea    D606(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L923
  lea    0x60(%rsp),%rdi
  lea    D746(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L923
  lea    0x60(%rsp),%rdi
  lea    D216(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L269
L923:
  test   %r13d,%r13d
  jne    L154
L140:
  mov    %ebx,0x3c(%rsp)
  movslq %ebx,%r12
  mov    %r12,%rdi
  call   <malloc@plt>
  mov    %rax,%r14
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    %rax,%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L377
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L705
L646:
  lea    0x60(%rsp),%rsi
  lea    D578(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x50(%rsp),%esi
  lea    D8(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,0x40(%rsp)
  cmpl   $0x0,0x50(%rsp)
  jle    L1299
  mov    $0x0,%eax
  lea    D513(%rip),%r14
  mov    0x10(%rsp),%r15
L948:
  cltq
  mov    (%r15,%rax,4),%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x40(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0x40(%rsp)
  cmp    0x50(%rsp),%eax
  jl     L948
L1299:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %ebx,%esi
  lea    D340(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   %r12d,%r12d
  je     L832
  lea    D210(%rip),%rdi
  call   <puts@plt>
L1391:
  lea    0x60(%rsp),%rdi
  lea    D249(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L353
L154:
  lea    D641(%rip),%rdi
  call   <puts@plt>
  mov    %ebx,0x3c(%rsp)
  movslq %ebx,%r12
  mov    %r12,%rdi
  call   <malloc@plt>
  mov    %rax,%r14
  mov    %ebx,%esi
  lea    D106(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D571(%rip),%rdi
  call   <puts@plt>
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    %r14,%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  mov    0x4c(%rsp),%esi
  lea    D762(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L311
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L1473
L832:
  lea    D175(%rip),%rdi
  call   <puts@plt>
  jmp    L1391
L377:
  movl   $0x1,0x58(%rsp)
  lea    0x58(%rsp),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbwr_@plt>
  lea    (%r12,%r12,1),%rdi
  call   <malloc@plt>
  mov    (%rsp),%rcx
  mov    %rax,(%rcx)
  mov    0x18(%rsp),%rax
  movl   $0x4,(%rax)
  mov    (%rcx),%r12
L184:
  mov    %ebx,%ecx
  mov    $0x0,%eax
  test   %ebx,%ebx
  jle    L840
L334:
  movzbl (%r14,%rax,1),%edx
  mov    %dx,(%r12,%rax,2)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L334
L840:
  mov    %r14,%rdi
  call   <free@plt>
L1518:
  test   %r13d,%r13d
  je     L59
  jmp    L1473
L269:
  lea    0x60(%rsp),%rdi
  lea    D84(%rip),%rsi
  call   <strcmp@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jne    L1112
  test   %r13d,%r13d
  jne    L37
  movslq %ebx,%r14
  mov    %r14,%rax
  shr    $0x3,%rax
  mov    %eax,0x3c(%rsp)
  movslq %eax,%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    %rax,%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L1513
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L705
L37:
  lea    D93(%rip),%rdi
  call   <puts@plt>
  movslq %ebx,%r14
  mov    %r14,%rax
  shr    $0x3,%rax
  mov    %eax,0x3c(%rsp)
  movslq %eax,%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  lea    D93(%rip),%rdi
  call   <puts@plt>
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    %r12,%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  mov    0x4c(%rsp),%esi
  lea    D616(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L1513
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L1473
L1513:
  movl   $0x1,0x58(%rsp)
  lea    0x58(%rsp),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbwr_@plt>
  lea    (%r14,%r14,1),%rdi
  call   <malloc@plt>
  mov    (%rsp),%rcx
  mov    %rax,(%rcx)
  mov    0x18(%rsp),%rax
  movl   $0x4,(%rax)
  mov    (%rcx),%rdx
  test   %ebx,%ebx
  jle    L178
  lea    -0x1(%rbx),%r8d
  shr    $0x3,%r8d
  add    $0x1,%r8d
  mov    %r8d,%r8d
  add    %r12,%r8
  mov    %r12,%rsi
  mov    $0x2,%edi
  jmp    L621
L197:
  add    $0x1,%rsi
  cmp    %r8,%rsi
  je     L178
L621:
  movl   $0x0,0x44(%rsp)
  mov    %r15d,%ecx
L1181:
  add    $0x2,%rdx
  movzbl (%rsi),%eax
  mov    %edi,%ebx
  shl    %cl,%ebx
  and    %ebx,%eax
  mov    %ax,-0x2(%rdx)
  mov    0x44(%rsp),%eax
  lea    0x1(%rax),%ecx
  mov    %ecx,0x44(%rsp)
  cmp    $0x7,%ecx
  jle    L1181
  jmp    L197
L178:
  mov    %r12,%rdi
  call   <free@plt>
  jmp    L1518
L1112:
  lea    0x60(%rsp),%rdi
  lea    D522(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1003
  lea    0x60(%rsp),%rdi
  lea    D232(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L1172
L1003:
  test   %r13d,%r13d
  jne    L912
  add    %ebx,%ebx
  mov    %ebx,0x3c(%rsp)
  movslq %ebx,%rdi
  call   <malloc@plt>
  mov    (%rsp),%rbx
  mov    %rax,(%rbx)
  mov    0x18(%rsp),%rax
  movl   $0x4,(%rax)
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    (%rbx),%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L275
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L705
L912:
  lea    D334(%rip),%r14
  mov    %r14,%rdi
  call   <puts@plt>
  add    %ebx,%ebx
  mov    %ebx,0x3c(%rsp)
  mov    %r14,%rdi
  call   <puts@plt>
  mov    0x3c(%rsp),%esi
  lea    D149(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movslq 0x3c(%rsp),%rdi
  call   <malloc@plt>
  mov    (%rsp),%rbx
  mov    %rax,(%rbx)
  mov    0x18(%rsp),%rax
  movl   $0x4,(%rax)
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    (%rbx),%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  mov    0x4c(%rsp),%esi
  lea    D616(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L275
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L1473
L275:
  movl   $0x1,0x58(%rsp)
  lea    0x58(%rsp),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbwr_@plt>
  mov    $0x0,%eax
  call   <getbo@plt>
  cmp    %r12d,%eax
  je     L1518
  test   %r13d,%r13d
  jne    L516
L530:
  mov    (%rsp),%rax
  mov    (%rax),%rdx
  mov    0x3c(%rsp),%esi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <swpbyt@plt>
  jmp    L1518
L516:
  lea    D752(%rip),%rdi
  call   <puts@plt>
  jmp    L530
L1172:
  lea    0x60(%rsp),%rdi
  lea    D308(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1360
  lea    0x60(%rsp),%rdi
  lea    D704(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1360
  lea    0x60(%rsp),%rdi
  lea    D21(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L549
L1360:
  test   %r13d,%r13d
  jne    L1321
  shl    $0x2,%ebx
  mov    %ebx,0x3c(%rsp)
  movslq %ebx,%rdi
  call   <malloc@plt>
  mov    (%rsp),%rbx
  mov    %rax,(%rbx)
  mov    0x18(%rsp),%rax
  movl   $0x5,(%rax)
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    (%rbx),%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L1550
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L705
L1321:
  lea    D599(%rip),%rdi
  call   <puts@plt>
  shl    $0x2,%ebx
  mov    %ebx,0x3c(%rsp)
  lea    D20(%rip),%rdi
  call   <puts@plt>
  mov    0x3c(%rsp),%esi
  lea    D149(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movslq 0x3c(%rsp),%rdi
  call   <malloc@plt>
  mov    (%rsp),%rbx
  mov    %rax,(%rbx)
  mov    0x18(%rsp),%rax
  movl   $0x5,(%rax)
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    (%rbx),%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  mov    0x4c(%rsp),%esi
  lea    D616(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L1550
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L1473
L1550:
  movl   $0x1,0x58(%rsp)
  lea    0x58(%rsp),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbwr_@plt>
  mov    $0x0,%eax
  call   <getbo@plt>
  cmp    %r12d,%eax
  je     L1518
  test   %r13d,%r13d
  jne    L946
L35:
  mov    (%rsp),%rax
  mov    (%rax),%rdx
  mov    0x3c(%rsp),%esi
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <swpbyt@plt>
  jmp    L1518
L946:
  lea    D752(%rip),%rdi
  call   <puts@plt>
  jmp    L35
L549:
  lea    0x60(%rsp),%rdi
  lea    D698(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L582
  lea    0x60(%rsp),%rdi
  lea    D758(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L103
L582:
  test   %r13d,%r13d
  jne    L1012
  shl    $0x2,%ebx
  mov    %ebx,0x3c(%rsp)
  movslq %ebx,%rdi
  call   <malloc@plt>
  mov    (%rsp),%rbx
  mov    %rax,(%rbx)
  mov    0x18(%rsp),%rax
  movl   $0x7,(%rax)
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    (%rbx),%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L72
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L705
L1012:
  lea    D622(%rip),%r14
  mov    %r14,%rdi
  call   <puts@plt>
  shl    $0x2,%ebx
  mov    %ebx,0x3c(%rsp)
  mov    %r14,%rdi
  call   <puts@plt>
  mov    0x3c(%rsp),%esi
  lea    D149(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movslq 0x3c(%rsp),%rdi
  call   <malloc@plt>
  mov    (%rsp),%rbx
  mov    %rax,(%rbx)
  mov    0x18(%rsp),%rax
  movl   $0x7,(%rax)
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    (%rbx),%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  mov    0x4c(%rsp),%esi
  lea    D616(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L72
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L1473
L72:
  movl   $0x1,0x58(%rsp)
  lea    0x58(%rsp),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbwr_@plt>
  mov    $0x0,%eax
  call   <getbo@plt>
  cmp    %r12d,%eax
  je     L1518
  test   %r13d,%r13d
  jne    L235
L1245:
  mov    (%rsp),%rax
  mov    (%rax),%rdx
  mov    0x3c(%rsp),%esi
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <swpbyt@plt>
  jmp    L1518
L235:
  lea    D752(%rip),%rdi
  call   <puts@plt>
  jmp    L1245
L103:
  lea    0x60(%rsp),%rdi
  lea    D221(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1248
  lea    0x60(%rsp),%rdi
  lea    D366(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L731
L1248:
  test   %r13d,%r13d
  jne    L544
  shl    $0x3,%ebx
  mov    %ebx,0x3c(%rsp)
  movslq %ebx,%rdi
  call   <malloc@plt>
  mov    (%rsp),%rbx
  mov    %rax,(%rbx)
  mov    0x18(%rsp),%rax
  movl   $0x9,(%rax)
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    (%rbx),%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L537
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L705
L544:
  lea    D591(%rip),%r14
  mov    %r14,%rdi
  call   <puts@plt>
  shl    $0x3,%ebx
  mov    %ebx,0x3c(%rsp)
  mov    %r14,%rdi
  call   <puts@plt>
  mov    0x3c(%rsp),%esi
  lea    D149(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movslq 0x3c(%rsp),%rdi
  call   <malloc@plt>
  mov    (%rsp),%rbx
  mov    %rax,(%rbx)
  mov    0x18(%rsp),%rax
  movl   $0x9,(%rax)
  lea    0x4c(%rsp),%rcx
  lea    0x3c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    (%rbx),%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  mov    0x4c(%rsp),%esi
  lea    D616(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,0x4c(%rsp)
  je     L537
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L1473
L537:
  movl   $0x1,0x58(%rsp)
  lea    0x58(%rsp),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbwr_@plt>
  mov    $0x0,%eax
  call   <getbo@plt>
  cmp    %r12d,%eax
  je     L1518
  test   %r13d,%r13d
  jne    L576
L1051:
  mov    (%rsp),%rax
  mov    (%rax),%rdx
  mov    0x3c(%rsp),%esi
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <swpbyt@plt>
  jmp    L1518
L576:
  lea    D752(%rip),%rdi
  call   <puts@plt>
  jmp    L1051
L731:
  lea    0x60(%rsp),%rdi
  lea    D692(%rip),%rsi
  call   <strcmp@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jne    L230
  mov    0x10(%rsp),%rax
  mov    (%rax),%r14d
  mov    0x4(%rax),%eax
  mov    %eax,0x10(%rsp)
  test   %r13d,%r13d
  jne    L507
L15:
  cmpl   $0x2,0x50(%rsp)
  jne    L1518
  add    %ebx,%ebx
  mov    %ebx,0x3c(%rsp)
  movslq %ebx,%rdi
  call   <malloc@plt>
  mov    (%rsp),%rbx
  mov    %rax,(%rbx)
  mov    $0x0,%eax
  call   <getbo@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  je     L963
  cmp    $0x1,%eax
  sete   %r15b
  movzbl %r15b,%r15d
  mov    %r12d,0x24(%rsp)
L963:
  movl   $0x2,0x5c(%rsp)
  lea    0x4c(%rsp),%rcx
  lea    0x5c(%rsp),%rdx
  lea    0x100(%rsp),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  mov    0x4c(%rsp),%edx
  test   %edx,%edx
  jne    L1446
  mov    0x5c(%rsp),%eax
  lea    -0x2(%rax),%ecx
  movslq %ecx,%rcx
  movzbl 0x100(%rsp,%rcx,1),%ecx
  shl    $0x8,%ecx
  sub    $0x1,%eax
  cltq
  movzbl 0x100(%rsp,%rax,1),%eax
  add    %ecx,%eax
  mov    %eax,0x5c(%rsp)
  lea    0x100(%rsp),%r12
  movslq %r14d,%rax
  lea    (%r12,%rax,1),%rbx
  movslq %r15d,%rax
  mov    %rax,0x28(%rsp)
  jmp    L587
L507:
  lea    D460(%rip),%rdi
  call   <puts@plt>
  jmp    L15
L1446:
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L1518
L1163:
  mov    0x5c(%rsp),%esi
  lea    D230(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x4c(%rsp),%rcx
  lea    0x5c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    %r12,%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  cmpl   $0x0,0x4c(%rsp)
  jne    L1406
  mov    0x5c(%rsp),%esi
  sub    %r14d,%esi
  sub    $0x2,%esi
  lea    D354(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L600
L1406:
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L1518
L804:
  mov    %r10b,(%rax,%rdx,1)
  add    $0x1,%rdx
L749:
  mov    %edx,%esi
  lea    (%rax,%rdx,1),%r9
  cmp    %edx,%r11d
  jg     L804
  mov    %r9,%rax
L869:
  cmp    %rcx,%r8
  jbe    L1455
  movzbl (%rcx),%r11d
  add    $0x2,%rcx
  movzbl -0x1(%rcx),%r10d
  mov    $0x0,%edx
  mov    $0x1,%edi
  jmp    L749
L1455:
  test   %dil,%dil
  je     L187
  mov    %esi,0x40(%rsp)
L187:
  test   %r13d,%r13d
  jne    L1436
L90:
  mov    (%rsp),%rax
  mov    (%rax),%rax
  mov    %rax,0x8(%rsp)
  mov    %r14d,%eax
  imul   0x44(%rsp),%eax
  add    %eax,%eax
  cltq
  mov    0x28(%rsp),%rcx
  lea    (%rcx,%rax,1),%rsi
  add    0x8(%rsp),%rsi
  movslq 0x24(%rsp),%rdx
  add    %rdx,%rax
  mov    0x8(%rsp),%rcx
  add    %rax,%rcx
  mov    $0x0,%eax
  lea    0x100(%rsp),%rdx
L29:
  cmp    %rbx,%rdx
  jae    L1162
  add    $0x1,%rdx
  movzbl -0x1(%rdx),%edi
  mov    %dil,(%rsi,%rax,2)
  movzbl 0x2900(%rsp,%rax,1),%edi
  mov    %dil,(%rcx,%rax,2)
  add    $0x1,%rax
  jmp    L29
L1436:
  lea    0x2900(%rsp),%rdx
  sub    %rdx,%rax
  mov    %rax,%rsi
  lea    D720(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L90
L1162:
  test   %r13d,%r13d
  jne    L553
L504:
  mov    0x5c(%rsp),%eax
  lea    -0x2(%rax),%edx
  movslq %edx,%rdx
  movzbl 0x100(%rsp,%rdx,1),%edx
  shl    $0x8,%edx
  sub    $0x1,%eax
  cltq
  movzbl 0x100(%rsp,%rax,1),%eax
  add    %edx,%eax
  mov    %eax,0x5c(%rsp)
  mov    0x44(%rsp),%eax
  lea    0x1(%rax),%edx
L587:
  mov    %edx,0x44(%rsp)
  mov    0x10(%rsp),%eax
  sub    $0x1,%eax
  cmp    %edx,%eax
  jle    L1256
  test   %r13d,%r13d
  jne    L1163
  lea    0x4c(%rsp),%rcx
  lea    0x5c(%rsp),%rdx
  lea    0x54(%rsp),%rdi
  mov    %r12,%rsi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  cmpl   $0x0,0x4c(%rsp)
  jne    L1406
L600:
  movslq 0x5c(%rsp),%rax
  lea    -0x2(%r12,%rax,1),%r8
  mov    0x40(%rsp),%esi
  mov    %rbx,%rcx
  mov    $0x0,%edi
  lea    0x2900(%rsp),%rax
  jmp    L869
L553:
  mov    0x44(%rsp),%esi
  lea    D257(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D48(%rip),%rdi
  call   <puts@plt>
  jmp    L504
L1256:
  subl   $0x2,0x5c(%rsp)
  lea    0x4c(%rsp),%rcx
  lea    0x5c(%rsp),%rdx
  lea    0x100(%rsp),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbr_@plt>
  cmpl   $0x0,0x4c(%rsp)
  jne    L741
  lea    0x100(%rsp),%rsi
  movslq %r14d,%rax
  lea    (%rsi,%rax,1),%rbx
  movslq 0x5c(%rsp),%rax
  add    %rax,%rsi
  mov    0x40(%rsp),%edi
  mov    %rbx,%rcx
  mov    $0x0,%r8d
  lea    0x2900(%rsp),%rax
  mov    $0x1,%r12d
  jmp    L760
L741:
  movl   $0xfffffffe,0x4c(%rsp)
  jmp    L1518
L310:
  mov    %r10b,(%rax,%rdx,1)
  add    $0x1,%rdx
L1540:
  lea    (%rax,%rdx,1),%r9
  mov    %edx,%edi
  cmp    %edx,%r11d
  jg     L310
  mov    %r9,%rax
L760:
  cmp    %rcx,%rsi
  jbe    L383
  movzbl (%rcx),%r11d
  add    $0x2,%rcx
  movzbl -0x1(%rcx),%r10d
  mov    $0x0,%edx
  mov    %r12d,%r8d
  jmp    L1540
L383:
  test   %r8b,%r8b
  je     L1178
  mov    %edi,0x40(%rsp)
L1178:
  test   %r13d,%r13d
  jne    L183
L1254:
  mov    (%rsp),%rax
  mov    (%rax),%rax
  mov    %rax,0x8(%rsp)
  mov    %r14d,%eax
  imul   0x44(%rsp),%eax
  add    %eax,%eax
  cltq
  movslq %r15d,%rdx
  add    %rax,%rdx
  add    0x8(%rsp),%rdx
  movslq 0x24(%rsp),%rcx
  add    %rcx,%rax
  mov    0x8(%rsp),%rcx
  lea    (%rcx,%rax,1),%rsi
  mov    $0x0,%eax
  lea    0x100(%rsp),%rcx
  jmp    L317
L183:
  lea    0x2900(%rsp),%rdx
  sub    %rdx,%rax
  mov    %rax,%rsi
  lea    D720(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L1254
L1466:
  add    $0x1,%rcx
  movzbl -0x1(%rcx),%edi
  mov    %dil,(%rdx,%rax,2)
  movzbl 0x2900(%rsp,%rax,1),%edi
  mov    %dil,(%rsi,%rax,2)
  add    $0x1,%rax
L317:
  cmp    %rbx,%rcx
  jb     L1466
  test   %r13d,%r13d
  jne    L1151
L1179:
  mov    0x0(%rbp),%rdx
  lea    D232(%rip),%rsi
  lea    D666(%rip),%rdi
  mov    $0x0,%eax
  call   <puthd@plt>
  mov    0x18(%rsp),%rax
  movl   $0x4,(%rax)
  jmp    L1518
L1151:
  mov    0x44(%rsp),%esi
  lea    D257(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D168(%rip),%rdi
  call   <puts@plt>
  jmp    L1179
L230:
  test   %r13d,%r13d
  jne    L1350
  movl   $0xfffffffc,0x4c(%rsp)
  jmp    L705
L1350:
  lea    D82(%rip),%rdi
  call   <puts@plt>
  movl   $0xfffffffc,0x4c(%rsp)
  jmp    L1473
L536:
  mov    0x4c(%rsp),%esi
  lea    D531(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L113
L1156:
  mov    $0xfffffffd,%eax
  jmp    L785
L531:
  mov    $0xfffffffc,%eax
L43:
  mov    %eax,0x4c(%rsp)
  test   %r13d,%r13d
  je     L705
  jmp    L1473
L991:
  mov    $0xfffffffe,%eax
  jmp    L43
L219:
  mov    $0xfffffffc,%eax
  jmp    L43
L311:
  movl   $0x1,0x58(%rsp)
  lea    0x58(%rsp),%rsi
  lea    0x54(%rsp),%rdi
  mov    $0x0,%eax
  call   <dskbwr_@plt>
  lea    (%rbx,%rbx,1),%esi
  mov    %esi,0x3c(%rsp)
  lea    D208(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    (%r12,%r12,1),%rdi
  call   <malloc@plt>
  mov    (%rsp),%rcx
  mov    %rax,(%rcx)
  mov    0x18(%rsp),%rax
  movl   $0x4,(%rax)
  mov    (%rcx),%r12
  mov    %ebx,%esi
  lea    D562(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L184
L289:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D50
type_guessed: string
name: disassemble_data
arguments: label: D565
type_guessed: string
name: disassemble_data
arguments: label: D616
type_guessed: string
name: disassemble_data
arguments: label: D521
type_guessed: string
name: disassemble_data
arguments: label: D364
type_guessed: string
name: disassemble_data
arguments: label: D690
type_guessed: string
name: disassemble_data
arguments: label: D372
type_guessed: string
name: disassemble_data
arguments: label: D211
type_guessed: string
name: disassemble_data
arguments: label: D516
type_guessed: string
name: disassemble_data
arguments: label: D607
type_guessed: string
name: disassemble_data
arguments: label: D86
type_guessed: string
name: disassemble_data
arguments: label: D702
type_guessed: string
name: disassemble_data
arguments: label: D393
type_guessed: string
name: disassemble_data
arguments: label: D22
type_guessed: string
name: disassemble_data
arguments: label: D715
type_guessed: string
name: disassemble_data
arguments: label: D666
type_guessed: string
name: disassemble_data
arguments: label: D249
type_guessed: string
name: disassemble_data
arguments: label: D606
type_guessed: string
name: disassemble_data
arguments: label: D746
type_guessed: string
name: disassemble_data
arguments: label: D216
type_guessed: string
name: disassemble_data
arguments: label: D578
type_guessed: string
name: disassemble_data
arguments: label: D8
type_guessed: string
name: disassemble_data
arguments: label: D513
type_guessed: string
name: disassemble_data
arguments: label: D340
type_guessed: string
name: disassemble_data
arguments: label: D210
type_guessed: string
name: disassemble_data
arguments: label: D641
type_guessed: string
name: disassemble_data
arguments: label: D106
type_guessed: string
name: disassemble_data
arguments: label: D571
type_guessed: string
name: disassemble_data
arguments: label: D762
type_guessed: string
name: disassemble_data
arguments: label: D175
type_guessed: string
name: disassemble_data
arguments: label: D84
type_guessed: string
name: disassemble_data
arguments: label: D93
type_guessed: string
name: disassemble_data
arguments: label: D522
type_guessed: string
name: disassemble_data
arguments: label: D232
type_guessed: string
name: disassemble_data
arguments: label: D334
type_guessed: string
name: disassemble_data
arguments: label: D149
type_guessed: string
name: disassemble_data
arguments: label: D752
type_guessed: string
name: disassemble_data
arguments: label: D308
type_guessed: string
name: disassemble_data
arguments: label: D704
type_guessed: string
name: disassemble_data
arguments: label: D21
type_guessed: string
name: disassemble_data
arguments: label: D599
type_guessed: string
name: disassemble_data
arguments: label: D20
type_guessed: string
name: disassemble_data
arguments: label: D698
type_guessed: string
name: disassemble_data
arguments: label: D758
type_guessed: string
name: disassemble_data
arguments: label: D622
type_guessed: string
name: disassemble_data
arguments: label: D221
type_guessed: string
name: disassemble_data
arguments: label: D366
type_guessed: string
name: disassemble_data
arguments: label: D591
type_guessed: string
name: disassemble_data
arguments: label: D692
type_guessed: string
name: disassemble_data
arguments: label: D460
type_guessed: string
name: disassemble_data
arguments: label: D230
type_guessed: string
name: disassemble_data
arguments: label: D354
type_guessed: string
name: disassemble_data
arguments: label: D720
type_guessed: string
name: disassemble_data
arguments: label: D257
type_guessed: string
name: disassemble_data
arguments: label: D48
type_guessed: string
name: disassemble_data
arguments: label: D168
type_guessed: string
name: disassemble_data
arguments: label: D82
type_guessed: string
name: disassemble_data
arguments: label: D531
type_guessed: string
name: disassemble_data
arguments: label: D208
type_guessed: string
name: disassemble_data
arguments: label: D562
type_guessed: string

tool: D50: Opening file: %s


tool: D565: Reading header

tool: D616: Read Completion status : %d


tool: D521: Done reading file

tool: D364: Error opening file %s, istat=%d


tool: D690: DIM

tool: D372: Error reading dimensions

tool: D211: Header length : %d


tool: D516: %d

tool: D607: SIZE%d

tool: D86: BYTE_ORDER

tool: D702: little_endian

tool: D393: big_endian

tool: D22: Number of dimensions : %d


tool: D715: Error reading %s


tool: D666: TYPE

tool: D249: unsigned_byte

tool: D606: byte

tool: D746: unsigned_char

tool: D216: char

tool: D578: Type >%s<


tool: D8: Image size (%d)

tool: D513:  %d 

tool: D340: Number of elements : %d


tool: D210: Byte order : big_endian

tool: D641: Reading byte image

tool: D106: Allocating %d bytes for byte image


tool: D571: Reading unsigned byte image

tool: D762: Read Byte Completion status : %d


tool: D175: Byte order : little_endian

tool: D84: bit

tool: D93: Reading bit image

tool: D522: mad

tool: D232: unsigned_short

tool: D334: Reading unsigned short image

tool: D149: Allocating %d bytes


tool: D752: Swapping bytes

tool: D308: long

tool: D704: long_integer

tool: D21: signed_long

tool: D599: Reading long image

tool: D20: Reading signed long image

tool: D698: float

tool: D758: ieee_float

tool: D622: Reading float image

tool: D221: complex

tool: D366: ieee_complex

tool: D591: Reading complex image

tool: D692: swap_rlmsb

tool: D460: Reading compressed image

tool: D230: Reading %d bytes


tool: D354: Uncompressing %d bytes


tool: D720: Restored %d bytes in MSB


tool: D257: Done line %d


tool: D48: =================================

tool: D168: ===================================

tool: D82: Unsupported Filetype

tool: D531: RDSMV completion status %d


tool: D208: Allocating %d bytes for short image


tool: D562: Converting %d bytes to short image


assistant: ```c
int rdsmv(char *filename, char **head, int *lhead, char **array, int *naxis, int *axis, int *type) {
  int readl;
  int i, j, k;
  int istat, bo, dim;
  char s[80], s1[80];
  int lun = 1;
  int lflag;
  int nelm;
  char *thead;
  int filec_debug = filec_getdebug();
  *head = 0;
  *array = 0;
  j = strlen(filename);
  if (filec_debug)
    printf("Opening file: %s\n", filename);
  dskbor_(&lun, filename, &j, &istat);
  if (istat != 0) {
    if (filec_debug)
      printf("Error opening file %s, istat=%d\n", filename, istat);
    return (-3);
  }
  lflag = (1 == 1);
  dskbwr_(&lun, &lflag);
  readl = 512;
  thead = malloc(512);
  memset(thead, 0, 512);
  if (filec_debug)
    printf("Reading header\n");
  dskbr_(&lun, thead, &readl, &istat);
  if (filec_debug)
    printf("Read Completion status : %d\n", istat);
  if (istat != 0) {
    istat = -2;
    goto close;
  }
  if ((istat = gethdl(&k, thead)) < 0) {
    istat = -4;
    goto close;
  }
  if (filec_debug)
    printf("Header length : %d\n", k);
  *lhead = ((k / 1024) + 1) * 1024;
  *head = malloc(*lhead);
  memset(*head, 0, *lhead);
  memcpy(*head, thead, 512);
  free(thead);
  readl = k - 512;
  if (readl > 0) {
    dskbr_(&lun, *head + 512, &readl, &istat);
    if (istat != 0) {
      istat = -2;
      goto close;
    }
  }
  lflag = (1 == 0);
  dskbwr_(&lun, &lflag);
  *naxis = 0;
  gethd("DIM", s, *head);
  if (*s == 0 || sscanf(s, "%d", &dim) != 1) {
    if (filec_debug)
      printf("Error reading dimensions\n");
    goto close;
  }
  if (filec_debug)
    printf("Number of dimensions : %d\n", dim);
  *naxis = dim;
  for (i = 0, nelm = 1; i < dim; i++) {
    sprintf(s1, "SIZE%d", i + 1);
    gethd(s1, s, *head);
    if (*s == 0 || sscanf(s, "%d", &axis[i]) != 1) {
      if (filec_debug)
        printf("Error reading %s\n", s1);
      goto close;
    }
    nelm *= axis[i];
  }
  gethd("BYTE_ORDER", s, *head);
  if (*s) {
    if (strcmp(s, "little_endian") == 0)
      bo = 0;
    else if (strcmp(s, "big_endian") == 0)
      bo = 1;
    else {
      istat = -4;
      goto close;
    }
  } else
    bo = -1;
  gethd("TYPE", s, *head);
  if (filec_debug) {
    printf("Type >%s<\n", s);
    printf("Image size (%d)", dim);
    for (i = 0; i < dim; i++)
      printf(" %d ", axis[i]);
    printf("\n");
    printf("Number of elements : %d\n", nelm);
    if (bo)
      printf("Byte order : big_endian\n");
    else
      printf("Byte order : little_endian\n");
  }
  if (strcmp(s, "unsigned_byte") == 0 || strcmp(s, "byte") == 0 || strcmp(s, "unsigned_char") == 0 || strcmp(s, "char") == 0) {
    int i;
    unsigned char *char_array, *cp;
    unsigned short *ap;
    if (filec_debug)
      printf("Reading byte image\n");
    readl = nelm * sizeof(char);
    char_array = malloc(readl);
    if (filec_debug) {
      printf("Allocating %d bytes for byte image\n", readl);
      printf("Reading unsigned byte image\n");
    }
    dskbr_(&lun, (char *)char_array, &readl, &istat);
    if (filec_debug)
      printf("Read Byte Completion status : %d\n", istat);
    if (istat != 0) {
      istat = -2;
      goto close;
    }
    lflag = (1 == 1);
    dskbwr_(&lun, &lflag);
    if (filec_debug) {
      readl = nelm * sizeof(unsigned short);
      printf("Allocating %d bytes for short image\n", readl);
    }
    *array = malloc(nelm * sizeof(unsigned short));
    *type = 4;
    ap = (unsigned short *)*array;
    cp = char_array;
    if (filec_debug)
      printf("Converting %d bytes to short image\n", nelm);
    for (i = 0; i < nelm; i++)
      *ap++ = *cp++;
    free(char_array);
  } else if (strcmp(s, "bit") == 0) {
    int i;
    unsigned char *bit_array, *bp;
    unsigned short *ap;
    if (filec_debug)
      printf("Reading bit image\n");
    readl = nelm * sizeof(char) / 8;
    bit_array = malloc(readl);
    if (filec_debug)
      printf("Reading bit image\n");
    dskbr_(&lun, (char *)bit_array, &readl, &istat);
    if (filec_debug)
      printf("Read Completion status : %d\n", istat);
    if (istat != 0) {
      istat = -2;
      goto close;
    }
    lflag = (1 == 1);
    dskbwr_(&lun, &lflag);
    *array = malloc(nelm * sizeof(unsigned short));
    *type = 4;
    ap = (unsigned short *)*array;
    bp = bit_array;
    for (i = 0; i < nelm; i += 8) {
      for (j = 0; j < 8; j++)
        *ap++ = *bp & 2 << j;
      bp++;
    }
    free(bit_array);
  } else if (strcmp(s, "mad") == 0 || strcmp(s, "unsigned_short") == 0) {
    if (filec_debug)
      printf("Reading unsigned short image\n");
    readl = nelm * sizeof(unsigned short);
    if (filec_debug) {
      printf("Reading unsigned short image\n");
      printf("Allocating %d bytes\n", readl);
    }
    *array = malloc(readl);
    *type = 4;
    dskbr_(&lun, *array, &readl, &istat);
    if (filec_debug)
      printf("Read Completion status : %d\n", istat);
    if (istat != 0) {
      istat = -2;
      goto close;
    }
    lflag = (1 == 1);
    dskbwr_(&lun, &lflag);
    if (bo != getbo()) {
      if (filec_debug)
        printf("Swapping bytes\n");
      swpbyt(0, readl, *array);
    }
  } else if (strcmp(s, "long") == 0 || strcmp(s, "long_integer") == 0 || strcmp(s, "signed_long") == 0) {
    if (filec_debug)
      printf("Reading long image\n");
    readl = nelm * sizeof(int);
    if (filec_debug) {
      printf("Reading signed long image\n");
      printf("Allocating %d bytes\n", readl);
    }
    *array = malloc(readl);
    *type = 5;
    dskbr_(&lun, *array, &readl, &istat);
    if (filec_debug)
      printf("Read Completion status : %d\n", istat);
    if (istat != 0) {
      istat = -2;
      goto close;
    }
    lflag = (1 == 1);
    dskbwr_(&lun, &lflag);
    if (bo != getbo()) {
      if (filec_debug)
        printf("Swapping bytes\n");
      swpbyt(1, readl, *array);
    }
  } else if (strcmp(s, "float") == 0 || strcmp(s, "ieee_float") == 0) {
    if (filec_debug)
      printf("Reading float image\n");
    readl = nelm * sizeof(float);
    if (filec_debug) {
      printf("Reading float image\n");
      printf("Allocating %d bytes\n", readl);
    }
    *array = malloc(readl);
    *type = 7;
    dskbr_(&lun, *array, &readl, &istat);
    if (filec_debug)
      printf("Read Completion status : %d\n", istat);
    if (istat != 0) {
      istat = -2;
      goto close;
    }
    lflag = (1 == 1);
    dskbwr_(&lun, &lflag);
    if (bo != getbo()) {
      if (filec_debug)
        printf("Swapping bytes\n");
      swpbyt(1, readl, *array);
    }
  } else if (strcmp(s, "complex") == 0 || strcmp(s, "ieee_complex") == 0) {
    if (filec_debug)
      printf("Reading complex image\n");
    readl = nelm * 2 * sizeof(float);
    if (filec_debug) {
      printf("Reading complex image\n");
      printf("Allocating %d bytes\n", readl);
    }
    *array = malloc(readl);
    *type = 9;
    dskbr_(&lun, *array, &readl, &istat);
    if (filec_debug)
      printf("Read Completion status : %d\n", istat);
    if (istat != 0) {
      istat = -2;
      goto close;
    }
    lflag = (1 == 1);
    dskbwr_(&lun, &lflag);
    if (bo != getbo()) {
      if (filec_debug)
        printf("Swapping bytes\n");
      swpbyt(1, readl, *array);
    }
  } else if (strcmp(s, "swap_rlmsb") == 0) {
    unsigned char lsb[10 * 1024], msb[10 * 1024];
    unsigned char *lp, *mp, *alp, *amp;
    int lstart = 0, mstart = 0;
    int llen, n, val;
    int is1 = axis[0], is2 = axis[1];
    if (filec_debug)
      printf("Reading compressed image\n");
    if (dim != 2)
      goto close;
    readl = nelm * sizeof(unsigned short);
    *array = malloc(readl);
    bo = getbo();
    if (bo == 0) {
      lstart = 0;
      mstart = 1;
    } else if (bo == 1) {
      lstart = 1;
      mstart = 0;
    }
    llen = 2;
    dskbr_(&lun, (char *)lsb, &llen, &istat);
    if (istat != 0) {
      istat = -2;
      goto close;
    }
    llen = (int)lsb[llen - 2] * 256 + lsb[llen - 1];
    for (j = 0; j < (is2 - 1); j++) {
      if (filec_debug)
        printf("Reading %d bytes\n", llen);
      dskbr_(&lun, (char *)lsb, &llen, &istat);
      if (istat != 0) {
        istat = -2;
        goto close;
      }
      if (filec_debug)
        printf("Uncompressing %d bytes\n", llen - (is1)-2);
      for (lp = lsb + (is1), mp = msb; lp < lsb + llen - 2;) {
        n = *lp++;
        val = *lp++;
        if (filec_debug && 0)
          printf("Line %d, n %d, val %d\n", j, n, val);
        for (i = 0; i < n; i++)
          *mp++ = val;
      }
      if (filec_debug)
        printf("Restored %d bytes in MSB\n", mp - msb);
      alp = (unsigned char *)*array + 2 * j * is1 + lstart;
      amp = (unsigned char *)*array + 2 * j * is1 + mstart;
      for (lp = lsb, mp = msb; lp < lsb + (is1); alp += 2, amp += 2) {
        *alp = *lp++;
        *amp = *mp++;
      }
      if (filec_debug) {
        printf("Done line %d\n", j);
        printf("=================================\n");
      }
      llen = (int)lsb[llen - 2] * 256 + lsb[llen - 1];
    }
    llen -= 2;
    dskbr_(&lun, (char *)lsb, &llen, &istat);
    if (istat != 0) {
      istat = -2;
      goto close;
    }
    for (lp = lsb + (is1), mp = msb; lp < lsb + llen;) {
      n = *lp++;
      val = *lp++;
      if (filec_debug && 0)
        printf("Line %d, n %d, val %d\n", j, n, val);
      for (i = 0; i < n; i++)
        *mp++ = val;
    }
    if (filec_debug)
      printf("Restored %d bytes in MSB\n", mp - msb);
    alp = (unsigned char *)*array + 2 * j * is1 + lstart;
    amp = (unsigned char *)*array + 2 * j * is1 + mstart;
    for (lp = lsb, mp = msb; lp < lsb + (is1); alp += 2, amp += 2) {
      *alp = *lp++;
      *amp = *mp++;
    }
    if (filec_debug) {
      printf("Done line %d\n", j);
      printf("===================================\n");
    }
    puthd("TYPE", "unsigned_short", *head);
    *type = 4;
  } else {
    if (filec_debug)
      printf("Unsupported Filetype\n");
    istat = -4;
    goto close;
  }
close:
  if (filec_debug)
    printf("Done reading file\n");
  if (istat) {
    dskbcr_(&lun, &i);
    if (*head != 0)
      free(*head);
    if (*array != 0)
      free(*array);
  } else
    dskbcr_(&lun, &istat);
  if (filec_debug)
    printf("RDSMV completion status %d\n", istat);
  return istat;
}
```