user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<game_parse_sgf>:
  endbr64
  push   %r15
  xor    %eax,%eax
  movabs $0xf7fffffeffffd9ff,%r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  mov    %ax,(%rsi)
  mov    D7(%rip),%r12
  movb   $0x0,0x2(%rsi)
  movb   $0x0,(%rdx)
  jmp    L65
  nopl   0x0(%rax)
L196:
  cmp    $0x5b,%eax
  je     L52
  lea    -0x41(%rax),%edx
  cmp    $0x19,%edx
  ja     L134
  movslq %ebx,%rdx
  add    $0x1,%ebx
  mov    %al,0x0(%r13,%rdx,1)
L245:
  cmp    $0x3,%ebx
  je     L186
L65:
  mov    %rbp,%rdi
  call   <fgetc@plt>
  cmp    %eax,(%r12)
  je     L95
  cmp    $0x3b,%eax
  ja     L196
  bt     %rax,%r15
  jae    L245
L134:
  test   %ebx,%ebx
  jne    L95
  lea    -0x28(%rax),%edx
  cmp    $0x1,%edx
  jbe    L121
  nopw   0x0(%rax,%rax,1)
L95:
  xor    %eax,%eax
L150:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L186:
  cmp    $0x5b,%eax
  jne    L95
  mov    $0x3,%ebx
L218:
  movb   $0x0,0x0(%r13,%rbx,1)
  xor    %r13d,%r13d
  jmp    L42
  nopl   (%rax)
L161:
  mov    %al,(%r14,%r13,1)
  add    $0x1,%r13
  cmp    $0x3e8,%r13
  je     L135
L42:
  mov    %rbp,%rdi
  movslq %r13d,%rbx
  call   <fgetc@plt>
  cmp    %eax,(%r12)
  je     L95
  cmp    $0x5d,%eax
  je     L243
  cmp    $0x5c,%eax
  jne    L161
  mov    %rbp,%rdi
  call   <fgetc@plt>
  cmp    %eax,(%r12)
  jne    L161
  jmp    L95
L184:
  mov    %rbp,%rdi
  call   <fgetc@plt>
  cmp    %eax,(%r12)
  je     L95
  nopw   0x0(%rax,%rax,1)
L257:
  cmp    $0x5d,%eax
  je     L206
L135:
  mov    %rbp,%rdi
  call   <fgetc@plt>
  cmp    %eax,(%r12)
  je     L95
  cmp    $0x5c,%eax
  jne    L257
  jmp    L184
L52:
  movslq %ebx,%rbx
  jmp    L218
L121:
  mov    %al,0x0(%r13)
  mov    $0x1,%eax
  movb   $0x0,0x1(%r13)
  jmp    L150
L243:
  movb   $0x0,(%r14,%rbx,1)
  mov    $0x1,%eax
  jmp    L150
L206:
  mov    $0x1,%eax
  jmp    L150
```

assistant: ```c
int game_parse_sgf(FILE *f, char *tag, char *value) {
  int i, c = '\0';
  tag[0] = tag[1] = tag[2] = '\0';
  value[0] = '\0';
  for (i = 0; i < 3; i++) {
    c = fgetc(f);
    if (c == EOF)
      return 0;
    else if (c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == ';') {
      i--;
      continue;
    } else if (c == '[')
      break;
    else if ('A' <= c && c <= 'Z')
      tag[i] = (char)c;
    else if (i == 0 && (c == '(' || c == ')')) {
      tag[0] = (char)c;
      tag[1] = '\0';
      return 1;
    } else
      return 0;
  }
  if (c != '[')
    return 0;
  tag[i] = '\0';
  for (i = 0; i < 1000; i++) {
    c = fgetc(f);
    if (c == EOF)
      return 0;
    if (c == ']')
      break;
    if (c == '\\') {
      c = fgetc(f);
      if (c == EOF)
        return 0;
    }
    value[i] = (char)c;
  }
  if (i < 1000) {
    if (c != ']')
      return 0;
    value[i] = '\0';
  } else {
    for (i = 0;; i++) {
      c = fgetc(f);
      if (c == EOF)
        return 0;
      if (c == '\\') {
        c = fgetc(f);
        if (c == EOF)
          return 0;
      }
      if (c == ']')
        break;
    }
  }
  return 1;
}
```