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

```asm
<seek_forward>:
  endbr64
  mov    %rdx,%r8
  mov    (%rdi,%rdx,4),%edx
  cmp    $0xff,%edx
  jg     L327
  push   %r15
  lea    -0x1(%rcx),%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x6,%eax
  ja     L256
  lea    D56(%rip),%rcx
  mov    (%rcx,%rax,4),%r15d
  lea    D44(%rip),%rcx
  mov    (%rcx,%rax,4),%r13d
  lea    D14(%rip),%rcx
  mov    (%rcx,%rax,4),%r12d
  lea    D25(%rip),%rcx
  mov    (%rcx,%rax,4),%ebp
  lea    D42(%rip),%rcx
  mov    (%rcx,%rax,4),%ebx
  lea    D18(%rip),%rcx
  mov    (%rcx,%rax,4),%r14d
L281:
  cmp    %rsi,%r8
  jae    L334
  mov    %r8,%r9
  add    $0x8,%r9
  jb     L334
  mov    %r8,%rax
  jmp    L262
  nopl   0x0(%rax,%rax,1)
L1:
  add    $0x11,%r15d
  add    $0x17,%r13d
  add    $0x12,%r12d
  add    $0x12,%ebp
  add    $0xd,%ebx
  mov    $0x1,%r10d
L0:
  lea    -0x41(%rdx),%ecx
  cmp    $0x19,%ecx
  ja     L366
  add    $0x8,%r15d
  add    $0x6,%r13d
  add    $0x5,%r12d
  add    $0xa,%ebp
  add    $0xd,%ebx
L261:
  add    $0x1,%rax
  cmp    %rax,%rsi
  jbe    L334
L172:
  cmp    %rax,%r9
  jb     L334
  mov    (%rdi,%rax,4),%edx
L262:
  cmp    $0xfe,%edx
  jg     L1
  lea    -0x61(%rdx),%ecx
  cmp    $0x19,%ecx
  ja     L217
  add    $0x8,%r15d
  add    $0x6,%r13d
  add    $0xa,%r12d
  add    $0x5,%ebp
  add    $0xd,%ebx
L340:
  cmp    $0x7e,%edx
  jle    L261
  add    $0x1,%rax
  add    $0x14,%r13d
  add    $0x14,%r12d
  add    $0x14,%ebp
  cmp    %rax,%rsi
  ja     L172
L334:
  lea    -0x1(%rsi),%rcx
  cmp    %rcx,%r8
  jae    L369
  mov    %r8,%r9
  add    $0x7,%r9
  jb     L369
  mov    %r8,%rax
  jmp    L360
  nopl   (%rax)
L321:
  cmp    %rcx,%rax
  jae    L120
L238:
  cmp    %rax,%r9
  jb     L120
L360:
  mov    (%rdi,%rax,4),%edx
  add    $0x1,%rax
  cmp    $0x13,%edx
  jne    L321
  cmpl   $0x10,(%rdi,%rax,4)
  jne    L321
  sub    $0xd,%ebx
  cmp    %rcx,%rax
  jb     L238
  nopl   0x0(%rax)
L120:
  mov    %r8,%rax
  mov    $0xffffffff,%r10d
  jmp    L268
  nopl   0x0(%rax,%rax,1)
L274:
  cmp    %rax,%r9
  jb     L369
L268:
  mov    %rax,%rdx
  movslq %r10d,%r11
  add    $0x1,%rax
  cmp    %rdx,%r11
  je     L186
  mov    -0x4(%rdi,%rax,4),%edx
  sub    $0x30,%edx
  cmp    $0x9,%edx
  ja     L186
  mov    (%rdi,%rax,4),%edx
  sub    $0x30,%edx
  cmp    $0x9,%edx
  ja     L186
  sub    $0xd,%ebx
  mov    %eax,%r10d
  nopl   0x0(%rax)
L186:
  cmp    %rcx,%rax
  jb     L274
L369:
  mov    %r8,%rdx
  call   <number_lat@plt>
  add    %eax,%r14d
  mov    $0x7,%eax
  cmp    %ebx,%r15d
  jg     L357
  mov    %r15d,%ebx
  mov    $0x6,%eax
L357:
  cmp    %r13d,%ebx
  jl     L72
  mov    %r13d,%ebx
  mov    $0x4,%eax
L72:
  cmp    %r12d,%ebx
  jl     L326
  mov    %r12d,%ebx
  mov    $0x3,%eax
L326:
  cmp    %ebp,%ebx
  jl     L56
  mov    %ebp,%ebx
  mov    $0x2,%eax
L56:
  cmp    %r14d,%ebx
  mov    $0x1,%edx
  cmovge %edx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L256:
  mov    $0x4,%r14d
  mov    $0x4,%ebx
  mov    $0x4,%ebp
  mov    $0x4,%r12d
  mov    $0x4,%r13d
  mov    $0x4,%r15d
  jmp    L281
  nopw   0x0(%rax,%rax,1)
L366:
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%ecx
  ja     L263
  add    $0x8,%r15d
  add    $0x6,%r13d
  add    $0x8,%r12d
  add    $0x8,%ebp
  add    $0xd,%ebx
  jmp    L261
  nop
L263:
  cmp    $0x20,%edx
  jne    L182
  add    $0x8,%r15d
  add    $0x6,%r13d
  add    $0x5,%r12d
  add    $0x5,%ebp
  add    $0xd,%ebx
  jmp    L261
  nopl   0x0(%rax)
L327:
  mov    $0x7,%eax
  ret
L217:
  xor    %r10d,%r10d
  jmp    L0
L182:
  test   %r10d,%r10d
  jne    L340
  add    $0x8,%r15d
  add    $0x10,%r13d
  add    $0xd,%r12d
  add    $0xd,%ebp
  add    $0xd,%ebx
  jmp    L340
```

tool_calls: name: unpack_data
arguments: tag: D56
datatype: string
name: unpack_data
arguments: tag: D44
datatype: string
name: unpack_data
arguments: tag: D14
datatype: string
name: unpack_data
arguments: tag: D25
datatype: string
name: unpack_data
arguments: tag: D42
datatype: string
name: unpack_data
arguments: tag: D18
datatype: string

tool: D56: 


tool: D44: 


tool: D14: 


tool: D25: 


tool: D42: 


tool: 

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;
}
```