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

```asm
<check_valid>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L139
  mov    -0x10(%rbp),%rax
  mov    $0x5,%esi
  mov    %rax,%rdi
  call   <is_length_valid@plt>
  test   %eax,%eax
  jne    L139
  mov    -0x10(%rbp),%rax
  mov    $0x6,%esi
  mov    %rax,%rdi
  call   <is_length_valid@plt>
  test   %eax,%eax
  jne    L139
  mov    -0x10(%rbp),%rax
  mov    $0x9,%esi
  mov    %rax,%rdi
  call   <is_length_valid@plt>
  test   %eax,%eax
  jne    L139
  mov    -0x10(%rbp),%rax
  mov    $0xb,%esi
  mov    %rax,%rdi
  call   <is_length_valid@plt>
  test   %eax,%eax
  jne    L139
  mov    $0x0,%eax
  jmp    L200
L139:
  mov    -0x8(%rbp),%rax
  lea    D10(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L78
  mov    -0x10(%rbp),%rax
  mov    $0x5,%esi
  mov    %rax,%rdi
  call   <is_length_valid@plt>
  test   %eax,%eax
  jne    L78
  mov    $0x0,%eax
  jmp    L200
L78:
  mov    -0x8(%rbp),%rax
  lea    D41(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L110
  mov    -0x10(%rbp),%rax
  mov    $0x6,%esi
  mov    %rax,%rdi
  call   <is_length_valid@plt>
  test   %eax,%eax
  jne    L110
  mov    $0x0,%eax
  jmp    L200
L110:
  mov    -0x8(%rbp),%rax
  lea    D51(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L96
  mov    -0x10(%rbp),%rax
  mov    $0x9,%esi
  mov    %rax,%rdi
  call   <is_length_valid@plt>
  test   %eax,%eax
  jne    L96
  mov    $0x0,%eax
  jmp    L200
L96:
  mov    -0x8(%rbp),%rax
  lea    D40(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L31
  mov    -0x10(%rbp),%rax
  mov    $0xb,%esi
  mov    %rax,%rdi
  call   <is_length_valid@plt>
  test   %eax,%eax
  jne    L31
  mov    $0x0,%eax
  jmp    L200
L31:
  mov    -0x8(%rbp),%rax
  lea    D54(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L189
  mov    -0x10(%rbp),%rax
  mov    $0x8,%esi
  mov    %rax,%rdi
  call   <is_length_valid@plt>
  test   %eax,%eax
  jne    L189
  mov    $0x0,%eax
  jmp    L200
L189:
  mov    $0x1,%eax
L200:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D6
type: string
name: extract_symbolic_data
arguments: tag: D10
type: string
name: extract_symbolic_data
arguments: tag: D41
type: string
name: extract_symbolic_data
arguments: tag: D51
type: string
name: extract_symbolic_data
arguments: tag: D40
type: string
name: extract_symbolic_data
arguments: tag: D54
type: string

tool: D6: POSTNET

tool: D10: POSTNET-5

tool: D41: POSTNET-6

tool: D51: POSTNET-9

tool: D40: POSTNET-11

tool: D54: CEPNET

assistant: ```c
int check_valid(const char *type, const char *code) {
  if ((strcasecmp(type, "POSTNET") == 0))
    if (!is_length_valid(code, 5) && !is_length_valid(code, 6) && !is_length_valid(code, 9) && !is_length_valid(code, 11))
      return 0;
  if ((strcasecmp(type, "POSTNET-5") == 0))
    if (!is_length_valid(code, 5))
      return 0;
  if ((strcasecmp(type, "POSTNET-6") == 0))
    if (!is_length_valid(code, 6))
      return 0;
  if ((strcasecmp(type, "POSTNET-9") == 0))
    if (!is_length_valid(code, 9))
      return 0;
  if ((strcasecmp(type, "POSTNET-11") == 0))
    if (!is_length_valid(code, 11))
      return 0;
  if ((strcasecmp(type, "CEPNET") == 0))
    if (!is_length_valid(code, 8))
      return 0;
  return 1;
}
```