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

```asm
<main>:
  endbr64
  push   %r15
  xor    %edi,%edi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  lea    0x3c(%rsp),%rbp
  call   <time@plt>
  mov    %rbx,%r12
  mov    %eax,%edi
  call   <srand@plt>
  nopl   0x0(%rax,%rax,1)
L283:
  xor    %eax,%eax
  add    $0x4,%r12
  call   <rand@plt>
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0x38e38e39,%rdx,%rdx
  sar    $0x1f,%ecx
  sar    $0x21,%rdx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,8),%edx
  sub    %edx,%eax
  mov    %eax,-0x4(%r12)
  cmp    %rbp,%r12
  jne    L283
  lea    D44(%rip),%r12
  cs nopw 0x0(%rax,%rax,1)
L23:
  mov    (%rbx),%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %rbp,%rbx
  jne    L23
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x4(%rsp),%ebx
  cmp    %ebx,(%rsp)
  jl     L767
  mov    $0x1,%esi
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %esi,%esi
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%ebp
  cmp    %ebp,%ebx
  jl     L6
  mov    0xc(%rsp),%ebx
  mov    $0x1,%eax
  cmp    %ebp,%ebx
  jg     L736
L442:
  mov    0x10(%rsp),%r14d
  cmp    %r14d,%ebx
  jl     L663
L439:
  mov    %eax,%r12d
  mov    $0x1,%ebx
  xor    %ebp,%ebp
L746:
  mov    0x14(%rsp),%r13d
  cmp    %r14d,%r13d
  jg     L190
  cmp    %r12d,%ebx
  jg     L756
L773:
  mov    $0x1,%ebx
L400:
  mov    0x18(%rsp),%r14d
  cmp    %r13d,%r14d
  jle    L621
L745:
  mov    %ebx,%eax
  mov    %r12d,%ebx
L178:
  lea    0x1(%rax),%r15d
L634:
  mov    0x1c(%rsp),%r12d
  cmp    %r12d,%r14d
  jl     L372
  cmp    %ebx,%r15d
  jg     L321
L21:
  mov    $0x1,%r15d
L658:
  mov    0x20(%rsp),%r13d
  cmp    %r13d,%r12d
  jge    L639
L99:
  mov    %r15d,%eax
  mov    %ebx,%r15d
L536:
  lea    0x1(%rax),%r14d
L661:
  mov    0x24(%rsp),%ebx
  cmp    %ebx,%r13d
  jl     L703
  cmp    %r15d,%r14d
  jg     L308
L100:
  mov    $0x1,%r14d
L577:
  mov    0x28(%rsp),%r12d
  cmp    %r12d,%ebx
  jge    L92
L646:
  mov    %r14d,%eax
  mov    %r15d,%r14d
L160:
  lea    0x1(%rax),%r13d
L404:
  mov    0x2c(%rsp),%ebx
  cmp    %ebx,%r12d
  jl     L490
  cmp    %r14d,%r13d
  jg     L4
L66:
  mov    $0x1,%r13d
L453:
  mov    0x30(%rsp),%r12d
  cmp    %r12d,%ebx
  jge    L243
L257:
  mov    %r13d,%esi
  mov    %r14d,%r13d
L450:
  add    $0x1,%esi
L64:
  mov    0x34(%rsp),%eax
  cmp    %eax,%r12d
  jl     L782
  cmp    %r13d,%esi
  jg     L680
L355:
  mov    $0x1,%esi
L642:
  cmp    %eax,0x38(%rsp)
  jg     L369
  cmp    %r13d,%esi
  jg     L594
L369:
  xor    %eax,%eax
  mov    %ebp,%esi
  lea    D273(%rip),%rdi
  call   <printf@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L154
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L767:
  mov    0x8(%rsp),%ebp
  cmp    %ebp,%ebx
  jge    L237
  mov    $0x2,%r12d
  xor    %eax,%eax
L542:
  mov    0xc(%rsp),%ebx
  add    $0x1,%r12d
  cmp    %ebx,%ebp
  jge    L344
L277:
  mov    0x10(%rsp),%r14d
  add    $0x1,%r12d
  cmp    %ebx,%r14d
  jg     L20
  cmp    %eax,%r12d
  jle    L439
  mov    $0x4,%ebp
  mov    %r12d,%esi
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  sub    %r12d,%ebp
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  mov    %ebp,%esi
  call   <printf@plt>
  mov    0x14(%rsp),%r13d
  cmp    %r13d,%r14d
  jge    L358
  mov    $0x1,%ebx
L190:
  add    $0x1,%ebx
  jmp    L400
L132:
  mov    $0xc,%ebp
  mov    %r13d,%esi
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  sub    %r13d,%ebp
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  mov    %ebp,%esi
  call   <printf@plt>
  mov    0x34(%rsp),%eax
  cmp    %r12d,%eax
  jle    L369
  mov    $0x1,%esi
L782:
  add    $0x1,%esi
  jmp    L642
L8:
  mov    $0xa,%ebp
  mov    %r14d,%esi
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  sub    %r14d,%ebp
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  mov    %ebp,%esi
  call   <printf@plt>
  mov    0x2c(%rsp),%ebx
  cmp    %r12d,%ebx
  jle    L9
  mov    $0x1,%r13d
L490:
  add    $0x1,%r13d
  jmp    L453
L578:
  mov    $0x8,%ebp
  mov    %r15d,%esi
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  sub    %r15d,%ebp
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  mov    %ebp,%esi
  call   <printf@plt>
  mov    0x24(%rsp),%ebx
  cmp    %r13d,%ebx
  jle    L501
  mov    $0x1,%r14d
L703:
  add    $0x1,%r14d
  jmp    L577
L307:
  mov    $0x6,%ebp
  mov    %ebx,%esi
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  sub    %ebx,%ebp
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  mov    %ebp,%esi
  call   <printf@plt>
  mov    0x1c(%rsp),%r12d
  cmp    %r12d,%r14d
  jge    L459
  mov    $0x1,%r15d
L372:
  add    $0x1,%r15d
  jmp    L658
L663:
  mov    $0x1,%r12d
L20:
  mov    %r12d,%ebx
  xor    %ebp,%ebp
  mov    %eax,%r12d
L441:
  add    $0x1,%ebx
  jmp    L746
L639:
  cmp    %ebx,%r15d
  jg     L578
L230:
  mov    %ebx,%r15d
  mov    $0x1,%r14d
  jmp    L661
L621:
  cmp    %r12d,%ebx
  jg     L307
L139:
  mov    %r12d,%ebx
  mov    $0x1,%r15d
  jmp    L634
L243:
  cmp    %r14d,%r13d
  jg     L132
L48:
  mov    %r14d,%r13d
  mov    $0x1,%esi
  jmp    L64
L92:
  cmp    %r15d,%r14d
  jg     L8
L533:
  mov    %r15d,%r14d
  mov    $0x1,%r13d
  jmp    L404
L237:
  mov    $0x2,%esi
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %esi,%esi
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%ebx
  mov    $0x2,%eax
  cmp    %ebp,%ebx
  jle    L442
L736:
  mov    $0x1,%r12d
  jmp    L277
L344:
  mov    $0x3,%ebp
  mov    %r12d,%esi
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  sub    %r12d,%ebp
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  mov    %ebp,%esi
  call   <printf@plt>
  mov    0x10(%rsp),%r14d
  cmp    %ebx,%r14d
  jle    L311
  mov    $0x1,%ebx
  jmp    L441
L4:
  mov    $0xb,%ebp
  mov    %r13d,%esi
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  sub    %r13d,%ebp
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  mov    %ebp,%esi
  call   <printf@plt>
  mov    0x30(%rsp),%r12d
  cmp    %ebx,%r12d
  jle    L623
  mov    $0x1,%esi
  jmp    L450
L594:
  mov    $0xe,%ebp
L297:
  sub    %esi,%ebp
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L369
L321:
  mov    $0x7,%ebp
  mov    %r15d,%esi
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  sub    %r15d,%ebp
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  mov    %ebp,%esi
  call   <printf@plt>
  mov    0x20(%rsp),%r13d
  cmp    %r13d,%r12d
  jge    L488
  mov    $0x1,%eax
  jmp    L536
L756:
  mov    $0x5,%ebp
  mov    %ebx,%esi
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  sub    %ebx,%ebp
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  mov    %ebp,%esi
  call   <printf@plt>
  mov    0x18(%rsp),%r14d
  cmp    %r14d,%r13d
  jge    L188
  mov    $0x1,%eax
  jmp    L178
L308:
  mov    $0x9,%ebp
  mov    %r14d,%esi
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  sub    %r14d,%ebp
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  mov    %ebp,%esi
  call   <printf@plt>
  mov    0x28(%rsp),%r12d
  cmp    %ebx,%r12d
  jle    L550
  mov    $0x1,%eax
  jmp    L160
L680:
  mov    $0xd,%ebp
  jmp    L297
L488:
  mov    0x24(%rsp),%ebx
  mov    $0x1,%r14d
  cmp    %ebx,%r13d
  jl     L703
  jmp    L100
L501:
  mov    0x28(%rsp),%r12d
  mov    $0x1,%r14d
  cmp    %r12d,%ebx
  jl     L646
  jmp    L533
L188:
  mov    0x1c(%rsp),%r12d
  mov    $0x1,%r15d
  cmp    %r12d,%r14d
  jl     L372
  jmp    L21
L9:
  mov    0x30(%rsp),%r12d
  mov    $0x1,%r13d
  cmp    %r12d,%ebx
  jl     L257
  jmp    L48
L311:
  mov    0x14(%rsp),%r13d
  mov    $0x1,%ebx
  cmp    %r13d,%r14d
  jl     L190
  jmp    L773
L459:
  mov    0x20(%rsp),%r13d
  mov    $0x1,%r15d
  cmp    %r13d,%r12d
  jl     L99
  jmp    L230
L358:
  mov    0x18(%rsp),%r14d
  mov    $0x1,%ebx
  cmp    %r14d,%r13d
  jl     L745
  jmp    L139
L623:
  mov    0x34(%rsp),%eax
  mov    $0x1,%esi
  cmp    %eax,%r12d
  jl     L782
  jmp    L355
L550:
  mov    0x2c(%rsp),%ebx
  mov    $0x1,%r13d
  cmp    %ebx,%r12d
  jl     L490
  jmp    L66
L6:
  mov    $0x1,%r12d
  mov    $0x1,%eax
  jmp    L542
L154:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D44
datatype: string
name: read_data
arguments: tag: D131
datatype: string
name: read_data
arguments: tag: D14
datatype: string
name: read_data
arguments: tag: D273
datatype: string

tool: D44: %d 

tool: D131: cnt: %d


tool: D14: pos: %d


tool: D273: idx: %d


assistant: ```c
int main(int argc, char **argv) {
  srand((unsigned)time(NULL));
  int a[15];
  int pos = 0, cnt = 1, max = 0, i;
  for (i = 0; i < 15; ++i)
    a[i] = rand() % 9;
  for (i = 0; i < 15; ++i)
    printf("%d ", a[i]);
  printf("\n");
  for (i = 1; i < 15; ++i) {
    if (a[i] > a[i - 1])
      ++cnt;
    else {
      if (cnt > max) {
        max = cnt;
        pos = i - cnt;
        printf("cnt: %d\n", cnt);
        printf("pos: %d\n", pos);
        cnt = 1;
      } else
        cnt = 1;
    }
  }
  printf("idx: %d\n", pos);
  return 0;
}
```