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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1c8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1b8(%rsp)
  xor    %eax,%eax
  lea    D36(%rip),%r13
  lea    D14(%rip),%r14
  lea    D10(%rip),%r12
  jmp    L113
L141:
  jle    L160
  lea    0x20(%rsp),%rbx
  mov    %rbx,%r15
  mov    $0x0,%ebp
L97:
  mov    %r15,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%ebp
  mov    0xc(%rsp),%edx
  add    $0x4,%r15
  cmp    %ebp,%edx
  jg     L97
  test   %edx,%edx
  jle    L52
  mov    0x18(%rsp),%ecx
  mov    $0x0,%eax
L64:
  cmp    %ecx,(%rbx)
  jge    L145
  add    $0x1,%eax
  add    $0x4,%rbx
  cmp    %eax,%edx
  jne    L64
L170:
  mov    0x1c(%rsp),%eax
  cmp    %eax,0x20(%rsp)
  sete   %bl
  movzbl %bl,%ebx
  mov    $0x1,%ebp
  jmp    L133
L52:
  mov    $0x0,%eax
L145:
  cmp    %eax,%edx
  je     L170
L160:
  mov    %r14,%rdi
  call   <puts@plt>
L113:
  lea    0x14(%rsp),%rcx
  lea    0x10(%rsp),%rdx
  lea    0xc(%rsp),%rsi
  lea    0x1c(%rsp),%r9
  lea    0x18(%rsp),%r8
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jne    L141
  mov    0x10(%rsp),%eax
  or     0x14(%rsp),%eax
  or     0x18(%rsp),%eax
  or     0x1c(%rsp),%eax
  jne    L170
  mov    0x1b8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L135
  mov    $0x0,%eax
  add    $0x1c8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L37:
  mov    0x1c(%rsp),%ecx
  mov    0x18(%rsp),%edx
  mov    0x14(%rsp),%esi
  mov    0x10(%rsp),%edi
  call   <makerand@plt>
  mov    %eax,0x1c(%rsp)
  movslq %ebx,%rdx
  cmp    0x20(%rsp,%rdx,4),%eax
  je     L50
L150:
  add    $0x1,%ebp
  cmp    $0x2711,%ebp
  je     L98
L133:
  mov    0xc(%rsp),%eax
  sub    $0x1,%eax
  cmp    %ebx,%eax
  jg     L37
  movslq %ebx,%rax
  mov    0x20(%rsp,%rax,4),%r15d
  mov    0x1c(%rsp),%ecx
  mov    0x18(%rsp),%edx
  mov    0x14(%rsp),%esi
  mov    0x10(%rsp),%edi
  call   <makerand@plt>
  cmp    %eax,%r15d
  jne    L37
  cmp    $0x2711,%ebp
  je     L98
  mov    %ebp,%esi
  lea    D31(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L113
L50:
  add    $0x1,%ebx
  jmp    L150
L98:
  mov    %r14,%rdi
  call   <puts@plt>
  jmp    L113
L135:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D36
type_infered: string
name: extract_symbolic_data
arguments: label: D14
type_infered: string
name: extract_symbolic_data
arguments: label: D10
type_infered: string
name: extract_symbolic_data
arguments: label: D31
type_infered: string

tool: D36: %d %d %d %d %d

tool: D14: -1

tool: D10: %d

tool: D31: %d


assistant: ```c
int main(void) {
  int num, a, b, c, rand, i, reel[100], sp;
  while (1) {
    scanf("%d %d %d %d %d", &num, &a, &b, &c, &rand);
    if (num == 0 && a == 0 && b == 0 && c == 0 && rand == 0)
      break;
    for (i = 0; i < num; i++)
      scanf("%d", &reel[i]);
    sp = 0;
    for (i = 0; i < num; i++) {
      if (reel[i] >= c)
        break;
    }
    if (i != num) {
      printf("-1\n");
      continue;
    }
    if (rand == reel[0]) {
      sp++;
    }
    for (i = 1; i <= 10000; i++) {
      if (sp >= num - 1 && reel[sp] == makerand(a, b, c, rand))
        break;
      rand = makerand(a, b, c, rand);
      if (rand == reel[sp])
        sp++;
    }
    if (i == 10001) {
      printf("-1\n");
    } else {
      printf("%d\n", i);
    }
  }
  return 0;
}
```