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

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D57(%rip),%rbp
  push   %rbx
  mov    %rbp,%rdi
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0xe(%rsp),%rsi
  call   <scanf@plt>
  movzbl 0xe(%rsp),%eax
  cmp    $0x68,%al
  je     L17
L192:
  cmp    $0x64,%al
  je     L148
L16:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L227
  add    $0x40,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L148:
  lea    0x10(%rsp),%rbx
  lea    0x1c(%rsp),%r14
  lea    0xf(%rsp),%r12
  lea    D10(%rip),%r13
L238:
  mov    %rbx,%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <scanf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  cmp    %r14,%rbx
  jne    L238
  mov    0x10(%rsp),%esi
  test   %esi,%esi
  je     L174
  lea    D84(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L212:
  mov    0x14(%rsp),%esi
  test   %esi,%esi
  jne    L39
  xor    %edx,%edx
  lea    D4(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L220:
  mov    0x18(%rsp),%esi
  test   %esi,%esi
  jne    L209
  xor    %edx,%edx
  lea    D4(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L16
L17:
  lea    0xf(%rsp),%r12
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    %r12,%rsi
  call   <scanf@plt>
  lea    0x29(%rsp),%rsi
  lea    D44(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  movsbl 0x2b(%rsp),%esi
  lea    -0x61(%rsi),%eax
  cmp    $0x19,%al
  jbe    L146
  sub    $0x30,%esi
L34:
  movsbl 0x2a(%rsp),%eax
  lea    -0x61(%rax),%edx
  cmp    $0x19,%dl
  ja     L123
  sub    $0x57,%eax
  movsbl %al,%eax
  shl    $0x4,%eax
  add    %eax,%esi
L201:
  movsbl 0x2d(%rsp),%edx
  lea    -0x61(%rdx),%eax
  cmp    $0x19,%al
  ja     L73
  sub    $0x57,%edx
  movsbl %dl,%edx
L233:
  movsbl 0x2c(%rsp),%eax
  lea    -0x61(%rax),%ecx
  cmp    $0x19,%cl
  ja     L197
  sub    $0x57,%eax
  movsbl %al,%eax
  shl    $0x4,%eax
  add    %eax,%edx
L171:
  movzbl 0x2f(%rsp),%eax
  lea    -0x61(%rax),%ecx
  cmp    $0x19,%cl
  ja     L93
  lea    -0x57(%rax),%ecx
  movsbl %cl,%ecx
L173:
  movsbl 0x2e(%rsp),%eax
  lea    -0x61(%rax),%edi
  cmp    $0x19,%dil
  ja     L124
  sub    $0x57,%eax
  movsbl %al,%eax
  shl    $0x4,%eax
  add    %eax,%ecx
L32:
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movzbl 0xe(%rsp),%eax
  jmp    L192
L174:
  xor    %edx,%edx
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L212
L146:
  sub    $0x57,%esi
  movsbl %sil,%esi
  jmp    L34
L209:
  lea    D64(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L16
L39:
  lea    D64(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L220
L124:
  sub    $0x30,%eax
  shl    $0x4,%eax
  add    %eax,%ecx
  jmp    L32
L93:
  movsbl %al,%ecx
  sub    $0x30,%ecx
  jmp    L173
L197:
  sub    $0x30,%eax
  shl    $0x4,%eax
  add    %eax,%edx
  jmp    L171
L73:
  sub    $0x30,%edx
  jmp    L233
L123:
  sub    $0x30,%eax
  shl    $0x4,%eax
  add    %eax,%esi
  jmp    L201
L227:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D57
type: string
name: read_data
arguments: label: D10
type: string
name: read_data
arguments: label: D84
type: string
name: read_data
arguments: label: D4
type: string
name: read_data
arguments: label: D44
type: string
name: read_data
arguments: label: D58
type: string
name: read_data
arguments: label: D16
type: string
name: read_data
arguments: label: D64
type: string

tool: D57: %c

tool: D10: %d

tool: D84: #%x

tool: D4: %x%x

tool: D44: %[^
]s

tool: D58: rgb(%d, %d, %d)

tool: D16: #%x%x

tool: D64: %x

assistant: ```c
int main() {
  char input;
  scanf("%c", &input);
  if (input == 'h') {
    char help;
    scanf("%c", &help);
    char input_string[15];
    scanf("%[^\n]s", input_string);
    int red = 0, green = 0, blue = 0;
    if (input_string[2] > 96 && input_string[2] < 123)
      red = input_string[2] - 87;
    else
      red = input_string[2] - 48;
    if (input_string[1] > 96 && input_string[1] < 123)
      red = red + (input_string[1] - 87) * 16;
    else
      red = red + (input_string[1] - 48) * 16;
    if (input_string[4] > 96 && input_string[4] < 123)
      green = input_string[4] - 87;
    else
      green = input_string[4] - 48;
    if (input_string[3] > 96 && input_string[3] < 123)
      green = green + (input_string[3] - 87) * 16;
    else
      green = green + (input_string[3] - 48) * 16;
    if (input_string[6] > 96 && input_string[6] < 123)
      blue = input_string[6] - 87;
    else
      blue = input_string[6] - 48;
    if (input_string[5] > 96 && input_string[5] < 123)
      blue = blue + (input_string[5] - 87) * 16;
    else
      blue = blue + (input_string[5] - 48) * 16;
    printf("rgb(%d, %d, %d)", red, green, blue);
  }
  if (input == 'd') {
    char comma;
    int numbers[5];
    for (int counter = 0; counter < 3; counter++) {
      scanf("%d", &numbers[counter]);
      scanf("%c", &comma);
    }
    if (numbers[0] == 0)
      printf("#%x%x", numbers[0], numbers[0]);
    else
      printf("#%x", numbers[0]);
    if (numbers[1] == 0)
      printf("%x%x", numbers[1], numbers[1]);
    else
      printf("%x", numbers[1]);
    if (numbers[2] == 0)
      printf("%x%x", numbers[2], numbers[2]);
    else
      printf("%x", numbers[2]);
  }
  return 0;
}
```