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

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    D42(%rip),%rdi
  call   <puts@plt>
  lea    D131(%rip),%r14
  lea    D8(%rip),%rbp
  lea    0x10(%rsp),%r13
  lea    D125(%rip),%r12
  jmp    L12
L79:
  mov    $0x3,%edx
  lea    D119(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L118
L10:
  mov    $0x5,%edx
  lea    D119(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L134
L63:
  mov    %ebx,%esi
  lea    D67(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L19
L101:
  lea    D110(%rip),%rdi
  call   <puts@plt>
L19:
  lea    D73(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movsbl 0x10(%rsp),%edi
  call   <tolower@plt>
  cmp    $0x6e,%al
  je     L108
L12:
  mov    %r14,%rdi
  call   <puts@plt>
  mov    $0x3,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rsp,%rsi
  lea    D158(%rip),%rbx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    $0x5,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x4(%rsp),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    $0x7,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x8(%rsp),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  lea    D53(%rip),%rdi
  call   <puts@plt>
  imul   $0x46,(%rsp),%ebx
  mov    0x4(%rsp),%eax
  lea    (%rax,%rax,4),%edx
  lea    (%rax,%rdx,4),%eax
  add    %eax,%ebx
  mov    0x8(%rsp),%edx
  mov    %edx,%eax
  shl    $0x4,%eax
  sub    %edx,%eax
  add    %eax,%ebx
  cmp    $0x69,%ebx
  jle    L91
L116:
  sub    $0x69,%ebx
  cmp    $0x69,%ebx
  jg     L116
L91:
  mov    %ebx,%esi
  lea    D56(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D47(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movsbl 0x10(%rsp),%edi
  call   <tolower@plt>
  cmp    $0x79,%al
  je     L101
  lea    D30(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0xc(%rsp),%rsi
  lea    D158(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0xc(%rsp),%esi
  cmp    %ebx,%esi
  je     L63
  movslq %esi,%rcx
  imul   $0x55555556,%rcx,%rcx
  shr    $0x20,%rcx
  mov    %esi,%eax
  sar    $0x1f,%eax
  sub    %eax,%ecx
  lea    (%rcx,%rcx,2),%eax
  mov    %esi,%ecx
  sub    %eax,%ecx
  mov    (%rsp),%r8d
  cmp    %r8d,%ecx
  jne    L79
L118:
  mov    0xc(%rsp),%esi
  movslq %esi,%rcx
  imul   $0x66666667,%rcx,%rcx
  sar    $0x21,%rcx
  mov    %esi,%eax
  sar    $0x1f,%eax
  sub    %eax,%ecx
  lea    (%rcx,%rcx,4),%eax
  mov    %esi,%ecx
  sub    %eax,%ecx
  mov    0x4(%rsp),%r8d
  cmp    %r8d,%ecx
  jne    L10
L134:
  mov    0xc(%rsp),%esi
  movslq %esi,%rcx
  imul   $0xffffffff92492493,%rcx,%rcx
  shr    $0x20,%rcx
  add    %esi,%ecx
  sar    $0x2,%ecx
  mov    %esi,%eax
  sar    $0x1f,%eax
  sub    %eax,%ecx
  lea    0x0(,%rcx,8),%eax
  sub    %ecx,%eax
  mov    %esi,%ecx
  sub    %eax,%ecx
  mov    0x8(%rsp),%r8d
  cmp    %r8d,%ecx
  je     L19
  mov    $0x7,%edx
  lea    D119(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L19
L108:
  lea    D159(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  mov    $0x0,%eax
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L24:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D42
type: string
name: read_data
arguments: data_tag: D131
type: string
name: read_data
arguments: data_tag: D8
type: string
name: read_data
arguments: data_tag: D125
type: string
name: read_data
arguments: data_tag: D119
type: string
name: read_data
arguments: data_tag: D67
type: string
name: read_data
arguments: data_tag: D110
type: string
name: read_data
arguments: data_tag: D73
type: string
name: read_data
arguments: data_tag: D158
type: string
name: read_data
arguments: data_tag: D53
type: string
name: read_data
arguments: data_tag: D56
type: string
name: read_data
arguments: data_tag: D47
type: string
name: read_data
arguments: data_tag: D30
type: string
name: read_data
arguments: data_tag: D159
type: string

tool: D42: A mathematical boomerang puzzle as invented by the ancient
mathematician Nicomachus.


tool: D131: Think of a number between 1 and 100

tool: D8: Your number divided by %d has a remainder of ? 

tool: D125: %s

tool: D119: %d divided by %d has a remainder of %d, not %d.


tool: D67: That's what I said, %d. You had me worried.


tool: D110: Yes, I knew it.

tool: D73: 
Thank you. Would you like to play again? 

tool: D158: %d

tool: D53: 

So your number is...


tool: D56: 	%d!



tool: D47: Am I correct? 

tool: D30: 
What was your number? 

tool: D159: Good Bye, then.

assistant: ```c
int main(void) {
  int a, b, c, d, r;
  char yesno[25];
  printf("A mathematical boomerang puzzle as invented by the ancient\n"
         "mathematician Nicomachus.\n\n");
  do {
    printf("Think of a number between 1 and 100\n");
    printf("Your number divided by %d has a remainder of ? ", 3);
    scanf("%d", &a);
    printf("Your number divided by %d has a remainder of ? ", 5);
    scanf("%d", &b);
    printf("Your number divided by %d has a remainder of ? ", 7);
    scanf("%d", &c);
    printf("\n\nSo your number is...\n\n");
    r = 70 * a + 21 * b + 15 * c;
    while (r > 105)
      r -= 105;
    printf("\t%d!\n\n", r);
    printf("Am I correct? ");
    scanf("%s", yesno);
    if (tolower(yesno[0]) != 'y') {
      printf("\nWhat was your number? ");
      scanf("%d", &d);
      if (d - r) {
        if (!(d % 3 == a))
          printf("%d divided by %d has a remainder of %d, not %d.\n", d, 3, d % 3, a);
        if (!(d % 5 == b))
          printf("%d divided by %d has a remainder of %d, not %d.\n", d, 5, d % 5, b);
        if (!(d % 7 == c))
          printf("%d divided by %d has a remainder of %d, not %d.\n", d, 7, d % 7, c);
      } else
        printf("That's what I said, %d. You had me worried.\n", r);
    } else
      printf("Yes, I knew it.\n");
    printf("\nThank you. Would you like to play again? ");
    scanf("%s", yesno);
  } while (tolower(yesno[0]) != 'n');
  printf("Good Bye, then.");
  return 0;
}
```