user: Converte this assembly snippet into its equivalent C code:

```asm
<gaisler_device_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  cmpl   $0xfff,-0x4(%rbp)
  je     L130
  cmpl   $0xfff,-0x4(%rbp)
  jg     L306
  cmpl   $0xffe,-0x4(%rbp)
  je     L6
  cmpl   $0xffe,-0x4(%rbp)
  jg     L306
  cmpl   $0x1f,-0x4(%rbp)
  jg     L69
  cmpl   $0x3,-0x4(%rbp)
  jl     L306
  mov    -0x4(%rbp),%eax
  sub    $0x3,%eax
  cmp    $0x1c,%eax
  ja     L306
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D59(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D59(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L69:
  cmpl   $0xffd,-0x4(%rbp)
  je     L9
  jmp    L306
  lea    D39(%rip),%rax
  jmp    L132
  lea    D63(%rip),%rax
  jmp    L132
  lea    D32(%rip),%rax
  jmp    L132
  lea    D3(%rip),%rax
  jmp    L132
  lea    D31(%rip),%rax
  jmp    L132
  lea    D94(%rip),%rax
  jmp    L132
  lea    D18(%rip),%rax
  jmp    L132
  lea    D238(%rip),%rax
  jmp    L132
  lea    D180(%rip),%rax
  jmp    L132
  lea    D34(%rip),%rax
  jmp    L132
  lea    D173(%rip),%rax
  jmp    L132
  lea    D175(%rip),%rax
  jmp    L132
  lea    D111(%rip),%rax
  jmp    L132
  lea    D237(%rip),%rax
  jmp    L132
  lea    D205(%rip),%rax
  jmp    L132
  lea    D213(%rip),%rax
  jmp    L132
  lea    D159(%rip),%rax
  jmp    L132
  lea    D9(%rip),%rax
  jmp    L132
  lea    D226(%rip),%rax
  jmp    L132
L9:
  lea    D1(%rip),%rax
  jmp    L132
L6:
  lea    D96(%rip),%rax
  jmp    L132
L130:
  lea    D46(%rip),%rax
  jmp    L132
L306:
  nop
  mov    $0x0,%eax
L132:
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D39
datatype: string
name: parse_data
arguments: data_tag: D63
datatype: string
name: parse_data
arguments: data_tag: D32
datatype: string
name: parse_data
arguments: data_tag: D3
datatype: string
name: parse_data
arguments: data_tag: D31
datatype: string
name: parse_data
arguments: data_tag: D94
datatype: string
name: parse_data
arguments: data_tag: D18
datatype: string
name: parse_data
arguments: data_tag: D238
datatype: string
name: parse_data
arguments: data_tag: D180
datatype: string
name: parse_data
arguments: data_tag: D34
datatype: string
name: parse_data
arguments: data_tag: D173
datatype: string
name: parse_data
arguments: data_tag: D175
datatype: string
name: parse_data
arguments: data_tag: D111
datatype: string
name: parse_data
arguments: data_tag: D237
datatype: string
name: parse_data
arguments: data_tag: D205
datatype: string
name: parse_data
arguments: data_tag: D213
datatype: string
name: parse_data
arguments: data_tag: D159
datatype: string
name: parse_data
arguments: data_tag: D9
datatype: string
name: parse_data
arguments: data_tag: D226
datatype: string
name: parse_data
arguments: data_tag: D1
datatype: string
name: parse_data
arguments: data_tag: D96
datatype: string
name: parse_data
arguments: data_tag: D46
datatype: string

tool: D39: GAISLER_LEON3

tool: D63: GAISLER_LEON3DSU

tool: D32: GAISLER_ETHAHB

tool: D3: GAISLER_APBMST

tool: D31: GAISLER_AHBUART

tool: D94: GAISLER_SRCTRL

tool: D18: GAISLER_SDCTRL

tool: D238: GAISLER_APBUART

tool: D180: GAISLER_IRQMP

tool: D34: GAISLER_AHBRAM

tool: D173: GAISLER_GPTIMER

tool: D175: GAISLER_PCITRG

tool: D111: GAISLER_PCISBRG

tool: D237: GAISLER_PCIFBRG

tool: D205: GAISLER_PCITRACE

tool: D213: GAISLER_AHBTRACE

tool: D159: GAISLER_ETHDSU

tool: D9: GAISLER_PIOPORT

tool: D226: GAISLER_SPACEWIRE

tool: D1: GAISLER_L2TIME

tool: D96: GAISLER_L2C

tool: D46: GAISLER_PLUGPLAY

assistant: ```c
extern char *gaisler_device_str(int id) {
  switch (id) {
  case 0x003:
    return "GAISLER_LEON3";
  case 0x004:
    return "GAISLER_LEON3DSU";
  case 0x005:
    return "GAISLER_ETHAHB";
  case 0x006:
    return "GAISLER_APBMST";
  case 0x007:
    return "GAISLER_AHBUART";
  case 0x008:
    return "GAISLER_SRCTRL";
  case 0x009:
    return "GAISLER_SDCTRL";
  case 0x00c:
    return "GAISLER_APBUART";
  case 0x00d:
    return "GAISLER_IRQMP";
  case 0x00e:
    return "GAISLER_AHBRAM";
  case 0x011:
    return "GAISLER_GPTIMER";
  case 0x012:
    return "GAISLER_PCITRG";
  case 0x013:
    return "GAISLER_PCISBRG";
  case 0x014:
    return "GAISLER_PCIFBRG";
  case 0x015:
    return "GAISLER_PCITRACE";
  case 0x017:
    return "GAISLER_AHBTRACE";
  case 0x018:
    return "GAISLER_ETHDSU";
  case 0x01A:
    return "GAISLER_PIOPORT";
  case 0x01f:
    return "GAISLER_SPACEWIRE";
  case 0xffd:
    return "GAISLER_L2TIME";
  case 0xffe:
    return "GAISLER_L2C";
  case 0xfff:
    return "GAISLER_PLUGPLAY";
  default:
    break;
  }
  return 0;
}
```