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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,0x4(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%edi
  jle    L114
  movl   $0x63,0xc(%rsp)
  mov    %rsi,%rbp
  mov    $0x2d,%ebx
  mov    $0x1,%r14d
  movl   $0x0,0x8(%rsp)
  jmp    L291
  nop
L45:
  cmpb   $0x64,0x1(%r15)
  jne    L277
  cmpb   $0x0,0x2(%r15)
  jne    L277
L101:
  movl   $0x1,0x8(%rsp)
  add    $0x1,%r14d
  cmp    %r14d,0x4(%rsp)
  jle    L150
L291:
  movslq %r14d,%rax
  mov    0x0(%rbp,%rax,8),%r15
  lea    0x0(,%rax,8),%r12
  movzbl (%r15),%r13d
  cmp    %r13d,%ebx
  je     L45
L277:
  mov    %r15,%rsi
  lea    D27(%rip),%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L101
  cmp    %r13d,%ebx
  jne    L251
  cmpb   $0x68,0x1(%r15)
  jne    L251
  cmpb   $0x0,0x2(%r15)
  je     L164
  nopl   0x0(%rax,%rax,1)
L251:
  mov    %r15,%rsi
  lea    D97(%rip),%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L164
  cmp    %r13d,%ebx
  jne    L200
  cmpb   $0x61,0x1(%r15)
  jne    L200
  cmpb   $0x0,0x2(%r15)
  jne    L200
L279:
  mov    0x8(%rbp,%r12,1),%rdi
  add    $0x1,%r14d
  add    $0x1,%r14d
  call   <atoi@plt>
  mov    %eax,0xc(%rsp)
  cmp    %r14d,0x4(%rsp)
  jg     L291
L150:
  lea    D84(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  call   <getchar@plt>
  xor    %eax,%eax
  call   <randomize@plt>
  cmpl   $0x0,0x8(%rsp)
  mov    %eax,%r12d
  jne    L226
L103:
  cmpl   $0x0,0xc(%rsp)
  movl   $0xffffffff,0x14(%rsp)
  jle    L196
L194:
  xor    %ebp,%ebp
  lea    D88(%rip),%r14
  lea    0x14(%rsp),%r13
  lea    D81(%rip),%rbx
  lea    D35(%rip),%r15
  nopl   0x0(%rax)
L216:
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%ebp
  call   <printf@plt>
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  nopl   0x0(%rax,%rax,1)
L30:
  xor    %eax,%eax
  call   <getchar@plt>
  cmp    $0xa,%al
  jne    L30
  cmp    %r12d,0x14(%rsp)
  je     L74
  jl     L15
  jle    L280
  mov    %r15,%rdi
  call   <puts@plt>
L292:
  cmp    %ebp,0xc(%rsp)
  jne    L216
L196:
  mov    $0x29a,%eax
L179:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L285
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L200:
  mov    %r15,%rsi
  lea    D114(%rip),%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L279
  mov    0x0(%rbp),%rsi
  lea    D117(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L164:
  mov    0x0(%rbp),%rdi
  call   <printUsage@plt>
  xor    %eax,%eax
  jmp    L179
  xchg   %ax,%ax
L15:
  lea    D79(%rip),%rdi
  call   <puts@plt>
  jmp    L292
L226:
  mov    0xc(%rsp),%edx
  mov    %eax,%esi
  lea    D60(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L103
L74:
  mov    %r12d,%edx
  mov    %ebp,%esi
  lea    D5(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L179
L280:
  lea    D14(%rip),%rdi
  call   <puts@plt>
  mov    $0x29a,%eax
  jmp    L179
L114:
  lea    D84(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  call   <getchar@plt>
  xor    %eax,%eax
  call   <randomize@plt>
  movl   $0xffffffff,0x14(%rsp)
  movl   $0x63,0xc(%rsp)
  mov    %eax,%r12d
  jmp    L194
L285:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D27
data_type: string
name: disassemble_data
arguments: tag: D97
data_type: string
name: disassemble_data
arguments: tag: D84
data_type: string
name: disassemble_data
arguments: tag: D88
data_type: string
name: disassemble_data
arguments: tag: D81
data_type: string
name: disassemble_data
arguments: tag: D35
data_type: string
name: disassemble_data
arguments: tag: D114
data_type: string
name: disassemble_data
arguments: tag: D117
data_type: string
name: disassemble_data
arguments: tag: D79
data_type: string
name: disassemble_data
arguments: tag: D60
data_type: string
name: disassemble_data
arguments: tag: D5
data_type: string
name: disassemble_data
arguments: tag: D14
data_type: string

tool: D27: --debug

tool: D97: --help

tool: D84: Welcome to Guess-o-matic 3000!
Machine will randomize an integer between 0 and 20.
Try to guess it! Press ENTER when you're ready.

tool: D88: Your guess: 

tool: D81: %d

tool: D35: Maybe you should try smaller number?

tool: D114: --attempts

tool: D117: %s: invalid argument(s)



tool: D79: Maybe you should try larger number?

tool: D60: DEBUG theNumber: %d
DEBUG maxAttempts: %d


tool: D5: CONGRATZ! GGWP! You're Winner! Olet viineri! It took you %d tries to give a correct answer, which was %d!


tool: D14: What the fuck?

assistant: ```c
int main(int argc, char *argv[]) {
  bool optDebug = false;
  int maxAttempts = 99;
  for (int i = 1; i < argc; i++) {
    if (!strcmp("-d", argv[i]) || !strcmp("--debug", argv[i])) {
      optDebug = true;
    } else if (!strcmp("-h", argv[i]) || !strcmp("--help", argv[i])) {
      printUsage(argv[0]);
      return 0;
    } else if (!strcmp("-a", argv[i]) || !strcmp("--attempts", argv[i])) {
      i++;
      maxAttempts = atoi(argv[i]);
    } else {
      printf("%s: invalid argument(s)\n\n", argv[0]);
      printUsage(argv[0]);
      return 0;
    }
  }
  printf("Welcome to Guess-o-matic 3000!\nMachine will randomize an "
         "integer between 0 and 20.\nTry to guess it! Press ENTER "
         "when you're ready.");
  getchar();
  int theNumber = randomize();
  if (optDebug)
    printf("DEBUG theNumber: %d\nDEBUG maxAttempts: %d\n", theNumber, maxAttempts);
  int guessCount = 0;
  int guess = -1;
  while (guessCount < maxAttempts) {
    guessCount++;
    printf("Your guess: ");
    scanf("%d", &guess);
    while (getchar() != '\n')
      ;
    if (guess == theNumber) {
      printf("CONGRATZ! GGWP! You're Winner! Olet viineri! "
             "It took you %d tries to give a correct answer, "
             "which was %d!\n",
             guessCount, theNumber);
      return 0;
    } else if (guess < theNumber) {
      printf("Maybe you should try larger number?\n");
    } else if (guess > theNumber) {
      printf("Maybe you should try smaller number?\n");
    } else {
      printf("What the fuck?\n");
      return 666;
    }
  }
  return 666;
}
```