user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r15
  mov    $0x8,%edx
  mov    $0x64,%esi
  lea    D29(%rip),%rdi
  push   %r14
  lea    D108(%rip),%r14
  push   %r13
  lea    D10(%rip),%r13
  push   %r12
  push   %rbp
  lea    D15(%rip),%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  xor    %edi,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  nopl   0x0(%rax,%rax,1)
L147:
  xor    %eax,%eax
  mov    $0x1,%r15d
  lea    D8(%rip),%rbx
  call   <rand@plt>
  mov    $0x8,%esi
  lea    D110(%rip),%rdi
  movslq %eax,%rdx
  mov    %rdx,%r12
  imul   $0x51eb851f,%rdx,%rdx
  mov    %r12d,%eax
  sar    $0x1f,%eax
  sar    $0x25,%rdx
  sub    %eax,%edx
  xor    %eax,%eax
  imul   $0x64,%edx,%edx
  sub    %edx,%r12d
  call   <printf@plt>
  add    $0x1,%r12d
  jmp    L30
  nopl   0x0(%rax)
L96:
  lea    D27(%rip),%rsi
  cmp    %r12d,(%rsp)
  jge    L116
L118:
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <printf@plt>
L21:
  add    $0x1,%r15d
  cmp    $0x9,%r15d
  je     L138
L30:
  mov    0x4(%rsp),%edx
  mov    (%rsp),%eax
  cmp    %eax,%edx
  jne    L128
  cmp    %r12d,%eax
  je     L8
L128:
  mov    %r15d,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rsp,%rdx
  lea    0x4(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  mov    (%rsp),%edx
  cmp    %edx,%eax
  jle    L113
  mov    %edx,0x4(%rsp)
  mov    %eax,(%rsp)
  mov    %edx,%eax
L113:
  cmp    %eax,%r12d
  jge    L96
  mov    %r14,%rsi
  jmp    L118
L138:
  mov    (%rsp),%eax
  mov    0x4(%rsp),%edx
L8:
  cmp    %eax,%r12d
  jne    L115
  cmp    %edx,%eax
  je     L97
L115:
  mov    %r12d,%edx
  mov    $0x8,%esi
  lea    D89(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L130:
  lea    D84(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  nopl   0x0(%rax,%rax,1)
L117:
  xor    %eax,%eax
  call   <getchar@plt>
  movsbl %al,%r12d
  mov    %r12d,%edi
  call   <isalpha@plt>
  test   %eax,%eax
  je     L117
  mov    %r12d,%edi
  call   <tolower@plt>
  cmp    $0x79,%al
  je     L147
  lea    D0(%rip),%rdi
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L54
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L116:
  lea    D102(%rip),%rdi
  call   <puts@plt>
  jmp    L21
  nopl   0x0(%rax)
L97:
  lea    D56(%rip),%rdi
  call   <puts@plt>
  jmp    L130
L54:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D29
datatype: string
name: retrieve_data
arguments: label: D108
datatype: string
name: retrieve_data
arguments: label: D10
datatype: string
name: retrieve_data
arguments: label: D15
datatype: string
name: retrieve_data
arguments: label: D8
datatype: string
name: retrieve_data
arguments: label: D110
datatype: string
name: retrieve_data
arguments: label: D27
datatype: string
name: retrieve_data
arguments: label: D89
datatype: string
name: retrieve_data
arguments: label: D84
datatype: string
name: retrieve_data
arguments: label: D0
datatype: string
name: retrieve_data
arguments: label: D102
datatype: string
name: retrieve_data
arguments: label: D56
datatype: string

tool: D29: Trap
----
In this game you have to try to guess a number between 1 and %d by
trapping it. Every guess you type a low and high number seperated by a
comma (like "15, 30") and you'll be told if the number you are trying to
find is between your number. When you think you have it type the same
number for both the high and low guess. And remember, you only have %d
guesses to find the number
Good luck!



tool: D108: lower

tool: D10: 
Guess %d (low , high) : 

tool: D15: %d %*c %d

tool: D8: My number is %s than your guesses.


tool: D110: I have a number. You have %d guesses.


tool: D27: higher

tool: D89: Ha ha! That's %d guesses. My number was %d.



tool: D84: Do you want to do play again? (y/n) 

tool: D0: Until next time then!

tool: D102: You've trapped my number.

tool: D56: I am undone! You caught my number.


assistant: ```c
int main(void) {
  int x, h, l, try, temp;
  char yesno;
  printf("Trap\n----\n"
         "In this game you have to try to guess a number between 1 and %d by\n"
         "trapping it. Every guess you type a low and high number seperated by a\n"
         "comma (like \"15, 30\") and you'll be told if the number you are trying to\n"
         "find is between your number. When you think you have it type the same\n"
         "number for both the high and low guess. And remember, you only have %d\n"
         "guesses to find the number\n"
         "Good luck!\n\n",
         100, 8);
  srand(time(NULL));
  do {
    x = rand() % 100 + 1;
    printf("I have a number. You have %d guesses.\n", 8);
    for (try = 1; try <= 8 && !(l == h && h == x); try++) {
      printf("\nGuess %d (low , high) : ", try);
      scanf("%d %*c %d", &l, &h);
      if (l > h) {
        temp = h;
        h = l;
        l = temp;
      }
      if (l <= x && x <= h)
        printf("You've trapped my number.\n");
      else
        printf("My number is %s than your guesses.\n", (l > x) ? "lower" : "higher");
    }
    if (l == h && h == x)
      printf("I am undone! You caught my number.\n\n");
    else
      printf("Ha ha! That's %d guesses. My number was %d.\n\n", 8, x);
    printf("Do you want to do play again? (y/n) ");
    while (!isalpha(yesno = getchar()))
      ;
  } while (tolower(yesno) == 'y');
  printf("Until next time then!\n");
  exit(0);
}
```