user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<negamax_create_dist_map>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %ecx,%r12d
  push   %rbx
  mov    %edx,%ebx
  imul   %esi,%ebx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %esi,%eax
  mov    %esi,-0x44(%rbp)
  mov    %ebx,%edi
  neg    %eax
  mov    $0x4,%esi
  movl   $0xffffffff,-0x50(%rbp)
  mov    %eax,-0x4c(%rbp)
  movl   $0x1,-0x48(%rbp)
  call   <calloc@plt>
  mov    %rsp,%rcx
  mov    %rax,%r15
  movslq %r12d,%rax
  movl   $0x1,(%r15,%rax,4)
  movslq %ebx,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rsi
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rsi
  and    $0xfffffffffffffff0,%rdx
  sub    %rsi,%rcx
  cmp    %rcx,%rsp
  je     L229
L237:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L237
L229:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L54
L213:
  lea    0x3(%rsp),%rdx
  mov    %rax,%rdi
  and    $0xff0,%eax
  movl   $0x1,-0x58(%rbp)
  mov    %rdx,%rcx
  mov    %rax,-0x78(%rbp)
  and    $0xfffffffffffffff0,%rdi
  sub    $0x8,%rax
  shr    $0x2,%rcx
  movl   $0x1,-0x5c(%rbp)
  and    $0xfffffffffffffffc,%rdx
  mov    %r12d,0x0(,%rcx,4)
  mov    %rdx,%r9
  mov    %rdi,-0x70(%rbp)
  mov    %rax,-0x80(%rbp)
  nopw   0x0(%rax,%rax,1)
L185:
  mov    -0x70(%rbp),%rdx
  mov    %rsp,%rax
  addl   $0x1,-0x5c(%rbp)
  mov    %rsp,-0x68(%rbp)
  and    $0xfffffffffffff000,%rdx
  sub    %rdx,%rax
  cmp    %rax,%rsp
  je     L166
L238:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L238
L166:
  mov    -0x78(%rbp),%rax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L3
  mov    -0x80(%rbp),%rax
  orq    $0x0,(%rsp,%rax,1)
L3:
  mov    %rsp,%r11
  xor    %r8d,%r8d
  xor    %r12d,%r12d
  nopl   0x0(%rax)
L18:
  mov    (%r9,%r8,4),%edi
  mov    $0xffffffff,%ecx
  xor    %esi,%esi
  lea    0x1(%rdi),%r10d
  add    %edi,%ecx
  js     L125
L243:
  cmp    %ecx,%ebx
  jl     L125
  test   %rsi,%rsi
  je     L138
  cmp    $0x2,%esi
  je     L228
L91:
  movslq %ecx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    (%r14,%rax,4),%eax
  test   %eax,%eax
  jne    L125
L90:
  lea    (%r15,%rdx,1),%rax
  mov    (%rax),%edx
  test   %edx,%edx
  jne    L125
  mov    -0x5c(%rbp),%edx
  mov    %edx,(%rax)
  movslq %r12d,%rax
  add    $0x1,%r12d
  mov    %ecx,(%r11,%rax,4)
L125:
  cmp    $0x3,%rsi
  je     L210
L118:
  mov    -0x4c(%rbp,%rsi,4),%ecx
  add    $0x1,%rsi
  add    %edi,%ecx
  jns    L243
  cmp    $0x3,%rsi
  jne    L118
  cs nopw 0x0(%rax,%rax,1)
L210:
  add    $0x1,%r8
  cmp    %r8d,-0x58(%rbp)
  jg     L18
  mov    %r9,%rdi
  mov    %ebx,%edx
  mov    %r11,%rsi
  mov    %r9,-0x58(%rbp)
  call   <memcpy@plt>
  test   %r12d,%r12d
  mov    -0x68(%rbp),%rsp
  mov    -0x58(%rbp),%r9
  je     L146
  mov    %r12d,-0x58(%rbp)
  jmp    L185
  nopl   (%rax)
L138:
  mov    %edi,%eax
  cltd
  idiv   %r13d
  test   %edx,%edx
  jne    L91
  jmp    L118
  nopl   0x0(%rax,%rax,1)
L228:
  mov    %r10d,%eax
  cltd
  idiv   %r13d
  test   %edx,%edx
  je     L118
  movslq %ecx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    (%r14,%rax,4),%eax
  test   %eax,%eax
  je     L90
  jmp    L118
L146:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L135
  lea    -0x28(%rbp),%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L54:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L213
L135:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int *negamax_create_dist_map(int *map, int map_width, int map_height, int map_position) {
  int map_length = map_width * map_height;
  int map_moves[4] = {-1, -map_width, 1, map_width};
  int dist_score = 1;
  int *dist_map = calloc(map_length, sizeof(int));
  dist_map[map_position] = 1;
  int queue[map_length];
  int queue_length = 1;
  queue[0] = map_position;
  while (queue_length) {
    dist_score++;
    int buff[map_length];
    int buff_length = 0;
    for (int i = 0; i < queue_length; i++) {
      int curr_pos = queue[i];
      for (int move = 0; move < 4; move++) {
        int next_pos = curr_pos + map_moves[move];
        if (next_pos < 0 || next_pos > map_length)
          continue;
        if (move == 0 && curr_pos % map_width == 0)
          continue;
        if (move == 2 && (curr_pos + 1) % map_width == 0)
          continue;
        if (map[next_pos] || dist_map[next_pos])
          continue;
        dist_map[next_pos] = dist_score;
        buff[buff_length++] = next_pos;
      }
    }
    memcpy(queue, buff, map_length);
    queue_length = buff_length;
  }
  return dist_map;
}
```