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

```asm
<gaisler_device_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  cmpl   $0xfff,-0x4(%rbp)
  je     L49
  cmpl   $0xfff,-0x4(%rbp)
  jg     L197
  cmpl   $0xffe,-0x4(%rbp)
  je     L308
  cmpl   $0xffe,-0x4(%rbp)
  jg     L197
  cmpl   $0x61,-0x4(%rbp)
  jg     L221
  cmpl   $0x3,-0x4(%rbp)
  jl     L197
  mov    -0x4(%rbp),%eax
  sub    $0x3,%eax
  cmp    $0x5e,%eax
  ja     L197
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D141(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D141(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L221:
  cmpl   $0xffd,-0x4(%rbp)
  je     L268
  jmp    L197
  lea    D42(%rip),%rax
  jmp    L61
  lea    D238(%rip),%rax
  jmp    L61
  lea    D202(%rip),%rax
  jmp    L61
  lea    D24(%rip),%rax
  jmp    L61
  lea    D178(%rip),%rax
  jmp    L61
  lea    D221(%rip),%rax
  jmp    L61
  lea    D70(%rip),%rax
  jmp    L61
  lea    D228(%rip),%rax
  jmp    L61
  lea    D9(%rip),%rax
  jmp    L61
  lea    D247(%rip),%rax
  jmp    L61
  lea    D4(%rip),%rax
  jmp    L61
  lea    D93(%rip),%rax
  jmp    L61
  lea    D209(%rip),%rax
  jmp    L61
  lea    D151(%rip),%rax
  jmp    L61
  lea    D61(%rip),%rax
  jmp    L61
  lea    D36(%rip),%rax
  jmp    L61
  lea    D30(%rip),%rax
  jmp    L61
  lea    D159(%rip),%rax
  jmp    L61
  lea    D162(%rip),%rax
  jmp    L61
  lea    D187(%rip),%rax
  jmp    L61
  lea    D62(%rip),%rax
  jmp    L61
  lea    D116(%rip),%rax
  jmp    L61
L268:
  lea    D165(%rip),%rax
  jmp    L61
L308:
  lea    D180(%rip),%rax
  jmp    L61
L49:
  lea    D71(%rip),%rax
  jmp    L61
L197:
  nop
  mov    $0x0,%eax
L61:
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: tag: D42
data_type: string
name: read_data
arguments: tag: D238
data_type: string
name: read_data
arguments: tag: D202
data_type: string
name: read_data
arguments: tag: D24
data_type: string
name: read_data
arguments: tag: D178
data_type: string
name: read_data
arguments: tag: D221
data_type: string
name: read_data
arguments: tag: D70
data_type: string
name: read_data
arguments: tag: D228
data_type: string
name: read_data
arguments: tag: D9
data_type: string
name: read_data
arguments: tag: D247
data_type: string
name: read_data
arguments: tag: D4
data_type: string
name: read_data
arguments: tag: D93
data_type: string
name: read_data
arguments: tag: D209
data_type: string
name: read_data
arguments: tag: D151
data_type: string
name: read_data
arguments: tag: D61
data_type: string
name: read_data
arguments: tag: D36
data_type: string
name: read_data
arguments: tag: D30
data_type: string
name: read_data
arguments: tag: D159
data_type: string
name: read_data
arguments: tag: D162
data_type: string
name: read_data
arguments: tag: D187
data_type: string
name: read_data
arguments: tag: D62
data_type: string
name: read_data
arguments: tag: D116
data_type: string
name: read_data
arguments: tag: D165
data_type: string
name: read_data
arguments: tag: D180
data_type: string
name: read_data
arguments: tag: D71
data_type: string

tool: D42: GAISLER_LEON3

tool: D238: GAISLER_LEON3DSU

tool: D202: GAISLER_ETHAHB

tool: D24: GAISLER_ETHMAC

tool: D178: GAISLER_APBMST

tool: D221: GAISLER_AHBUART

tool: D70: GAISLER_SRCTRL

tool: D228: GAISLER_SDCTRL

tool: D9: GAISLER_APBUART

tool: D247: GAISLER_IRQMP

tool: D4: GAISLER_AHBRAM

tool: D93: GAISLER_GPTIMER

tool: D209: GAISLER_PCITRG

tool: D151: GAISLER_PCISBRG

tool: D61: GAISLER_PCIFBRG

tool: D36: GAISLER_PCITRACE

tool: D30: GAISLER_AHBTRACE

tool: D159: GAISLER_ETHDSU

tool: D162: GAISLER_PIOPORT

tool: D187: GAISLER_AHBJTAG

tool: D62: GAISLER_VGA

tool: D116: GAISLER_KBD

tool: D165: GAISLER_L2TIME

tool: D180: GAISLER_L2C

tool: D71: 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 0x01D:
    return "GAISLER_ETHMAC";
  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 0x01c:
    return "GAISLER_AHBJTAG";
  case 0x061:
    return "GAISLER_VGA";
  case 0X060:
    return "GAISLER_KBD";
  case 0xffd:
    return "GAISLER_L2TIME";
  case 0xffe:
    return "GAISLER_L2C";
  case 0xfff:
    return "GAISLER_PLUGPLAY";
  default:
    break;
  }
  return 0;
}
```