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

```asm
<lookup>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%rax
  mov    %rax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  mov    %rax,%r14
  mov    $0x0,%r15d
  mov    %rax,%r12
  mov    $0x0,%r13d
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%ecx
  mov    $0x0,%edx
  div    %rcx
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L149:
  cmp    %rdx,%rsp
  je     L189
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L149
L189:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L134
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L134:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x40(%rbp)
  movl   $0x0,-0x50(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4c(%rbp)
  jmp    L14
L184:
  mov    -0x50(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    -0x40(%rbp),%rcx
  mov    -0x50(%rbp),%edx
  movslq %edx,%rdx
  mov    %al,(%rcx,%rdx,1)
  addl   $0x1,-0x50(%rbp)
L14:
  mov    -0x50(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L184
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x40(%rbp),%rdx
  movb   $0x0,(%rdx,%rax,1)
  mov    -0x40(%rbp),%rax
  lea    D136(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L102
  lea    D6(%rip),%rax
  jmp    L0
L102:
  mov    -0x40(%rbp),%rax
  lea    D110(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L84
  lea    D13(%rip),%rax
  jmp    L0
L84:
  mov    -0x40(%rbp),%rax
  lea    D44(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L35
  lea    D97(%rip),%rax
  jmp    L0
L35:
  mov    -0x40(%rbp),%rax
  lea    D132(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L193
  lea    D120(%rip),%rax
  jmp    L0
L193:
  mov    -0x40(%rbp),%rax
  lea    D55(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L131
  lea    D47(%rip),%rax
  jmp    L0
L131:
  mov    -0x40(%rbp),%rax
  lea    D39(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L10
  lea    D53(%rip),%rax
  jmp    L0
L10:
  mov    -0x40(%rbp),%rax
  lea    D100(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L158
  lea    D109(%rip),%rax
  jmp    L0
L158:
  mov    $0x0,%eax
L0:
  mov    %rbx,%rsp
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L30
  call   <__stack_chk_fail@plt>
L30:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D136
datatype: string
name: unpack_data
arguments: data_label: D6
datatype: string
name: unpack_data
arguments: data_label: D110
datatype: string
name: unpack_data
arguments: data_label: D13
datatype: string
name: unpack_data
arguments: data_label: D44
datatype: string
name: unpack_data
arguments: data_label: D97
datatype: string
name: unpack_data
arguments: data_label: D132
datatype: string
name: unpack_data
arguments: data_label: D120
datatype: string
name: unpack_data
arguments: data_label: D55
datatype: string
name: unpack_data
arguments: data_label: D47
datatype: string
name: unpack_data
arguments: data_label: D39
datatype: string
name: unpack_data
arguments: data_label: D53
datatype: string
name: unpack_data
arguments: data_label: D100
datatype: string
name: unpack_data
arguments: data_label: D109
datatype: string

tool: D136: css

tool: D6: text/css

tool: D110: html

tool: D13: text/html

tool: D44: js

tool: D97: text/javascript

tool: D132: gif

tool: D120: image/gif

tool: D55: ico

tool: D47: image/x-icon

tool: D39: jpg

tool: D53: image/jpg

tool: D100: png

tool: D109: image/png

assistant: ```c
const char *lookup(const char *extension) {
  char ext[strlen(extension) + 1];
  for (int i = 0, extlen = strlen(extension); i < extlen; i++)
    ext[i] = tolower(extension[i]);
  ext[strlen(extension)] = '\0';
  if (strcmp(ext, "css") == 0)
    return "text/css";
  else if (strcmp(ext, "html") == 0)
    return "text/html";
  else if (strcmp(ext, "js") == 0)
    return "text/javascript";
  else if (strcmp(ext, "gif") == 0)
    return "image/gif";
  else if (strcmp(ext, "ico") == 0)
    return "image/x-icon";
  else if (strcmp(ext, "jpg") == 0)
    return "image/jpg";
  else if (strcmp(ext, "png") == 0)
    return "image/png";
  else
    return NULL;
}
```