user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<test>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  movl   $0x1,-0x8(%rbp)
  jmp    L36
L38:
  movl   $0x1,-0x4(%rbp)
  jmp    L67
L28:
  mov    $0x1,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  addl   $0x1,-0x4(%rbp)
L67:
  mov    -0x8(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x4(%rbp)
  jle    L28
  mov    -0x8(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,-0x4(%rbp)
  mov    $0x1,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    $0x2,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  add    $0x3,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L51
L65:
  mov    $0x1,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  addl   $0x1,-0x4(%rbp)
L51:
  mov    -0x4(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jle    L65
  addl   $0x1,-0x8(%rbp)
L36:
  mov    -0x14(%rbp),%eax
  sub    $0x2,%eax
  cmp    %eax,-0x8(%rbp)
  jl     L38
  cmpl   $0x2,-0x14(%rbp)
  jle    L86
  mov    -0x14(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x8(%rbp)
  movl   $0x1,-0x4(%rbp)
  jmp    L70
L87:
  mov    $0x1,%edi
  call   <hash@plt>
  mov    -0x14(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  addl   $0x1,-0x4(%rbp)
L70:
  mov    -0x14(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jg     L87
  mov    $0x1,%edi
  call   <hash@plt>
  mov    -0x14(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    $0x2,%edi
  call   <hash@plt>
  mov    -0x14(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
L86:
  mov    -0x14(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  jmp    L44
L120:
  movl   $0x1,-0x4(%rbp)
  jmp    L11
L124:
  mov    $0x1,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  addl   $0x1,-0x4(%rbp)
L11:
  mov    -0x4(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jle    L124
  mov    -0x8(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,-0x4(%rbp)
  mov    $0x2,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,%edi
  call   <hash@plt>
  addl   $0x1,-0x8(%rbp)
L44:
  mov    -0x8(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jle    L120
  nop
  nop
  leave
  ret
```

assistant: ```c
void test(int M) {
  int i, j;
  for (i = 1; i <= M - 3; i++) {
    for (j = 1; j <= i + 1; j++) {
      {
        hash(1);
        hash(i);
        hash(j);
      };
    }
    j = i + 2;
    {
      hash(1);
      hash(i);
      hash(i + 2);
    };
    {
      hash(2);
      hash(i);
      hash(i + 2);
    };
    for (j = i + 3; j <= M; j++) {
      {
        hash(1);
        hash(i);
        hash(j);
      };
    }
  }
  if (M >= 3) {
    i = M - 2;
    for (j = 1; j <= M - 1; j++) {
      {
        hash(1);
        hash(M - 2);
        hash(j);
      };
    }
    {
      hash(1);
      hash(M - 2);
      hash(M);
    };
    {
      hash(2);
      hash(M - 2);
      hash(M);
    };
  }
  for (i = M - 1; i <= M; i++) {
    for (j = 1; j <= M; j++) {
      {
        hash(1);
        hash(i);
        hash(j);
      };
    }
    j = i + 2;
    {
      hash(2);
      hash(i);
      hash(i + 2);
    };
  }
}
```