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

```asm
<seek_forward>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %ecx,-0x5c(%rbp)
  movl   $0xffffffff,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x58(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0xff,%eax
  jle    L296
  mov    $0x7,%eax
  jmp    L197
L296:
  cmpl   $0x7,-0x5c(%rbp)
  ja     L253
  mov    -0x5c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D21(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D21(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  movl   $0xd,-0x34(%rbp)
  movl   $0xd,-0x30(%rbp)
  movl   $0xd,-0x2c(%rbp)
  movl   $0xd,-0x28(%rbp)
  movl   $0xd,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L43
  movl   $0x0,-0x34(%rbp)
  movl   $0xa,-0x30(%rbp)
  movl   $0xa,-0x2c(%rbp)
  movl   $0xa,-0x28(%rbp)
  movl   $0xa,-0x24(%rbp)
  movl   $0xa,-0x20(%rbp)
  jmp    L43
  movl   $0x5,-0x34(%rbp)
  movl   $0x7,-0x30(%rbp)
  movl   $0x7,-0x2c(%rbp)
  movl   $0x5,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x5,-0x20(%rbp)
  jmp    L43
  movl   $0x5,-0x34(%rbp)
  movl   $0x7,-0x30(%rbp)
  movl   $0x7,-0x2c(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x5,-0x24(%rbp)
  movl   $0x5,-0x20(%rbp)
  jmp    L43
  movl   $0xa,-0x34(%rbp)
  movl   $0xa,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  movl   $0xa,-0x28(%rbp)
  movl   $0xa,-0x24(%rbp)
  movl   $0xa,-0x20(%rbp)
  jmp    L43
  movl   $0x4,-0x34(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x4,-0x2c(%rbp)
  movl   $0x4,-0x28(%rbp)
  movl   $0x4,-0x24(%rbp)
  movl   $0x4,-0x20(%rbp)
  jmp    L43
L253:
  movl   $0x4,-0x34(%rbp)
  movl   $0x4,-0x30(%rbp)
  movl   $0x4,-0x2c(%rbp)
  movl   $0x4,-0x28(%rbp)
  movl   $0x4,-0x24(%rbp)
  movl   $0x4,-0x20(%rbp)
L43:
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L172
L63:
  movl   $0x0,-0x18(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0xfe,%eax
  jle    L387
  addl   $0x11,-0x30(%rbp)
  addl   $0x17,-0x2c(%rbp)
  addl   $0x12,-0x28(%rbp)
  addl   $0x12,-0x24(%rbp)
  addl   $0xd,-0x20(%rbp)
  movl   $0x1,-0x18(%rbp)
L387:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x60,%eax
  jle    L255
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x7a,%eax
  jg     L255
  addl   $0x8,-0x30(%rbp)
  addl   $0x6,-0x2c(%rbp)
  addl   $0xa,-0x28(%rbp)
  addl   $0x5,-0x24(%rbp)
  addl   $0xd,-0x20(%rbp)
  movl   $0x1,-0x18(%rbp)
L255:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x40,%eax
  jle    L306
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x5a,%eax
  jg     L306
  addl   $0x8,-0x30(%rbp)
  addl   $0x6,-0x2c(%rbp)
  addl   $0x5,-0x28(%rbp)
  addl   $0xa,-0x24(%rbp)
  addl   $0xd,-0x20(%rbp)
  movl   $0x1,-0x18(%rbp)
L306:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x2f,%eax
  jle    L161
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x39,%eax
  jg     L161
  addl   $0x8,-0x30(%rbp)
  addl   $0x6,-0x2c(%rbp)
  addl   $0x8,-0x28(%rbp)
  addl   $0x8,-0x24(%rbp)
  addl   $0xd,-0x20(%rbp)
  movl   $0x1,-0x18(%rbp)
L161:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x20,%eax
  jne    L163
  addl   $0x8,-0x30(%rbp)
  addl   $0x6,-0x2c(%rbp)
  addl   $0x5,-0x28(%rbp)
  addl   $0x5,-0x24(%rbp)
  addl   $0xd,-0x20(%rbp)
  movl   $0x1,-0x18(%rbp)
L163:
  cmpl   $0x0,-0x18(%rbp)
  jne    L96
  addl   $0x8,-0x30(%rbp)
  addl   $0x10,-0x2c(%rbp)
  addl   $0xd,-0x28(%rbp)
  addl   $0xd,-0x24(%rbp)
  addl   $0xd,-0x20(%rbp)
L96:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x7e,%eax
  jle    L184
  addl   $0x14,-0x2c(%rbp)
  addl   $0x14,-0x28(%rbp)
  addl   $0x14,-0x24(%rbp)
L184:
  addq   $0x1,-0x8(%rbp)
L172:
  mov    -0x8(%rbp),%rax
  cmp    -0x50(%rbp),%rax
  jae    L112
  mov    -0x58(%rbp),%rax
  add    $0x8,%rax
  cmp    %rax,-0x8(%rbp)
  jbe    L63
L112:
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L36
L360:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x13,%eax
  jne    L131
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x10,%eax
  jne    L131
  subl   $0xd,-0x20(%rbp)
L131:
  addq   $0x1,-0x8(%rbp)
L36:
  mov    -0x50(%rbp),%rax
  sub    $0x1,%rax
  cmp    %rax,-0x8(%rbp)
  jae    L404
  mov    -0x58(%rbp),%rax
  add    $0x7,%rax
  cmp    %rax,-0x8(%rbp)
  jbe    L360
L404:
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L75
L354:
  mov    -0x10(%rbp),%eax
  cltq
  cmp    %rax,-0x8(%rbp)
  je     L275
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x2f,%eax
  jle    L275
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x39,%eax
  jg     L275
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x2f,%eax
  jle    L275
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x39,%eax
  jg     L275
  subl   $0xd,-0x20(%rbp)
  mov    -0x8(%rbp),%rax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
L275:
  addq   $0x1,-0x8(%rbp)
L75:
  mov    -0x50(%rbp),%rax
  sub    $0x1,%rax
  cmp    %rax,-0x8(%rbp)
  jae    L243
  mov    -0x58(%rbp),%rax
  add    $0x7,%rax
  cmp    %rax,-0x8(%rbp)
  jbe    L354
L243:
  mov    -0x58(%rbp),%rdx
  mov    -0x50(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <number_lat@plt>
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x34(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  je     L390
  mov    -0x24(%rbp),%r8d
  mov    -0x28(%rbp),%edi
  mov    -0x2c(%rbp),%ecx
  mov    -0x30(%rbp),%edx
  mov    -0x20(%rbp),%eax
  sub    $0x8,%rsp
  mov    -0x34(%rbp),%esi
  push   %rsi
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  add    $0x10,%rsp
L390:
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x7,-0x1c(%rbp)
  mov    -0x30(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jg     L344
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x6,-0x1c(%rbp)
L344:
  mov    -0x2c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jg     L330
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x4,-0x1c(%rbp)
L330:
  mov    -0x28(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jg     L244
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x3,-0x1c(%rbp)
L244:
  mov    -0x24(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jg     L189
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x2,-0x1c(%rbp)
L189:
  mov    -0x34(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jg     L338
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x1,-0x1c(%rbp)
L338:
  mov    -0x1c(%rbp),%eax
L197:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D2
type_infered: string

tool: D2: C %d / B %d / M %d / U %d / L %d / N %d


assistant: ```c
int seek_forward(int gbdata[], const size_t length, const size_t position, int current_mode) {
  int number_count, byte_count, mixed_count, upper_count, lower_count, chinese_count;
  int best_mode, done;
  size_t sp;
  int best_count, last = -1;
  int debug = 0;
  if (gbdata[position] > 0xff) {
    return 7;
  }
  switch (current_mode) {
  case 7:
    number_count = 13;
    byte_count = 13;
    mixed_count = 13;
    upper_count = 13;
    lower_count = 13;
    chinese_count = 0;
    break;
  case 1:
    number_count = 0;
    byte_count = 10;
    mixed_count = 10;
    upper_count = 10;
    lower_count = 10;
    chinese_count = 10;
    break;
  case 2:
    number_count = 5;
    byte_count = 7;
    mixed_count = 7;
    upper_count = 5;
    lower_count = 0;
    chinese_count = 5;
    break;
  case 3:
    number_count = 5;
    byte_count = 7;
    mixed_count = 7;
    upper_count = 0;
    lower_count = 5;
    chinese_count = 5;
    break;
  case 4:
    number_count = 10;
    byte_count = 10;
    mixed_count = 0;
    upper_count = 10;
    lower_count = 10;
    chinese_count = 10;
    break;
  case 6:
    number_count = 4;
    byte_count = 0;
    mixed_count = 4;
    upper_count = 4;
    lower_count = 4;
    chinese_count = 4;
    break;
  default:
    number_count = 4;
    byte_count = 4;
    mixed_count = 4;
    upper_count = 4;
    lower_count = 4;
    chinese_count = 4;
  }
  for (sp = position; (sp < length) && (sp <= (position + 8)); sp++) {
    done = 0;
    if (gbdata[sp] >= 0xff) {
      byte_count += 17;
      mixed_count += 23;
      upper_count += 18;
      lower_count += 18;
      chinese_count += 13;
      done = 1;
    }
    if ((gbdata[sp] >= 'a') && (gbdata[sp] <= 'z')) {
      byte_count += 8;
      mixed_count += 6;
      upper_count += 10;
      lower_count += 5;
      chinese_count += 13;
      done = 1;
    }
    if ((gbdata[sp] >= 'A') && (gbdata[sp] <= 'Z')) {
      byte_count += 8;
      mixed_count += 6;
      upper_count += 5;
      lower_count += 10;
      chinese_count += 13;
      done = 1;
    }
    if ((gbdata[sp] >= '0') && (gbdata[sp] <= '9')) {
      byte_count += 8;
      mixed_count += 6;
      upper_count += 8;
      lower_count += 8;
      chinese_count += 13;
      done = 1;
    }
    if (gbdata[sp] == ' ') {
      byte_count += 8;
      mixed_count += 6;
      upper_count += 5;
      lower_count += 5;
      chinese_count += 13;
      done = 1;
    }
    if (done == 0) {
      byte_count += 8;
      mixed_count += 16;
      upper_count += 13;
      lower_count += 13;
      chinese_count += 13;
    }
    if (gbdata[sp] >= 0x7f) {
      mixed_count += 20;
      upper_count += 20;
      lower_count += 20;
    }
  }
  for (sp = position; (sp < (length - 1)) && (sp <= (position + 7)); sp++) {
    if ((gbdata[sp] == 0x13) && (gbdata[sp + 1] == 0x10)) {
      chinese_count -= 13;
    }
  }
  for (sp = position; (sp < (length - 1)) && (sp <= (position + 7)); sp++) {
    if (sp != last) {
      if (((gbdata[sp] >= '0') && (gbdata[sp] <= '9')) && ((gbdata[sp + 1] >= '0') && (gbdata[sp + 1] <= '9'))) {
        chinese_count -= 13;
        last = (int)(sp + 1);
      }
    }
  }
  number_count += number_lat(gbdata, length, position);
  if (debug) {
    printf("C %d / B %d / M %d / U %d / L %d / N %d\n", chinese_count, byte_count, mixed_count, upper_count, lower_count, number_count);
  }
  best_count = chinese_count;
  best_mode = 7;
  if (byte_count <= best_count) {
    best_count = byte_count;
    best_mode = 6;
  }
  if (mixed_count <= best_count) {
    best_count = mixed_count;
    best_mode = 4;
  }
  if (upper_count <= best_count) {
    best_count = upper_count;
    best_mode = 3;
  }
  if (lower_count <= best_count) {
    best_count = lower_count;
    best_mode = 2;
  }
  if (number_count <= best_count) {
    best_count = number_count;
    best_mode = 1;
  }
  return best_mode;
}
```