user: What would the C source look like for the assembly code provided here:

```asm
<get_link_category>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%r12
  mov    %edx,%ebp
  test   %rdi,%rdi
  je     L152
  mov    %rdi,%rbx
  lea    D56(%rip),%rsi
  call   <strstr@plt>
  test   %rax,%rax
  je     L18
  lea    D33(%rip),%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    $0x0,%eax
L60:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L152:
  lea    D151(%rip),%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    $0xffffffff,%eax
  jmp    L60
L18:
  lea    D110(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L84
  lea    D65(%rip),%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    $0x0,%eax
  jmp    L60
L84:
  lea    D37(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L159
  lea    D151(%rip),%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    $0x0,%eax
  jmp    L60
L159:
  lea    D60(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L133
  lea    D109(%rip),%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    $0x0,%eax
  jmp    L60
L133:
  lea    D67(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L8
  lea    D137(%rip),%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    $0x0,%eax
  jmp    L60
L8:
  lea    D161(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L56
  lea    D85(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L163
L56:
  lea    D70(%rip),%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    $0x0,%eax
  jmp    L60
L163:
  lea    D94(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L106
  lea    D134(%rip),%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    $0x0,%eax
  jmp    L60
L106:
  lea    D151(%rip),%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    $0x0,%eax
  jmp    L60
```

tool_calls: name: disassemble_data
arguments: tag: D56
type: string
name: disassemble_data
arguments: tag: D33
type: string
name: disassemble_data
arguments: tag: D151
type: string
name: disassemble_data
arguments: tag: D110
type: string
name: disassemble_data
arguments: tag: D65
type: string
name: disassemble_data
arguments: tag: D37
type: string
name: disassemble_data
arguments: tag: D60
type: string
name: disassemble_data
arguments: tag: D109
type: string
name: disassemble_data
arguments: tag: D67
type: string
name: disassemble_data
arguments: tag: D137
type: string
name: disassemble_data
arguments: tag: D161
type: string
name: disassemble_data
arguments: tag: D85
type: string
name: disassemble_data
arguments: tag: D70
type: string
name: disassemble_data
arguments: tag: D94
type: string
name: disassemble_data
arguments: tag: D134
type: string

tool: D56: .rm

tool: D33: rm

tool: D151: mp3

tool: D110: .ram

tool: D65: ram

tool: D37: .mp3

tool: D60: .wma

tool: D109: wma

tool: D67: .asf

tool: D137: asf

tool: D161: .swf

tool: D85: .flash

tool: D70: swf

tool: D94: .rtsp

tool: D134: rtsp

assistant: ```c
int get_link_category(const char *link, char *type, int size) {
  if (NULL == link) {
    snprintf(type, size, "mp3");
    return -1;
  }
  if (strstr(link, ".rm")) {
    snprintf(type, size, "rm");
  } else if (strstr(link, ".ram")) {
    snprintf(type, size, "ram");
  } else if (strstr(link, ".mp3")) {
    snprintf(type, size, "mp3");
  } else if (strstr(link, ".wma")) {
    snprintf(type, size, "wma");
  } else if (strstr(link, ".asf")) {
    snprintf(type, size, "asf");
  } else if (strstr(link, ".swf") || strstr(link, ".flash")) {
    snprintf(type, size, "swf");
  } else if (strstr(link, ".rtsp")) {
    snprintf(type, size, "rtsp");
  } else {
    snprintf(type, size, "mp3");
  }
  return 0;
}
```