user: Please show me the C implementation that matches the assembly code listed below:

```asm
<flag_table_3_4_location>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    0x18(%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <code_table_3_1@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x9cae,-0x10(%rbp)
  je     L31
  cmpl   $0x9cae,-0x10(%rbp)
  jg     L159
  cmpl   $0x8001,-0x10(%rbp)
  je     L99
  cmpl   $0x8001,-0x10(%rbp)
  jg     L159
  cmpl   $0x8000,-0x10(%rbp)
  je     L202
  cmpl   $0x8000,-0x10(%rbp)
  jg     L159
  cmpl   $0x3e8,-0x10(%rbp)
  je     L268
  cmpl   $0x3e8,-0x10(%rbp)
  jg     L159
  cmpl   $0xcc,-0x10(%rbp)
  je     L77
  cmpl   $0xcc,-0x10(%rbp)
  jg     L159
  cmpl   $0xbe,-0x10(%rbp)
  je     L130
  cmpl   $0xbe,-0x10(%rbp)
  jg     L159
  cmpl   $0x78,-0x10(%rbp)
  jg     L310
  cmpl   $0x0,-0x10(%rbp)
  js     L159
  cmpl   $0x78,-0x10(%rbp)
  ja     L159
  mov    -0x10(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D13(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D13(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L310:
  cmpl   $0x8c,-0x10(%rbp)
  je     L333
  jmp    L159
  mov    -0x8(%rbp),%rax
  add    $0x47,%rax
  jmp    L231
  mov    -0x8(%rbp),%rax
  add    $0x2f,%rax
  jmp    L231
  mov    -0x8(%rbp),%rax
  add    $0x3b,%rax
  jmp    L231
  mov    -0x8(%rbp),%rax
  add    $0x40,%rax
  jmp    L231
  mov    -0x8(%rbp),%rax
  add    $0x40,%rax
  jmp    L231
  mov    $0x0,%eax
  jmp    L231
L333:
  mov    -0x8(%rbp),%rax
  add    $0x3f,%rax
  jmp    L231
  mov    -0x8(%rbp),%rax
  add    $0x38,%rax
  jmp    L231
L130:
  mov    -0x8(%rbp),%rax
  add    $0x26,%rax
  jmp    L231
L77:
  mov    -0x8(%rbp),%rax
  add    $0x47,%rax
  jmp    L231
L268:
  mov    -0x8(%rbp),%rax
  add    $0x32,%rax
  jmp    L231
L202:
  cmpl   $0x7,-0xc(%rbp)
  jne    L329
  mov    -0x8(%rbp),%rax
  add    $0x47,%rax
  jmp    L231
L329:
  mov    $0x0,%eax
  jmp    L231
L99:
  cmpl   $0x7,-0xc(%rbp)
  jne    L118
  mov    -0x8(%rbp),%rax
  add    $0x47,%rax
  jmp    L231
L118:
  mov    $0x0,%eax
  jmp    L231
L31:
  cmpl   $0x22,-0xc(%rbp)
  je     L341
  cmpl   $0x23,-0xc(%rbp)
  jne    L175
L341:
  mov    -0x8(%rbp),%rax
  add    $0x38,%rax
  jmp    L231
L175:
  mov    $0x0,%eax
  jmp    L231
L159:
  nop
  mov    $0x0,%eax
L231:
  leave
  ret
```

assistant: ```c
unsigned char *flag_table_3_4_location(unsigned char **sec) {
  int grid_template, center;
  unsigned char *gds;
  gds = sec[3];
  grid_template = code_table_3_1(sec);
  center = ((int)((sec[1][5] << 8) + (sec[1][6])));
  switch (grid_template) {
  case 0:
  case 1:
  case 2:
  case 3:
  case 40:
  case 41:
  case 42:
  case 43:
    return gds + 71;
    break;
  case 4:
  case 5:
    return gds + 47;
    break;
  case 10:
  case 12:
    return gds + 59;
    break;
  case 20:
    return gds + 64;
    break;
  case 30:
  case 31:
    return gds + 64;
    break;
  case 50:
  case 51:
  case 52:
  case 53:
    return NULL;
    break;
  case 90:
  case 140:
    return gds + 63;
    break;
  case 110:
    return gds + 56;
    break;
  case 190:
  case 120:
    return gds + 38;
    break;
  case 204:
    return gds + 71;
    break;
  case 1000:
    return gds + 50;
    break;
  case 32768:
    if (center == 7)
      return gds + 71;
    return NULL;
    break;
  case 32769:
    if (center == 7)
      return gds + 71;
    return NULL;
    break;
  case 40110:
    if ((center == 34) || (center == 35))
      return gds + 56;
    return NULL;
    break;
  default:
    break;
  }
  return NULL;
}
```