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

```asm
<rate_matching_lte>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %rdx,-0x30(%rbp)
  mov    %ecx,-0x34(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    -0x24(%rbp),%edx
  mov    %edx,%eax
  shl    $0x3,%eax
  add    %eax,%edx
  mov    -0x28(%rbp),%eax
  shl    $0x2,%eax
  cmp    %eax,%edx
  jb     L96
  mov    -0x24(%rbp),%eax
  shr    %eax
  cmp    %eax,-0x28(%rbp)
  jae    L84
L96:
  mov    -0x28(%rbp),%edx
  mov    -0x24(%rbp),%eax
  mov    %eax,%esi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <msg@plt>
  mov    $0xffffffff,%eax
  jmp    L129
L84:
  movl   $0x0,-0x18(%rbp)
  jmp    L16
L97:
  mov    -0x18(%rbp),%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x18(%rbp),%ecx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x18(%rbp)
L16:
  mov    -0x18(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jb     L97
  movl   $0x0,-0x18(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,%edi
  call   <pset_taus_seed@plt>
  mov    -0x28(%rbp),%eax
  sub    -0x24(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jns    L44
  negl   -0xc(%rbp)
  movl   $0x1,-0x10(%rbp)
L44:
  mov    -0x28(%rbp),%eax
  mov    %eax,%edi
  call   <log2_approx@plt>
  add    $0x1,%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  jmp    L0
L135:
  mov    $0x0,%eax
  call   <ptaus@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  and    -0x8(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jae    L2
  mov    -0x14(%rbp),%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jns    L122
  mov    -0x14(%rbp),%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  and    $0xc0,%eax
  cmp    $0xc0,%eax
  jne    L2
L122:
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x14(%rbp)
L2:
  mov    -0x14(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jae    L135
  cmpl   $0x0,-0x10(%rbp)
  jne    L42
  mov    -0x14(%rbp),%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x14(%rbp),%ecx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  and    $0x7f,%edx
  mov    %dl,(%rax)
  jmp    L67
L42:
  mov    -0x14(%rbp),%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x14(%rbp),%ecx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  or     $0xffffffc0,%edx
  mov    %dl,(%rax)
L67:
  addl   $0x1,-0x18(%rbp)
L0:
  mov    -0xc(%rbp),%eax
  cmp    %eax,-0x18(%rbp)
  jb     L135
  mov    $0x0,%eax
L129:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D5
type_guessed: string

tool: D5: [PHY][CODING] Rate matching parameter error (N_coded %d, N_input %d), exiting


assistant: ```c
int rate_matching_lte(unsigned int N_coded, unsigned int N_input, unsigned char *inPtr, unsigned int off) {
  unsigned int i, U, Umod, rep_flag = 0;
  unsigned int Mod_input;
  int N_punctured;
  if ((9 * N_coded < (N_input << 2)) || (N_input < (N_coded >> 1))) {
    msg("[PHY][CODING] Rate matching parameter error (N_coded %d, N_input %d), exiting\n", N_coded, N_input);
    return (-1);
  }
  for (i = 0; i < N_input; i++)
    inPtr[i] |= 0x80;
  i = 0;
  pset_taus_seed(off);
  N_punctured = N_input - N_coded;
  if (N_punctured < 0) {
    N_punctured = -N_punctured;
    rep_flag = 1;
  }
  Mod_input = (1 << (1 + log2_approx(N_input))) - 1;
  while (i < N_punctured) {
    do {
      U = ptaus();
      Umod = U & Mod_input;
      if ((Umod < N_input) && (((inPtr[Umod] & 0x80) == 0) || ((inPtr[Umod] & 0xc0) == 0xc0)))
        Umod = N_input;
    } while (Umod >= N_input);
    if (rep_flag == 0)
      inPtr[Umod] &= 0x7f;
    else
      inPtr[Umod] |= 0xc0;
    i++;
  }
  return (0);
}
```