user: What would the C source look like for the assembly code provided here:

```asm
<seek_forward>:
  endbr64
  mov    $0x7,%eax
  cmpl   $0xff,(%rdi,%rdx,4)
  jg     L287
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdx,%r8
  cmp    $0x7,%ecx
  ja     L40
  mov    %ecx,%ecx
  lea    D0(%rip),%rdx
  movslq (%rdx,%rcx,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0xa,%ebx
  mov    $0xa,%ebp
  mov    $0xa,%r12d
  mov    $0xa,%r13d
  mov    $0xa,%r14d
  mov    $0x0,%r15d
  jmp    L66
  mov    $0x5,%ebx
  mov    $0x0,%ebp
  mov    $0x5,%r12d
  mov    $0x7,%r13d
  mov    $0x7,%r14d
  mov    $0x5,%r15d
  jmp    L66
  mov    $0x5,%ebx
  mov    $0x5,%ebp
  mov    $0x0,%r12d
  mov    $0x7,%r13d
  mov    $0x7,%r14d
  mov    $0x5,%r15d
  jmp    L66
  mov    $0xa,%ebx
  mov    $0xa,%ebp
  mov    $0xa,%r12d
  mov    $0x0,%r13d
  mov    $0xa,%r14d
  mov    $0xa,%r15d
  jmp    L66
  mov    $0x4,%ebx
  mov    $0x4,%ebp
  mov    $0x4,%r12d
  mov    $0x4,%r13d
  mov    $0x0,%r14d
  mov    $0x4,%r15d
  jmp    L66
L40:
  mov    $0x4,%ebx
  mov    $0x4,%ebp
  mov    $0x4,%r12d
  mov    $0x4,%r13d
  mov    $0x4,%r14d
  mov    $0x4,%r15d
  jmp    L66
  mov    $0x0,%ebx
  mov    $0xd,%ebp
  mov    $0xd,%r12d
  mov    $0xd,%r13d
  mov    $0xd,%r14d
  mov    $0xd,%r15d
L66:
  cmp    %rsi,%r8
  jae    L426
  lea    0x8(%r8),%r11
  cmp    $0xfffffffffffffff8,%r8
  jae    L426
  mov    %r8,%rdx
  mov    $0x1,%r10d
  jmp    L49
L38:
  mov    %eax,%ecx
  lea    -0x61(%rax),%r9d
  cmp    $0x19,%r9d
  ja     L352
  add    $0x8,%r14d
  add    $0x6,%r13d
  add    $0xa,%r12d
  add    $0x5,%ebp
  add    $0xd,%ebx
  mov    %r10d,%r9d
L279:
  cmp    $0x20,%eax
  je     L267
  test   %r9d,%r9d
  jne    L31
  add    $0x8,%r14d
  add    $0x10,%r13d
  add    $0xd,%r12d
  add    $0xd,%ebp
  add    $0xd,%ebx
L31:
  cmp    $0x7e,%eax
  jle    L235
  add    $0x14,%r13d
  add    $0x14,%r12d
  add    $0x14,%ebp
L235:
  add    $0x1,%rdx
  cmp    %rdx,%rsi
  jbe    L426
  cmp    %r11,%rdx
  ja     L426
L49:
  mov    (%rdi,%rdx,4),%eax
  cmp    $0xfe,%eax
  jle    L38
  add    $0x11,%r14d
  add    $0x17,%r13d
  add    $0x12,%r12d
  add    $0x12,%ebp
  add    $0xd,%ebx
  mov    %eax,%ecx
  mov    %r10d,%r9d
L134:
  sub    $0x30,%ecx
  cmp    $0x9,%ecx
  ja     L279
  add    $0x8,%r14d
  add    $0x6,%r13d
  add    $0x8,%r12d
  add    $0x8,%ebp
  add    $0xd,%ebx
  jmp    L31
L352:
  lea    -0x41(%rax),%r9d
  cmp    $0x19,%r9d
  ja     L4
  add    $0x8,%r14d
  add    $0x6,%r13d
  add    $0x5,%r12d
  add    $0xa,%ebp
  add    $0xd,%ebx
  cmp    $0x20,%eax
  jne    L31
L267:
  add    $0x8,%r14d
  add    $0x6,%r13d
  add    $0x5,%r12d
  add    $0x5,%ebp
  add    $0xd,%ebx
  jmp    L235
L4:
  mov    $0x0,%r9d
  jmp    L134
L426:
  lea    -0x1(%rsi),%rcx
  cmp    %rcx,%r8
  jae    L106
  lea    0x7(%r8),%r9
  mov    %r8,%rax
  cmp    $0xfffffffffffffff9,%r8
  jb     L277
L106:
  mov    %r8,%rdx
  call   <number_lat@plt>
  add    %eax,%r15d
  mov    $0x7,%eax
  cmp    %ebx,%r14d
  jg     L1
  mov    %r14d,%ebx
  mov    $0x6,%eax
L1:
  cmp    %r13d,%ebx
  jl     L378
  mov    %r13d,%ebx
  mov    $0x4,%eax
L378:
  cmp    %r12d,%ebx
  jl     L242
  mov    %r12d,%ebx
  mov    $0x3,%eax
L242:
  cmp    %ebp,%ebx
  jl     L248
  mov    %ebp,%ebx
  mov    $0x2,%eax
L248:
  cmp    %r15d,%ebx
  mov    $0x1,%edx
  cmovge %edx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L370:
  add    $0x1,%rax
  cmp    %rcx,%rax
  jae    L395
  cmp    %r9,%rax
  ja     L249
L277:
  cmpl   $0x13,(%rdi,%rax,4)
  jne    L370
  cmpl   $0x10,0x4(%rdi,%rax,4)
  jne    L370
  sub    $0xd,%ebx
  jmp    L370
L249:
  mov    %r8,%rax
  mov    $0xffffffff,%r10d
  jmp    L195
L395:
  mov    %r8,%rax
  mov    $0xffffffff,%r10d
  jmp    L195
L128:
  add    $0x1,%rax
  cmp    %rcx,%rax
  jae    L106
  cmp    %r9,%rax
  ja     L106
L195:
  movslq %r10d,%rdx
  cmp    %rax,%rdx
  je     L128
  mov    (%rdi,%rax,4),%edx
  sub    $0x30,%edx
  cmp    $0x9,%edx
  ja     L128
  mov    0x4(%rdi,%rax,4),%edx
  sub    $0x30,%edx
  cmp    $0x9,%edx
  ja     L128
  sub    $0xd,%ebx
  lea    0x1(%rax),%r10d
  jmp    L128
L287:
  ret
```

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;
  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++) {
    int 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;
}
```