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

```asm
<find_commit_seq_msg>:
  endbr64
  push   %r15
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %r9,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  movslq %edx,%rbp
  push   %rbx
  movslq %esi,%rbx
  lea    -0xf(%r12,%rbp,1),%r15
  sub    $0x28,%rsp
  mov    0x60(%rsp),%rax
  mov    %r8,(%rsp)
  mov    %rax,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  movq   $0x0,0x10(%rsp)
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  xor    %edi,%edi
  cmp    %ebp,%ebx
  setle  %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmp    $0x4000000,%ebp
  setle  %dil
  call   <assert@plt>
  xor    %edi,%edi
  test   %r13,%r13
  setne  %dil
  add    %r12,%rbx
  call   <assert@plt>
  test   %r14d,%r14d
  je     L1
  lea    0x10(%rsp),%r14
  cmp    %r15,%rbx
  jb     L74
  nopl   0x0(%rax,%rax,1)
L85:
  mov    (%rsp),%rax
  movl   $0x0,(%rax)
L31:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L89
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L96:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <check_commit_msg_body@plt>
  test   %rax,%rax
  jne    L118
L3:
  cmp    %r15,%rbx
  je     L85
L74:
  movzbl (%rbx),%eax
  mov    %rbx,%rbp
  add    $0x1,%rbx
  cmp    $0x74,%al
  jne    L3
  jmp    L96
  nopl   (%rax)
L1:
  cmp    %r15,%rbx
  ja     L85
  lea    0x10(%rsp),%rbp
  jmp    L78
  nopl   0x0(%rax)
L126:
  sub    $0x1,%r15
  cmp    %rbx,%r15
  jb     L85
L78:
  cmpb   $0x74,(%r15)
  jne    L126
  lea    0x1(%r15),%rdi
  mov    %rbp,%rsi
  call   <check_commit_msg_body@plt>
  test   %rax,%rax
  je     L126
  mov    (%rsp),%rax
  mov    0x8(%rsp),%rcx
  mov    %r15,%rdx
  sub    %r12,%rdx
  movl   $0x1,(%rax)
  mov    0x10(%rsp),%rax
  mov    %rax,(%rcx)
  mov    %edx,0x0(%r13)
  jmp    L31
  xchg   %ax,%ax
L118:
  mov    (%rsp),%rax
  mov    0x8(%rsp),%rcx
  sub    %r12,%rbp
  movl   $0x1,(%rax)
  mov    0x10(%rsp),%rax
  mov    %rax,(%rcx)
  mov    %ebp,0x0(%r13)
  jmp    L31
L89:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int find_commit_seq_msg(void *addr, int from_off, int to_off, int fwd, int *found, int *roff, long long *commit_seq) {
  char *bp;
  char *ep;
  long long cseq = 0LL;
  assert(addr != NULL);
  assert(from_off <= to_off);
  assert(to_off <= (1 << 26));
  assert(roff != NULL);
  if (fwd) {
    bp = (char *)addr + from_off;
    ep = (char *)addr + to_off;
    while (bp < ep - (1 + sizeof(int) + sizeof(long long) + sizeof(unsigned short))) {
      if (*bp == 't' && check_commit_msg_body(bp + 1, &cseq)) {
        *found = 1;
        *commit_seq = cseq;
        *roff = (bp - (char *)addr);
        return 0;
      }
      bp++;
    }
  } else {
    bp = (char *)addr + from_off;
    ep = (char *)addr + to_off - (1 + sizeof(int) + sizeof(long long) + sizeof(unsigned short));
    while (ep >= bp) {
      if (*ep == 't' && check_commit_msg_body(ep + 1, &cseq)) {
        *found = 1;
        *commit_seq = cseq;
        *roff = (ep - (char *)addr);
        return 0;
      }
      ep--;
    }
  }
  *found = 0;
  return 0;
}
```