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

```asm
<test>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  movl   $0x1,-0xc(%rbp)
  jmp    L80
L53:
  mov    $0x1,%edi
  call   <hash@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  addl   $0x1,-0xc(%rbp)
L80:
  mov    -0xc(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jle    L53
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L96
L83:
  movl   $0x1,-0x8(%rbp)
  jmp    L86
L112:
  mov    -0xc(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    $0x2,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0xc(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  addl   $0x1,-0x8(%rbp)
L86:
  mov    -0x8(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jle    L112
  addl   $0x1,-0xc(%rbp)
L96:
  mov    -0x18(%rbp),%eax
  add    %eax,%eax
  cmp    %eax,-0xc(%rbp)
  jle    L83
  mov    -0x18(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L89
L122:
  movl   $0x1,-0x8(%rbp)
  jmp    L103
L19:
  mov    -0x18(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0xc(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    $0x3,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0x18(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0xc(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0xc(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    $0x2,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0xc(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  addl   $0x1,-0x8(%rbp)
L103:
  mov    -0x8(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jle    L19
  addl   $0x1,-0xc(%rbp)
L89:
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0xc(%rbp)
  jle    L122
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L136
L109:
  movl   $0x1,-0x8(%rbp)
  jmp    L67
L120:
  mov    -0x18(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0xc(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    $0x3,%edi
  call   <hash@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <hash@plt>
  mov    -0x18(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0xc(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,%edi
  call   <hash@plt>
  addl   $0x1,-0x8(%rbp)
L67:
  mov    -0x8(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jle    L120
  addl   $0x1,-0xc(%rbp)
L136:
  mov    -0x18(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0xc(%rbp)
  jle    L109
  nop
  nop
  leave
  ret
```

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