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

```asm
<gm_encode>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,%r15
  mov    %esi,0x10(%rsp)
  mov    %rdx,%rbp
  mov    %ecx,%ebx
  mov    %r8d,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    D29(%rip),%rsi
  mov    %rdx,%rdi
  call   <strcpy@plt>
  test   %ebx,%ebx
  jne    L900
L5:
  cmp    $0x3,%r12d
  jne    L878
L615:
  movl   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movl   $0x0,0x14(%rsp)
  movl   $0x0,0x1c(%rsp)
  mov    $0x0,%r13d
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%ebx
  jmp    L199
L900:
  lea    D290(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L5
L878:
  lea    D424(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    $0x0,%ebx
  mov    $0x100,%r13d
  lea    D513(%rip),%r14
  jmp    L852
L607:
  lea    D91(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L80:
  add    $0x1,%ebx
  cmp    $0xa,%ebx
  je     L615
L852:
  mov    %r13d,%eax
  mov    %ebx,%ecx
  sar    %cl,%eax
  test   %r12d,%eax
  je     L607
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L80
  mov    0xc(%rsp),%eax
  cmp    $0x7,%eax
  ja     L1206
  mov    %eax,%eax
  lea    D735(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  lea    D148(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L360
  lea    D411(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L609
  lea    D449(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L223
  lea    D701(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L751
  lea    D251(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L1186
  lea    D5(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L91
  mov    0xc(%rsp),%eax
  cmp    $0x6,%eax
  ja     L1206
  mov    %eax,%eax
  lea    D176(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  lea    D240(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L609:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  mov    %rax,0x28(%rsp)
  lea    D437(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L738:
  movl   $0x30,0x3c(%rsp)
  movl   $0x30,0x40(%rsp)
  movl   $0x30,0x44(%rsp)
  mov    $0xffffffff,%esi
  mov    $0x0,%edx
  mov    0x10(%rsp),%r8d
  lea    -0x1(%r8),%ecx
  jmp    L1058
  lea    D647(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L223:
  movslq %ebx,%rax
  lea    (%r15,%rax,4),%r12
  mov    (%r12),%esi
  lea    -0x61(%rsi),%eax
  cmp    $0x19,%eax
  jbe    L250
  cmp    $0x20,%esi
  je     L250
  lea    D22(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    (%r12),%esi
  mov    %rbp,%rdi
  call   <add_shift_char@plt>
L60:
  add    $0x1,%ebx
  jmp    L692
  lea    D417(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L751:
  movslq %ebx,%rax
  lea    (%r15,%rax,4),%r12
  mov    (%r12),%esi
  lea    -0x41(%rsi),%eax
  cmp    $0x19,%eax
  jbe    L403
  cmp    $0x20,%esi
  je     L403
  lea    D22(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    (%r12),%esi
  mov    %rbp,%rdi
  call   <add_shift_char@plt>
L37:
  add    $0x1,%ebx
  jmp    L692
  lea    D514(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L1186:
  movslq %ebx,%rax
  lea    (%r15,%rax,4),%r12
  mov    (%r12),%esi
  lea    -0x41(%rsi),%eax
  cmp    $0x19,%eax
  jbe    L439
  lea    -0x61(%rsi),%eax
  cmp    $0x19,%eax
  ja     L669
L439:
  lea    D547(%rip),%rdi
  call   <posn@plt>
  mov    %eax,%r13d
  mov    $0x0,%r12d
  mov    $0x20,%r14d
  jmp    L1067
  lea    D245(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L91:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  mov    %rax,0x20(%rsp)
  lea    D676(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L1191
  mov    0x1c(%rsp),%eax
  cmp    $0x2,%eax
  je     L430
  cmp    $0x3,%eax
  je     L1338
  cmp    $0x1,%eax
  je     L500
L683:
  mov    0xc(%rsp),%eax
  cmp    $0x7,%eax
  ja     L1206
  mov    %eax,%eax
  lea    D600(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L500:
  mov    0x28(%rsp),%rax
  movb   $0x31,0x0(%rbp,%rax,1)
  movb   $0x30,0x1(%rbp,%rax,1)
  jmp    L683
L430:
  mov    0x28(%rsp),%rax
  movb   $0x30,0x0(%rbp,%rax,1)
  movb   $0x31,0x1(%rbp,%rax,1)
  jmp    L683
L1338:
  mov    0x28(%rsp),%rax
  movb   $0x30,0x0(%rbp,%rax,1)
  movb   $0x30,0x1(%rbp,%rax,1)
  jmp    L683
  lea    D221(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L360:
  movslq %ebx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    (%r15,%rax,4),%eax
  cmp    $0xff,%eax
  jg     L398
  mov    0x10(%rsp),%esi
  lea    -0x1(%rsi),%ecx
  cmp    %ebx,%ecx
  je     L307
  cmp    $0x13,%eax
  jne    L925
  cmpl   $0x10,0x4(%r15,%rdx,1)
  jne    L925
  add    $0x1,%ebx
  mov    $0x1e60,%r13d
  jmp    L925
  lea    D631(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L223
  lea    D727(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L751
  lea    D266(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L1186
  lea    D250(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L91
  mov    0xc(%rsp),%eax
  cmp    $0x7,%eax
  ja     L1206
  mov    %eax,%eax
  lea    D275(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  lea    D354(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L360
  lea    D288(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  cmp    $0x1,%r12d
  je     L738
  jmp    L609
  lea    D681(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L1206:
  mov    0xc(%rsp),%eax
  cmp    $0x7,%eax
  ja     L692
  mov    %eax,%eax
  lea    D364(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  lea    D60(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L1186
  lea    D335(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  cmp    $0x6,%r12d
  jne    L91
L1191:
  cmpl   $0x200,0x18(%rsp)
  je     L662
L632:
  movslq %ebx,%rax
  mov    (%r15,%rax,4),%r13d
  mov    $0x0,%r12d
  mov    $0x80,%r14d
  jmp    L425
  mov    0xc(%rsp),%eax
  cmp    $0x7,%eax
  ja     L1206
  mov    %eax,%eax
  lea    D320(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  lea    D608(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L360
  lea    D114(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L609
  lea    D246(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L223
  lea    D744(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L751
  lea    D9(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L91
  mov    0x18(%rsp),%edx
  mov    0x20(%rsp),%rsi
  mov    %rbp,%rdi
  call   <add_byte_count@plt>
  mov    0xc(%rsp),%eax
  cmp    $0x7,%eax
  ja     L377
  mov    %eax,%eax
  lea    D201(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  lea    D148(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  movl   $0x0,0x18(%rsp)
  jmp    L360
  lea    D411(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  movl   $0x0,0x18(%rsp)
  jmp    L609
  lea    D449(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  movl   $0x0,0x18(%rsp)
  jmp    L223
  lea    D701(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  movl   $0x0,0x18(%rsp)
  jmp    L751
  lea    D251(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  movl   $0x0,0x18(%rsp)
  jmp    L1186
L377:
  movl   $0x0,0x18(%rsp)
  jmp    L1206
L398:
  movzbl %ah,%edx
  movzbl %al,%eax
  lea    -0xa0(%rdx),%ecx
  cmp    $0x9,%ecx
  ja     L772
  lea    -0x1e3(%rdx,%rdx,2),%edx
  shl    $0x5,%edx
  lea    -0xa0(%rax,%rdx,1),%r13d
  jmp    L925
L772:
  lea    -0xb0(%rdx),%ecx
  cmp    $0x47,%ecx
  ja     L925
  lea    -0x1f5(%rdx,%rdx,2),%edx
  shl    $0x5,%edx
  lea    -0xa0(%rax,%rdx,1),%r13d
  jmp    L925
L1249:
  lea    D91(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L1022:
  add    $0x1,%r12d
  cmp    $0xd,%r12d
  je     L2
L1090:
  mov    %r14d,%eax
  mov    %r12d,%ecx
  sar    %cl,%eax
  test   %r13d,%eax
  je     L1249
  lea    D513(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L1022
L2:
  add    $0x1,%ebx
L692:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    $0x23e7,%eax
  jg     L525
  cmp    0x10(%rsp),%ebx
  jge    L462
L199:
  mov    0xc(%rsp),%ecx
  mov    %ecx,%r12d
  mov    %ebx,%edx
  mov    0x10(%rsp),%esi
  mov    %r15,%rdi
  call   <seek_forward@plt>
  mov    %eax,0xc(%rsp)
  cmp    %eax,%r12d
  je     L348
  cmp    $0x7,%r12d
  ja     L1206
  mov    %r12d,%eax
  lea    D153(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L732:
  cmp    $0x2,%edx
  jg     L1003
  cmp    %r8d,%ebx
  jge    L1003
L1058:
  movslq %ebx,%rax
  mov    (%r15,%rax,4),%eax
  lea    -0x30(%rax),%edi
  cmp    $0x9,%edi
  ja     L369
  movslq %edx,%rdi
  mov    %eax,0x3c(%rsp,%rdi,4)
  add    $0x1,%ebx
  add    $0x1,%edx
L369:
  movslq %ebx,%rax
  mov    (%r15,%rax,4),%eax
  cmp    $0x20,%eax
  je     L433
  lea    -0x2b(%rax),%edi
  cmp    $0x3,%edi
  ja     L883
L433:
  add    $0x1,%ebx
  mov    %eax,0x14(%rsp)
  mov    %edx,%esi
L883:
  cmp    %ebx,%ecx
  jle    L732
  movslq %ebx,%rax
  lea    0x0(,%rax,4),%rdi
  mov    (%r15,%rax,4),%eax
  cmp    $0x13,%eax
  jne    L732
  cmpl   $0x10,0x4(%r15,%rdi,1)
  jne    L732
  add    $0x2,%ebx
  mov    %eax,0x14(%rsp)
  mov    %edx,%esi
  jmp    L732
L1003:
  mov    %edx,0x1c(%rsp)
  cmp    $0xffffffff,%esi
  jne    L178
L1306:
  mov    0x3c(%rsp),%eax
  sub    $0x30,%eax
  imul   $0x64,%eax,%eax
  mov    0x40(%rsp),%edx
  lea    -0xf0(%rdx,%rdx,4),%edx
  lea    (%rax,%rdx,2),%edx
  mov    0x44(%rsp),%eax
  lea    -0x30(%rdx,%rax,1),%r13d
  mov    $0x0,%r12d
  mov    $0x200,%r14d
  jmp    L416
L178:
  mov    0x14(%rsp),%eax
  sub    $0x13,%eax
  cmp    $0x1b,%eax
  ja     L203
  mov    %eax,%eax
  lea    D428(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x0,%r13d
  jmp    L203
  mov    $0x3,%r13d
L203:
  lea    0x3e8(%r13,%rsi,1),%r14d
  mov    $0x0,%r12d
  mov    $0x200,%r13d
  jmp    L1065
  mov    $0x6,%r13d
  jmp    L203
  mov    $0x9,%r13d
  jmp    L203
  mov    $0xc,%r13d
  jmp    L203
  mov    $0xf,%r13d
  jmp    L203
L812:
  lea    D91(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L948:
  add    $0x1,%r12d
  cmp    $0xa,%r12d
  je     L1306
L1065:
  mov    %r13d,%eax
  mov    %r12d,%ecx
  sar    %cl,%eax
  test   %r14d,%eax
  je     L812
  lea    D513(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L948
L1355:
  lea    D91(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L776:
  add    $0x1,%r12d
  cmp    $0xa,%r12d
  je     L692
L416:
  mov    %r14d,%eax
  mov    %r12d,%ecx
  sar    %cl,%eax
  test   %r13d,%eax
  je     L1355
  lea    D513(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L776
L662:
  mov    $0x200,%edx
  mov    0x20(%rsp),%rsi
  mov    %rbp,%rdi
  call   <add_byte_count@plt>
  lea    D5(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  mov    %rax,0x20(%rsp)
  lea    D676(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  movl   $0x0,0x18(%rsp)
  jmp    L632
L245:
  lea    D91(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L720:
  add    $0x1,%r12d
  cmp    $0x8,%r12d
  je     L3
L425:
  mov    %r14d,%eax
  mov    %r12d,%ecx
  sar    %cl,%eax
  test   %r13d,%eax
  je     L245
  lea    D513(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L720
L3:
  add    $0x1,%ebx
  addl   $0x1,0x18(%rsp)
  jmp    L692
L669:
  lea    -0x30(%rsi),%eax
  cmp    $0x9,%eax
  jbe    L439
  cmp    $0x20,%esi
  je     L439
  lea    D455(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    (%r12),%esi
  mov    %rbp,%rdi
  call   <add_shift_char@plt>
L858:
  add    $0x1,%ebx
  jmp    L692
L1039:
  lea    D91(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L510:
  add    $0x1,%r12d
  cmp    $0x6,%r12d
  je     L858
L1067:
  mov    %r14d,%eax
  mov    %r12d,%ecx
  sar    %cl,%eax
  test   %r13d,%eax
  je     L1039
  lea    D513(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L510
L403:
  lea    D737(%rip),%rdi
  call   <posn@plt>
  mov    %eax,%r13d
  mov    $0x0,%r12d
  mov    $0x10,%r14d
  jmp    L1057
L549:
  lea    D91(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L488:
  add    $0x1,%r12d
  cmp    $0x5,%r12d
  je     L37
L1057:
  mov    %r14d,%eax
  mov    %r12d,%ecx
  sar    %cl,%eax
  test   %r13d,%eax
  je     L549
  lea    D513(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L488
L250:
  lea    D674(%rip),%rdi
  call   <posn@plt>
  mov    %eax,%r13d
  mov    $0x0,%r12d
  mov    $0x10,%r14d
  jmp    L1207
L402:
  lea    D91(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L684:
  add    $0x1,%r12d
  cmp    $0x5,%r12d
  je     L60
L1207:
  mov    %r14d,%eax
  mov    %r12d,%ecx
  sar    %cl,%eax
  test   %r13d,%eax
  je     L402
  lea    D513(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L684
L462:
  cmpl   $0x1,0xc(%rsp)
  je     L597
  cmpl   $0x6,0xc(%rsp)
  je     L1041
L1163:
  mov    0xc(%rsp),%eax
  cmp    $0x7,%eax
  ja     L383
  mov    %eax,%eax
  lea    D392(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L597:
  mov    0x1c(%rsp),%eax
  cmp    $0x2,%eax
  je     L355
  cmp    $0x3,%eax
  je     L1291
  cmp    $0x1,%eax
  jne    L1163
  mov    0x28(%rsp),%rax
  movb   $0x31,0x0(%rbp,%rax,1)
  movb   $0x30,0x1(%rbp,%rax,1)
L740:
  lea    D562(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L383
L355:
  mov    0x28(%rsp),%rax
  movb   $0x30,0x0(%rbp,%rax,1)
  movb   $0x31,0x1(%rbp,%rax,1)
  jmp    L740
L1291:
  mov    0x28(%rsp),%rax
  movb   $0x30,0x0(%rbp,%rax,1)
  movb   $0x30,0x1(%rbp,%rax,1)
  jmp    L740
L1041:
  mov    0x18(%rsp),%edx
  mov    0x20(%rsp),%rsi
  mov    %rbp,%rdi
  call   <add_byte_count@plt>
  lea    D528(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L383
  lea    D752(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L383:
  mov    %rbp,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  lea    0x0(,%rdx,8),%ecx
  sub    %edx,%ecx
  mov    %ecx,%edx
  sub    %eax,%edx
  lea    0x7(%rdx),%r12d
  je     L1184
  mov    $0x0,%ebx
  lea    D91(%rip),%r13
L1313:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  jne    L1313
L1184:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    $0x23e7,%eax
  setg   %al
  movzbl %al,%eax
  lea    (%rax,%rax,4),%eax
  jmp    L921
  lea    D131(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L383
  lea    D736(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L383
L525:
  mov    $0x5,%eax
L921:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L299
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L307:
  lea    0x1e61(%rax),%r13d
L925:
  mov    $0x0,%r12d
  mov    $0x1000,%r14d
  jmp    L1090
L348:
  mov    0xc(%rsp),%eax
  cmp    $0x7,%eax
  ja     L692
  mov    %eax,%eax
  lea    D446(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L299:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D29
type_infered: string
name: read_data
arguments: label: D290
type_infered: string
name: read_data
arguments: label: D424
type_infered: string
name: read_data
arguments: label: D513
type_infered: string
name: read_data
arguments: label: D91
type_infered: string
name: read_data
arguments: label: D148
type_infered: string
name: read_data
arguments: label: D411
type_infered: string
name: read_data
arguments: label: D449
type_infered: string
name: read_data
arguments: label: D701
type_infered: string
name: read_data
arguments: label: D251
type_infered: string
name: read_data
arguments: label: D5
type_infered: string
name: read_data
arguments: label: D240
type_infered: string
name: read_data
arguments: label: D437
type_infered: string
name: read_data
arguments: label: D647
type_infered: string
name: read_data
arguments: label: D22
type_infered: string
name: read_data
arguments: label: D417
type_infered: string
name: read_data
arguments: label: D514
type_infered: string
name: read_data
arguments: label: D547
type_infered: string
name: read_data
arguments: label: D245
type_infered: string
name: read_data
arguments: label: D676
type_infered: string
name: read_data
arguments: label: D221
type_infered: string
name: read_data
arguments: label: D631
type_infered: string
name: read_data
arguments: label: D727
type_infered: string
name: read_data
arguments: label: D266
type_infered: string
name: read_data
arguments: label: D250
type_infered: string
name: read_data
arguments: label: D354
type_infered: string
name: read_data
arguments: label: D288
type_infered: string
name: read_data
arguments: label: D681
type_infered: string
name: read_data
arguments: label: D60
type_infered: string
name: read_data
arguments: label: D335
type_infered: string
name: read_data
arguments: label: D608
type_infered: string
name: read_data
arguments: label: D114
type_infered: string
name: read_data
arguments: label: D246
type_infered: string
name: read_data
arguments: label: D744
type_infered: string
name: read_data
arguments: label: D9
type_infered: string
name: read_data
arguments: label: D455
type_infered: string
name: read_data
arguments: label: D737
type_infered: string
name: read_data
arguments: label: D674
type_infered: string
name: read_data
arguments: label: D562
type_infered: string
name: read_data
arguments: label: D528
type_infered: string
name: read_data
arguments: label: D752
type_infered: string
name: read_data
arguments: label: D131
type_infered: string
name: read_data
arguments: label: D736
type_infered: string

tool: 

tool: D290: 1010

tool: D424: 11000

tool: D513: 1

tool: D91: 0

tool: D148: 0001

tool: D411: 0010

tool: D449: 0011

tool: D701: 0100

tool: D251: 0101

tool: D5: 0111

tool: D240: 1111111100001

tool: D437: XX

tool: D647: 1111111100010

tool: D22: 1111101

tool: D417: 1111111100011

tool: D514: 1111111100100

tool: D547: 0123456789ABCDEFGHIJKLMOPRSTUVWXYZabcdefghijklmnopqrstuvwxyz 

tool: D245: 1111111100101

tool: D676: LLLLLLLLL

tool: D221: 1111111011

tool: D631: 1111111100

tool: D727: 1111111101

tool: D266: 1111111110

tool: D250: 1111111111

tool: D354: 11100

tool: D288: 11101

tool: D681: 11110

tool: D60: 1111100

tool: D335: 1111110

tool: D608: 1111110001

tool: D114: 1111110010

tool: D246: 1111110011

tool: D744: 1111110100

tool: D9: 1111110111

tool: D455: 1111110110

tool: D737: ABCDEFGHIJKLMNOPQRSTUVWXYZ 

tool: D674: abcdefghijklmnopqrstuvwxyz 

tool: D562: 1111111010

tool: D528: 0000

tool: D752: 1111111100000

tool: D131: 11011

tool: D736: 1111110000

assistant: ```c
int gm_encode(int gbdata[], int length, char binary[], int reader, int eci) {
  int sp, current_mode, next_mode, last_mode, glyph = 0, q;
  int c1, c2, done;
  int p = 0, ppos;
  int numbuf[3], punt = 0;
  size_t number_pad_posn, byte_count_posn = 0;
  int byte_count = 0, debug = 0;
  int shift, i;
  strcpy(binary, "");
  sp = 0;
  current_mode = 0;
  last_mode = 0;
  number_pad_posn = 0;
  if (reader) {
    strcat(binary, "1010");
  }
  if (eci != 3) {
    strcat(binary, "11000");
    for (q = 0; q < 10; q++) {
      if (eci & (0x100 >> q)) {
        strcat(binary, "1");
      } else {
        strcat(binary, "0");
      }
    }
  }
  do {
    next_mode = seek_forward(gbdata, length, sp, current_mode);
    if (next_mode != current_mode) {
      switch (current_mode) {
      case 0:
        switch (next_mode) {
        case 7:
          strcat(binary, "0001");
          break;
        case 1:
          strcat(binary, "0010");
          break;
        case 2:
          strcat(binary, "0011");
          break;
        case 3:
          strcat(binary, "0100");
          break;
        case 4:
          strcat(binary, "0101");
          break;
        case 6:
          strcat(binary, "0111");
          break;
        }
        break;
      case 7:
        switch (next_mode) {
        case 1:
          strcat(binary, "1111111100001");
          break;
        case 2:
          strcat(binary, "1111111100010");
          break;
        case 3:
          strcat(binary, "1111111100011");
          break;
        case 4:
          strcat(binary, "1111111100100");
          break;
        case 6:
          strcat(binary, "1111111100101");
          break;
        }
        break;
      case 1:
        switch (p) {
        case 1:
          binary[number_pad_posn] = '1';
          binary[number_pad_posn + 1] = '0';
          break;
        case 2:
          binary[number_pad_posn] = '0';
          binary[number_pad_posn + 1] = '1';
          break;
        case 3:
          binary[number_pad_posn] = '0';
          binary[number_pad_posn + 1] = '0';
          break;
        }
        switch (next_mode) {
        case 7:
          strcat(binary, "1111111011");
          break;
        case 2:
          strcat(binary, "1111111100");
          break;
        case 3:
          strcat(binary, "1111111101");
          break;
        case 4:
          strcat(binary, "1111111110");
          break;
        case 6:
          strcat(binary, "1111111111");
          break;
        }
        break;
      case 2:
      case 3:
        switch (next_mode) {
        case 7:
          strcat(binary, "11100");
          break;
        case 1:
          strcat(binary, "11101");
          break;
        case 2:
        case 3:
          strcat(binary, "11110");
          break;
        case 4:
          strcat(binary, "1111100");
          break;
        case 6:
          strcat(binary, "1111110");
          break;
        }
        break;
      case 4:
        switch (next_mode) {
        case 7:
          strcat(binary, "1111110001");
          break;
        case 1:
          strcat(binary, "1111110010");
          break;
        case 2:
          strcat(binary, "1111110011");
          break;
        case 3:
          strcat(binary, "1111110100");
          break;
        case 6:
          strcat(binary, "1111110111");
          break;
        }
        break;
      case 6:
        add_byte_count(binary, byte_count_posn, byte_count);
        byte_count = 0;
        switch (next_mode) {
        case 7:
          strcat(binary, "0001");
          break;
        case 1:
          strcat(binary, "0010");
          break;
        case 2:
          strcat(binary, "0011");
          break;
        case 3:
          strcat(binary, "0100");
          break;
        case 4:
          strcat(binary, "0101");
          break;
        }
        break;
      }
      if (debug) {
        switch (next_mode) {
        case 7:
          printf("CHIN ");
          break;
        case 1:
          printf("NUMB ");
          break;
        case 2:
          printf("LOWR ");
          break;
        case 3:
          printf("UPPR ");
          break;
        case 4:
          printf("MIXD ");
          break;
        case 6:
          printf("BYTE ");
          break;
        }
      }
    }
    last_mode = current_mode;
    current_mode = next_mode;
    switch (current_mode) {
    case 7:
      done = 0;
      if (gbdata[sp] > 0xff) {
        c1 = (gbdata[sp] & 0xff00) >> 8;
        c2 = gbdata[sp] & 0xff;
        if ((c1 >= 0xa0) && (c1 <= 0xa9)) {
          glyph = (0x60 * (c1 - 0xa1)) + (c2 - 0xa0);
        }
        if ((c1 >= 0xb0) && (c1 <= 0xf7)) {
          glyph = (0x60 * (c1 - 0xb0 + 9)) + (c2 - 0xa0);
        }
        done = 1;
      }
      if (!(done)) {
        if (sp != (length - 1)) {
          if ((gbdata[sp] == 0x13) && (gbdata[sp + 1] == 0x10)) {
            glyph = 7776;
            sp++;
          }
          done = 1;
        }
      }
      if (!(done)) {
        if (sp != (length - 1)) {
          if (((gbdata[sp] >= '0') && (gbdata[sp] <= '9')) && ((gbdata[sp + 1] >= '0') && (gbdata[sp + 1] <= '9'))) {
            glyph = 8033 + (10 * (gbdata[sp] - '0')) + (gbdata[sp + 1] - '0');
            sp++;
          }
        }
      }
      if (!(done)) {
        glyph = 7777 + gbdata[sp];
      }
      if (debug) {
        printf("[%d] ", glyph);
      }
      for (q = 0; q < 13; q++) {
        if (glyph & (0x1000 >> q)) {
          strcat(binary, "1");
        } else {
          strcat(binary, "0");
        }
      }
      sp++;
      break;
    case 1:
      if (last_mode != current_mode) {
        number_pad_posn = strlen(binary);
        strcat(binary, "XX");
      }
      p = 0;
      ppos = -1;
      numbuf[0] = '0';
      numbuf[1] = '0';
      numbuf[2] = '0';
      do {
        if ((gbdata[sp] >= '0') && (gbdata[sp] <= '9')) {
          numbuf[p] = gbdata[sp];
          sp++;
          p++;
        }
        switch (gbdata[sp]) {
        case ' ':
        case '+':
        case '-':
        case '.':
        case ',':
          punt = gbdata[sp];
          sp++;
          ppos = p;
          break;
        }
        if (sp < (length - 1)) {
          if ((gbdata[sp] == 0x13) && (gbdata[sp + 1] == 0x10)) {
            punt = gbdata[sp];
            sp += 2;
            ppos = p;
          }
        }
      } while ((p < 3) && (sp < length));
      if (ppos != -1) {
        switch (punt) {
        case ' ':
          glyph = 0;
          break;
        case '+':
          glyph = 3;
          break;
        case '-':
          glyph = 6;
          break;
        case '.':
          glyph = 9;
          break;
        case ',':
          glyph = 12;
          break;
        case 0x13:
          glyph = 15;
          break;
        }
        glyph += ppos;
        glyph += 1000;
        if (debug) {
          printf("[%d] ", glyph);
        }
        for (q = 0; q < 10; q++) {
          if (glyph & (0x200 >> q)) {
            strcat(binary, "1");
          } else {
            strcat(binary, "0");
          }
        }
      }
      glyph = (100 * (numbuf[0] - '0')) + (10 * (numbuf[1] - '0')) + (numbuf[2] - '0');
      if (debug) {
        printf("[%d] ", glyph);
      }
      for (q = 0; q < 10; q++) {
        if (glyph & (0x200 >> q)) {
          strcat(binary, "1");
        } else {
          strcat(binary, "0");
        }
      }
      break;
    case 6:
      if (last_mode != current_mode) {
        byte_count_posn = strlen(binary);
        strcat(binary, "LLLLLLLLL");
      }
      if (byte_count == 512) {
        add_byte_count(binary, byte_count_posn, byte_count);
        strcat(binary, "0111");
        byte_count_posn = strlen(binary);
        strcat(binary, "LLLLLLLLL");
        byte_count = 0;
      }
      glyph = gbdata[sp];
      if (debug) {
        printf("[%d] ", glyph);
      }
      for (q = 0; q < 8; q++) {
        if (glyph & (0x80 >> q)) {
          strcat(binary, "1");
        } else {
          strcat(binary, "0");
        }
      }
      sp++;
      byte_count++;
      break;
    case 4:
      shift = 1;
      if ((gbdata[sp] >= '0') && (gbdata[sp] <= '9')) {
        shift = 0;
      }
      if ((gbdata[sp] >= 'A') && (gbdata[sp] <= 'Z')) {
        shift = 0;
      }
      if ((gbdata[sp] >= 'a') && (gbdata[sp] <= 'z')) {
        shift = 0;
      }
      if (gbdata[sp] == ' ') {
        shift = 0;
      }
      if (shift == 0) {
        glyph = posn("0123456789ABCDEFGHIJKLMOPRSTUVWXYZabcdefghijklmnopqrstuvwxyz ", gbdata[sp]);
        if (debug) {
          printf("[%d] ", glyph);
        }
        for (q = 0; q < 6; q++) {
          if (glyph & (0x20 >> q)) {
            strcat(binary, "1");
          } else {
            strcat(binary, "0");
          }
        }
      } else {
        strcat(binary, "1111110110");
        add_shift_char(binary, gbdata[sp]);
      }
      sp++;
      break;
    case 3:
      shift = 1;
      if ((gbdata[sp] >= 'A') && (gbdata[sp] <= 'Z')) {
        shift = 0;
      }
      if (gbdata[sp] == ' ') {
        shift = 0;
      }
      if (shift == 0) {
        glyph = posn("ABCDEFGHIJKLMNOPQRSTUVWXYZ ", gbdata[sp]);
        if (debug) {
          printf("[%d] ", glyph);
        }
        for (q = 0; q < 5; q++) {
          if (glyph & (0x10 >> q)) {
            strcat(binary, "1");
          } else {
            strcat(binary, "0");
          }
        }
      } else {
        strcat(binary, "1111101");
        add_shift_char(binary, gbdata[sp]);
      }
      sp++;
      break;
    case 2:
      shift = 1;
      if ((gbdata[sp] >= 'a') && (gbdata[sp] <= 'z')) {
        shift = 0;
      }
      if (gbdata[sp] == ' ') {
        shift = 0;
      }
      if (shift == 0) {
        glyph = posn("abcdefghijklmnopqrstuvwxyz ", gbdata[sp]);
        if (debug) {
          printf("[%d] ", glyph);
        }
        for (q = 0; q < 5; q++) {
          if (glyph & (0x10 >> q)) {
            strcat(binary, "1");
          } else {
            strcat(binary, "0");
          }
        }
      } else {
        strcat(binary, "1111101");
        add_shift_char(binary, gbdata[sp]);
      }
      sp++;
      break;
    }
    if (strlen(binary) > 9191) {
      return 5;
    }
  } while (sp < length);
  if (current_mode == 1) {
    switch (p) {
    case 1:
      binary[number_pad_posn] = '1';
      binary[number_pad_posn + 1] = '0';
      break;
    case 2:
      binary[number_pad_posn] = '0';
      binary[number_pad_posn + 1] = '1';
      break;
    case 3:
      binary[number_pad_posn] = '0';
      binary[number_pad_posn + 1] = '0';
      break;
    }
  }
  if (current_mode == 6) {
    add_byte_count(binary, byte_count_posn, byte_count);
  }
  switch (current_mode) {
  case 7:
    strcat(binary, "1111111100000");
    break;
  case 1:
    strcat(binary, "1111111010");
    break;
  case 2:
  case 3:
    strcat(binary, "11011");
    break;
  case 4:
    strcat(binary, "1111110000");
    break;
  case 6:
    strcat(binary, "0000");
    break;
  }
  p = 7 - (strlen(binary) % 7);
  if (p == 7) {
    p = 0;
  }
  for (i = 0; i < p; i++) {
    strcat(binary, "0");
  }
  if (strlen(binary) > 9191) {
    return 5;
  }
  return 0;
}
```