user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x88,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  movq   $0x0,0x38(%rsp)
  movq   $0x0,0x40(%rsp)
  movq   $0x0,0x48(%rsp)
  movq   $0x0,0x50(%rsp)
  movq   $0x0,0x58(%rsp)
  movq   $0x0,0x60(%rsp)
  movq   $0x0,0x68(%rsp)
  movl   $0x0,0x70(%rsp)
  lea    0xb(%rsp),%rsi
  mov    $0x1,%edx
  mov    $0x0,%edi
  call   <read@plt>
  lea    0x10(%rsp),%rsi
  mov    $0x50,%edx
  mov    $0x0,%edi
  call   <read@plt>
  movzbl 0xb(%rsp),%eax
  cmp    $0x78,%al
  je     L282
  cmp    $0x75,%al
  je     L161
  lea    D126(%rip),%rdi
  call   <puts@plt>
L38:
  mov    0x78(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L215
  mov    $0x0,%eax
  add    $0x88,%rsp
  ret
L282:
  lea    0xc(%rsp),%rdx
  lea    0x10(%rsp),%rdi
  lea    D108(%rip),%rsi
  call   <sscanf@plt>
  mov    0xc(%rsp),%eax
  cmp    $0xaaaa,%eax
  je     L281
  cmp    $0xffff3233,%eax
  je     L319
  lea    D194(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L281:
  lea    0x10(%rsp),%rdi
  mov    $0x2,%edx
  lea    D153(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L358
  lea    D111(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L358:
  lea    0x10(%rsp),%rdi
  mov    $0x3,%edx
  lea    D154(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L254
  cmpb   $0x2b,0x10(%rsp)
  je     L194
  lea    D39(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L254:
  lea    D56(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L194:
  lea    D26(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L319:
  lea    0x10(%rsp),%rdi
  mov    $0x3,%edx
  lea    D165(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L81
  cmpb   $0x2d,0x10(%rsp)
  je     L253
  lea    D71(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L81:
  lea    D18(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L253:
  lea    D32(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L161:
  lea    0xc(%rsp),%rdx
  lea    0x10(%rsp),%rdi
  lea    D212(%rip),%rsi
  call   <sscanf@plt>
  mov    0xc(%rsp),%eax
  cmp    $0xaaaa,%eax
  je     L189
  cmp    $0xffff3233,%eax
  jne    L178
  cmpb   $0x2d,0x10(%rsp)
  je     L308
L187:
  lea    D71(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L189:
  movzbl 0x10(%rsp),%eax
  cmp    $0x30,%al
  je     L94
  cmp    $0x2b,%al
  je     L0
L132:
  lea    D218(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L94:
  cmpb   $0x78,0x11(%rsp)
  je     L132
  lea    D185(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L0:
  cmpb   $0x30,0x11(%rsp)
  je     L290
  lea    D29(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L290:
  cmpb   $0x78,0x12(%rsp)
  je     L132
  lea    D145(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L308:
  cmpb   $0x30,0x11(%rsp)
  je     L100
  lea    D8(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L100:
  cmpb   $0x78,0x12(%rsp)
  je     L187
  lea    D203(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L178:
  lea    D84(%rip),%rdi
  call   <puts@plt>
  jmp    L38
L215:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D126
type_guessed: string
name: parse_data
arguments: tag: D108
type_guessed: string
name: parse_data
arguments: tag: D194
type_guessed: string
name: parse_data
arguments: tag: D153
type_guessed: string
name: parse_data
arguments: tag: D111
type_guessed: string
name: parse_data
arguments: tag: D154
type_guessed: string
name: parse_data
arguments: tag: D39
type_guessed: string
name: parse_data
arguments: tag: D56
type_guessed: string
name: parse_data
arguments: tag: D26
type_guessed: string
name: parse_data
arguments: tag: D165
type_guessed: string
name: parse_data
arguments: tag: D71
type_guessed: string
name: parse_data
arguments: tag: D18
type_guessed: string
name: parse_data
arguments: tag: D32
type_guessed: string
name: parse_data
arguments: tag: D212
type_guessed: string
name: parse_data
arguments: tag: D218
type_guessed: string
name: parse_data
arguments: tag: D185
type_guessed: string
name: parse_data
arguments: tag: D29
type_guessed: string
name: parse_data
arguments: tag: D145
type_guessed: string
name: parse_data
arguments: tag: D8
type_guessed: string
name: parse_data
arguments: tag: D203
type_guessed: string
name: parse_data
arguments: tag: D84
type_guessed: string

tool: D126: No switch

tool: D108: %07x

tool: D194: Nope x

tool: D153: 0x

tool: D111: 0x worked

tool: D154: +0x

tool: D39: base 16 worked

tool: D56: +0x worked

tool: D26: base +16 worked

tool: D165: -0x

tool: D71: shouldn't happen

tool: D18: -0x worked

tool: D32: base -16 worked

tool: D212: %u

tool: D218: base 10 worked

tool: D185: base 8 worked

tool: D29: base +10 worked

tool: D145: base +8 worked

tool: D8: base -10 worked

tool: D203: base -8 worked

tool: D84: Nope u

assistant: ```c
int main() {
  char swch;
  char test[100] = {0};
  unsigned int val;
  read(0, &swch, 1);
  read(0, test, 80);
  if (swch == 'x') {
    sscanf(test, "%07x", &val);
    if (val == 0xaaaa) {
      if (strncmp(test, "0x", 2) == 0) {
        puts("0x worked");
      } else if (strncmp(test, "+0x", 3) == 0) {
        puts("+0x worked");
      } else if (test[0] == '+') {
        puts("base +16 worked");
      } else {
        puts("base 16 worked");
      }
    } else if (val == -0xcdcd) {
      if (strncmp(test, "-0x", 3) == 0) {
        puts("-0x worked");
      } else if (test[0] == '-') {
        puts("base -16 worked");
      } else {
        puts("shouldn't happen");
      }
    } else {
      puts("Nope x");
    }
  } else if (swch == 'u') {
    sscanf(test, "%u", &val);
    if (val == 0xaaaa) {
      if (test[0] == '0' && test[1] != 'x') {
        puts("base 8 worked");
      } else if (test[0] == '+' && test[1] == '0' && test[2] != 'x') {
        puts("base +8 worked");
      } else if (test[0] == '+' && test[1] != '0') {
        puts("base +10 worked");
      } else {
        puts("base 10 worked");
      }
    } else if (val == -0xcdcd) {
      if (test[0] == '-' && test[1] == '0' && test[2] != 'x') {
        puts("base -8 worked");
      } else if (test[0] == '-' && test[1] != '0') {
        puts("base -10 worked");
      } else {
        puts("shouldn't happen");
      }
    } else {
      puts("Nope u");
    }
  } else {
    puts("No switch");
  }
  return 0;
}
```