user: 请将以下的汇编代码转换成C语言代码:

```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    L161
  movl   $0x63,0xc(%rsp)
  mov    %rsi,%rbp
  mov    $0x2d,%ebx
  mov    $0x1,%r14d
  movl   $0x0,0x8(%rsp)
  jmp    L81
  nop
L249:
  cmpb   $0x64,0x1(%r15)
  jne    L261
  cmpb   $0x0,0x2(%r15)
  jne    L261
L296:
  movl   $0x1,0x8(%rsp)
  add    $0x1,%r14d
  cmp    %r14d,0x4(%rsp)
  jle    L284
L81:
  movslq %r14d,%rax
  mov    0x0(%rbp,%rax,8),%r15
  lea    0x0(,%rax,8),%r12
  movzbl (%r15),%r13d
  cmp    %r13d,%ebx
  je     L249
L261:
  mov    %r15,%rsi
  lea    D124(%rip),%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L296
  cmp    %r13d,%ebx
  jne    L83
  cmpb   $0x68,0x1(%r15)
  jne    L83
  cmpb   $0x0,0x2(%r15)
  je     L244
  nopl   0x0(%rax,%rax,1)
L83:
  mov    %r15,%rsi
  lea    D102(%rip),%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L244
  cmp    %r13d,%ebx
  jne    L292
  cmpb   $0x61,0x1(%r15)
  jne    L292
  cmpb   $0x0,0x2(%r15)
  jne    L292
L165:
  mov    0x8(%rbp,%r12,1),%rdi
  add    $0x1,%r14d
  add    $0x1,%r14d
  call   <atoi@plt>
  mov    %eax,0xc(%rsp)
  cmp    %r14d,0x4(%rsp)
  jg     L81
L284:
  lea    D61(%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    L8
L132:
  cmpl   $0x0,0xc(%rsp)
  movl   $0xffffffff,0x14(%rsp)
  jle    L48
L3:
  xor    %ebp,%ebp
  lea    D13(%rip),%r14
  lea    0x14(%rsp),%r13
  lea    D56(%rip),%rbx
  lea    D104(%rip),%r15
  nopl   0x0(%rax)
L82:
  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)
L187:
  xor    %eax,%eax
  call   <getchar@plt>
  cmp    $0xa,%al
  jne    L187
  cmp    %r12d,0x14(%rsp)
  je     L188
  jl     L143
  jle    L252
  mov    %r15,%rdi
  call   <puts@plt>
L174:
  cmp    0xc(%rsp),%ebp
  jne    L82
L48:
  mov    $0x29a,%eax
L76:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L60
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L292:
  mov    %r15,%rsi
  lea    D8(%rip),%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L165
  mov    0x0(%rbp),%rsi
  lea    D39(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L244:
  mov    0x0(%rbp),%rdi
  call   <printUsage@plt>
  xor    %eax,%eax
  jmp    L76
  xchg   %ax,%ax
L143:
  lea    D106(%rip),%rdi
  call   <puts@plt>
  jmp    L174
L8:
  mov    0xc(%rsp),%edx
  mov    %eax,%esi
  lea    D114(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L132
L188:
  mov    %r12d,%edx
  mov    %ebp,%esi
  lea    D40(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L76
L252:
  lea    D47(%rip),%rdi
  call   <puts@plt>
  mov    $0x29a,%eax
  jmp    L76
L161:
  lea    D61(%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    L3
L60:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D124
type_infered: string
name: retrieve_data
arguments: label: D102
type_infered: string
name: retrieve_data
arguments: label: D61
type_infered: string
name: retrieve_data
arguments: label: D13
type_infered: string
name: retrieve_data
arguments: label: D56
type_infered: string
name: retrieve_data
arguments: label: D104
type_infered: string
name: retrieve_data
arguments: label: D8
type_infered: string
name: retrieve_data
arguments: label: D39
type_infered: string
name: retrieve_data
arguments: label: D106
type_infered: string
name: retrieve_data
arguments: label: D114
type_infered: string
name: retrieve_data
arguments: label: D40
type_infered: string
name: retrieve_data
arguments: label: D47
type_infered: string

tool: D124: --debug

tool: D102: --help

tool: D61: 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: D13: Your guess: 

tool: D56: %d

tool: D104: Maybe you should try smaller number?

tool: D8: --attempts

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



tool: D106: Maybe you should try larger number?

tool: D114: DEBUG theNumber: %d
DEBUG maxAttempts: %d


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


tool: D47: 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;
}
```