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

```asm
<map_reg>:
  endbr64
  sub    $0x48,%rsp
  lea    D6(%rip),%rcx
  lea    D56(%rip),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  lea    D37(%rip),%rax
  movq   %rcx,%xmm0
  lea    D4(%rip),%rcx
  movq   %rax,%xmm1
  lea    D57(%rip),%rax
  punpcklqdq %xmm1,%xmm0
  movq   %rax,%xmm2
  lea    D34(%rip),%rax
  movaps %xmm0,(%rsp)
  movq   %rsi,%xmm0
  movq   %rax,%xmm3
  movzbl (%rdi),%eax
  punpcklqdq %xmm2,%xmm0
  movaps %xmm0,0x10(%rsp)
  movq   %rcx,%xmm0
  punpcklqdq %xmm3,%xmm0
  movaps %xmm0,0x20(%rsp)
  cmp    $0x61,%eax
  jne    L354
  cmpb   $0x78,0x1(%rdi)
  je     L53
L354:
  cmp    $0x62,%eax
  jne    L290
L360:
  cmpb   $0x78,0x1(%rdi)
  jne    L290
  cmpb   $0x0,0x2(%rdi)
  je     L58
  nop
L290:
  cmp    $0x63,%eax
  jne    L60
  cmpb   $0x78,0x1(%rdi)
  jne    L60
  cmpb   $0x0,0x2(%rdi)
  je     L119
  nopl   (%rax)
L60:
  cmp    $0x64,%eax
  jne    L319
  cmpb   $0x78,0x1(%rdi)
  jne    L319
  cmpb   $0x0,0x2(%rdi)
  je     L37
  nopl   (%rax)
L319:
  cmp    $0x73,%eax
  je     L52
L91:
  cmp    $0x64,%eax
  je     L51
L311:
  cmp    $0x61,%eax
  je     L189
L261:
  cmp    $0x62,%eax
  je     L144
L194:
  cmp    $0x63,%eax
  je     L275
L161:
  cmp    $0x64,%eax
  je     L316
L335:
  mov    %rdi,%rax
L33:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L365
  add    $0x48,%rsp
  ret
  cs nopw 0x0(%rax,%rax,1)
L52:
  cmpb   $0x69,0x1(%rdi)
  jne    L91
  cmpb   $0x0,0x2(%rdi)
  jne    L91
  mov    $0x4,%edx
  nopl   0x0(%rax)
L42:
  mov    (%rsp,%rdx,8),%rax
  jmp    L33
  xchg   %ax,%ax
L51:
  cmpb   $0x69,0x1(%rdi)
  jne    L311
  cmpb   $0x0,0x2(%rdi)
  mov    $0x5,%edx
  jne    L311
  jmp    L42
  nopl   0x0(%rax,%rax,1)
L189:
  cmpb   $0x6c,0x1(%rdi)
  jne    L261
  movzbl 0x2(%rdi),%edx
  test   %edx,%edx
  jne    L261
  jmp    L42
  nopl   0x0(%rax)
L144:
  cmpb   $0x6c,0x1(%rdi)
  jne    L194
  cmpb   $0x0,0x2(%rdi)
  jne    L194
L58:
  mov    $0x1,%edx
  jmp    L42
  nopl   0x0(%rax,%rax,1)
L275:
  cmpb   $0x6c,0x1(%rdi)
  jne    L161
  cmpb   $0x0,0x2(%rdi)
  jne    L161
L119:
  mov    $0x2,%edx
  jmp    L42
  nopl   0x0(%rax,%rax,1)
L316:
  cmpb   $0x6c,0x1(%rdi)
  jne    L335
  cmpb   $0x0,0x2(%rdi)
  jne    L335
L37:
  mov    $0x3,%edx
  jmp    L42
  xchg   %ax,%ax
L53:
  movzbl 0x2(%rdi),%edx
  test   %edx,%edx
  je     L42
  cmp    $0x62,%eax
  jne    L290
  jmp    L360
L365:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D6
type_infered: string
name: unpack_data
arguments: data_label: D56
type_infered: string
name: unpack_data
arguments: data_label: D37
type_infered: string
name: unpack_data
arguments: data_label: D4
type_infered: string
name: unpack_data
arguments: data_label: D57
type_infered: string
name: unpack_data
arguments: data_label: D34
type_infered: string

tool: D6: eax

tool: D56: ecx

tool: D37: ebx

tool: D4: esi

tool: D57: edx

tool: D34: edi

assistant: ```c
const char *map_reg(const char *reg) {
  const char *regs_f[] = {"eax", "ebx", "ecx", "edx", "esi", "edi"};
  const char *regs_w[] = {"ax", "bx", "cx", "dx", "si", "di"};
  const char *regs_b[] = {"al", "bl", "cl", "dl"};
  int i;
  for (i = 0; i < (sizeof(regs_w) / sizeof(regs_w[0])); i++)
    if (!strcmp(reg, regs_w[i]))
      return regs_f[i];
  for (i = 0; i < (sizeof(regs_b) / sizeof(regs_b[0])); i++)
    if (!strcmp(reg, regs_b[i]))
      return regs_f[i];
  return reg;
}
```