user: Translate the below assembly code into C programming language:

```asm
<file_type>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L180
  mov    -0x18(%rbp),%rax
  lea    D47(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L82
L180:
  mov    $0x2,%eax
  jmp    L136
L82:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x2,-0x4(%rbp)
  jle    L154
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x2(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L154
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x63,%al
  je     L43
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x43,%al
  je     L43
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x68,%al
  je     L43
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x48,%al
  jne    L154
L43:
  mov    $0x1,%eax
  jmp    L136
L154:
  cmpl   $0x4,-0x4(%rbp)
  jle    L219
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L203
L219:
  mov    $0x0,%eax
  jmp    L136
L203:
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  lea    D22(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L1
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  lea    D15(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L75
L1:
  mov    $0x2,%eax
  jmp    L136
L75:
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  lea    D8(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L182
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  lea    D39(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L216
L182:
  mov    $0x3,%eax
  jmp    L136
L216:
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  lea    D21(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L137
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  lea    D28(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L158
L137:
  mov    $0x4,%eax
  jmp    L136
L158:
  mov    $0x0,%eax
L136:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D47
type: string
name: read_data
arguments: tag: D22
type: string
name: read_data
arguments: tag: D15
type: string
name: read_data
arguments: tag: D8
type: string
name: read_data
arguments: tag: D39
type: string
name: read_data
arguments: tag: D21
type: string
name: read_data
arguments: tag: D28
type: string

tool: D47: -

tool: D22: txt

tool: D15: TXT

tool: D8: fnt

tool: D39: FNT

tool: D21: bmp

tool: D28: BMP

assistant: ```c
int file_type(const char *c) {
  int n;
  if (c == NULL || strcmp(c, "-") == 0)
    return 2;
  n = (int)strlen(c);
  if (n >= 3 && c[n - 2] == '.' && (c[n - 1] == 'c' || c[n - 1] == 'C' || c[n - 1] == 'h' || c[n - 1] == 'H'))
    return 1;
  if (n < 5 || c[n - 4] != '.')
    return 0;
  if (strcmp(c + n - 3, "txt") == 0 || strcmp(c + n - 3, "TXT") == 0)
    return 2;
  if (strcmp(c + n - 3, "fnt") == 0 || strcmp(c + n - 3, "FNT") == 0)
    return 3;
  if (strcmp(c + n - 3, "bmp") == 0 || strcmp(c + n - 3, "BMP") == 0)
    return 4;
  return 0;
}
```