user: Please show me the C implementation that matches the assembly code listed below:

```asm
<find_n_param>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  lea    D5(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x138,%rsp
  mov    %rdx,0x18(%rsp)
  mov    %ecx,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x128(%rsp)
  xor    %eax,%eax
  call   <getenv@plt>
  mov    %eax,%edi
  call   <atoi@plt>
  mov    %rbx,%rdi
  mov    %eax,%r13d
  call   <strlen@plt>
  test   %r15,%r15
  je     L29
  test   %r13d,%r13d
  jle    L29
  mov    %eax,%r12d
  mov    %eax,%r8d
  lea    0x20(%rsp),%rbp
  xor    %r14d,%r14d
  not    %r12d
  shr    $0x1f,%r12d
  mov    %r12d,0x14(%rsp)
  nopl   0x0(%rax)
L168:
  movslq %r14d,%r10
  movzbl (%r15,%r10,1),%esi
  cmp    $0x3d,%sil
  je     L76
  mov    %rbp,%r9
  lea    0x1(%r14),%eax
  xor    %edx,%edx
  sub    %r10,%r9
  cmpb   $0x0,0x14(%rsp)
  cltq
  jne    L192
  jmp    L76
  nopl   0x0(%rax)
L116:
  cmp    $0x3d,%sil
  je     L40
L192:
  add    $0x1,%edx
  mov    %sil,-0x1(%r9,%rax,1)
  mov    %eax,%r14d
  movzbl (%r15,%rax,1),%esi
  add    $0x1,%rax
  cmp    %edx,%r8d
  jge    L116
L40:
  movslq %edx,%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  mov    %r8d,0xc(%rsp)
  movb   $0x0,0x20(%rsp,%rdx,1)
  mov    0x10(%rsp),%edx
  lea    0x1(%r14),%r12d
  call   <strncmp@plt>
  mov    %rax,%r10
  movslq %r12d,%rax
  add    %r15,%rax
  cmp    %r12d,%r13d
  setg   %dl
  test   %r10,%r10
  je     L64
  cmpb   $0x26,(%rax)
  mov    0xc(%rsp),%r8d
  je     L0
  lea    0x2(%r14),%eax
  cltq
  test   %dl,%dl
  je     L0
  nop
L94:
  cmpb   $0x26,(%r15,%rax,1)
  mov    %eax,%r12d
  setne  %sil
  cmp    %eax,%r13d
  setg   %dl
  add    $0x1,%rax
  test   %dl,%sil
  jne    L94
L0:
  lea    0x1(%r12),%r14d
  cmp    %r14d,%r13d
  jg     L168
L29:
  mov    $0x1,%eax
L57:
  mov    0x128(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L122
  add    $0x138,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L76:
  xor    %edx,%edx
  jmp    L40
L64:
  movzbl (%rax),%esi
  cmp    $0x26,%sil
  je     L63
  test   %dl,%dl
  je     L63
  mov    $0x1,%edx
  jmp    L183
  nopl   0x0(%rax,%rax,1)
L121:
  cmp    %edi,%r13d
  jle    L164
L183:
  mov    0x18(%rsp),%rbx
  movslq %edx,%r8
  lea    (%r12,%rdx,1),%edi
  mov    %sil,-0x1(%rbx,%rdx,1)
  movzbl (%rax,%rdx,1),%esi
  add    $0x1,%rdx
  cmp    $0x26,%sil
  jne    L121
L164:
  add    %r8,0x18(%rsp)
L63:
  mov    0x18(%rsp),%rax
  movb   $0x0,(%rax)
  xor    %eax,%eax
  jmp    L57
L122:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D5
type_infered: string

tool: D5: CONTENT_LENGTH

assistant: ```c
int find_n_param(char *buffer, char *nomeobj, char *valore_out, int n_max) {
  int param_length = atoi(getenv("CONTENT_LENGTH"));
  int i = 0, j = 0;
  char nomeparam[255];
  int n_nomeobj = strlen(nomeobj);
  if (buffer == NULL)
    return 1;
  while (i < param_length) {
    j = 0;
    while ((buffer[i] != '=') && (j <= n_nomeobj)) {
      nomeparam[j] = buffer[i];
      i++;
      j++;
    }
    i++;
    nomeparam[j] = '\0';
    if (strncmp(nomeparam, nomeobj, n_max) == 0) {
      j = 0;
      while ((buffer[i] != '&') && (i < param_length)) {
        valore_out[j] = buffer[i];
        i++;
        j++;
      }
      valore_out[j] = '\0';
      return 0;
    } else {
      while ((buffer[i] != '&') && (i < param_length))
        i++;
      i++;
    }
  }
  return 1;
}
```