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

```asm
<gr_get_color_int>:
  endbr64
  test   %rdi,%rdi
  je     L17
  push   %rbx
  mov    %rdi,%rbx
  lea    D101(%rip),%rsi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x1,%eax
  test   %edx,%edx
  je     L142
  lea    D115(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x2,%eax
  test   %edx,%edx
  je     L142
  lea    D79(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x3,%eax
  test   %edx,%edx
  je     L142
  lea    D206(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x4,%eax
  test   %edx,%edx
  je     L142
  lea    D59(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x5,%eax
  test   %edx,%edx
  je     L142
  lea    D26(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x6,%eax
  test   %edx,%edx
  je     L142
  lea    D22(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x7,%eax
  test   %edx,%edx
  je     L142
  lea    D50(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x8,%eax
  test   %edx,%edx
  je     L142
  lea    D185(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x9,%eax
  test   %edx,%edx
  je     L142
  lea    D141(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0xa,%eax
  test   %edx,%edx
  je     L142
  lea    D69(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0xb,%eax
  test   %edx,%edx
  je     L142
  lea    D166(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0xc,%eax
  test   %edx,%edx
  je     L142
  lea    D120(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0xd,%eax
  test   %edx,%edx
  je     L142
  lea    D145(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0xe,%eax
  test   %edx,%edx
  je     L142
  lea    D124(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0xf,%eax
  test   %edx,%edx
  je     L142
  lea    D51(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x10,%eax
  test   %edx,%edx
  je     L142
  lea    D177(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x11,%eax
  test   %edx,%edx
  je     L142
  lea    D138(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x12,%eax
  test   %edx,%edx
  je     L142
  lea    D65(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x13,%eax
  test   %edx,%edx
  je     L142
  lea    D169(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %eax,%edx
  mov    $0x14,%eax
  test   %edx,%edx
  je     L142
  lea    D53(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  cmp    $0x1,%eax
  sbb    %eax,%eax
  and    $0x15,%eax
L142:
  pop    %rbx
  ret
L17:
  mov    $0xffffffff,%eax
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D101
datatype: string
name: disassemble_data
arguments: data_tag: D115
datatype: string
name: disassemble_data
arguments: data_tag: D79
datatype: string
name: disassemble_data
arguments: data_tag: D206
datatype: string
name: disassemble_data
arguments: data_tag: D59
datatype: string
name: disassemble_data
arguments: data_tag: D26
datatype: string
name: disassemble_data
arguments: data_tag: D22
datatype: string
name: disassemble_data
arguments: data_tag: D50
datatype: string
name: disassemble_data
arguments: data_tag: D185
datatype: string
name: disassemble_data
arguments: data_tag: D141
datatype: string
name: disassemble_data
arguments: data_tag: D69
datatype: string
name: disassemble_data
arguments: data_tag: D166
datatype: string
name: disassemble_data
arguments: data_tag: D120
datatype: string
name: disassemble_data
arguments: data_tag: D145
datatype: string
name: disassemble_data
arguments: data_tag: D124
datatype: string
name: disassemble_data
arguments: data_tag: D51
datatype: string
name: disassemble_data
arguments: data_tag: D177
datatype: string
name: disassemble_data
arguments: data_tag: D138
datatype: string
name: disassemble_data
arguments: data_tag: D65
datatype: string
name: disassemble_data
arguments: data_tag: D169
datatype: string
name: disassemble_data
arguments: data_tag: D53
datatype: string

tool: D101: Green

tool: D115: Navy

tool: D79: Yellow

tool: D206: Magenta

tool: D59: Cyan

tool: D26: Gray

tool: D22: Orange

tool: D50: Black

tool: D185: Maroon

tool: D141: White

tool: D69: Blue

tool: D166: Pink

tool: D120: Brown

tool: D145: Grey

tool: D124: LimeGreen

tool: D51: Turquoise

tool: D177: Violet

tool: D138: Wheat

tool: D65: Purple

tool: D169: Beige

tool: D53: Red

assistant: ```c
short gr_get_color_int(char *colorstr) {
  if (!colorstr)
    return -1;
  if (!strcmp(colorstr, "Green"))
    return 1;
  if (!strcmp(colorstr, "Navy"))
    return 2;
  if (!strcmp(colorstr, "Yellow"))
    return 3;
  if (!strcmp(colorstr, "Magenta"))
    return 4;
  if (!strcmp(colorstr, "Cyan"))
    return 5;
  if (!strcmp(colorstr, "Gray"))
    return 6;
  if (!strcmp(colorstr, "Orange"))
    return 7;
  if (!strcmp(colorstr, "Black"))
    return 8;
  if (!strcmp(colorstr, "Maroon"))
    return 9;
  if (!strcmp(colorstr, "White"))
    return 10;
  if (!strcmp(colorstr, "Blue"))
    return 11;
  if (!strcmp(colorstr, "Pink"))
    return 12;
  if (!strcmp(colorstr, "Brown"))
    return 13;
  if (!strcmp(colorstr, "Grey"))
    return 14;
  if (!strcmp(colorstr, "LimeGreen"))
    return 15;
  if (!strcmp(colorstr, "Turquoise"))
    return 16;
  if (!strcmp(colorstr, "Violet"))
    return 17;
  if (!strcmp(colorstr, "Wheat"))
    return 18;
  if (!strcmp(colorstr, "Purple"))
    return 19;
  if (!strcmp(colorstr, "Beige"))
    return 20;
  if (!strcmp(colorstr, "Red"))
    return 21;
  return 0;
}
```