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

```asm
<negamax_create_dist_map>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,%r14
  mov    %esi,%r13d
  mov    %ecx,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  imul   %esi,%edx
  mov    %edx,%ebx
  movl   $0xffffffff,-0x50(%rbp)
  mov    %esi,%eax
  neg    %eax
  mov    %eax,-0x4c(%rbp)
  movl   $0x1,-0x48(%rbp)
  mov    %esi,-0x44(%rbp)
  mov    $0x4,%esi
  mov    %edx,%edi
  call   <calloc@plt>
  mov    %rax,%rdx
  mov    %rax,-0x58(%rbp)
  movslq %r12d,%rax
  movl   $0x1,(%rdx,%rax,4)
  movslq %ebx,%rax
  shl    $0x2,%rax
  mov    %rax,-0x78(%rbp)
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffffff0,%rdx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L59:
  cmp    %rcx,%rsp
  je     L144
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L59
L144:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L189
  orq    $0x0,-0x8(%rsp,%rax,1)
L189:
  lea    0x3(%rsp),%rax
  mov    %rax,%rdx
  shr    $0x2,%rdx
  and    $0xfffffffffffffffc,%rax
  mov    %rax,-0x60(%rbp)
  mov    %r12d,0x0(,%rdx,4)
  mov    %rsp,-0x70(%rbp)
  mov    -0x78(%rbp),%rax
  lea    0xf(%rax),%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffffff0,%rax
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L71:
  cmp    %rcx,%rsp
  je     L93
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L71
L93:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L99
  orq    $0x0,-0x8(%rsp,%rdx,1)
L99:
  mov    %rsp,%r11
  movl   $0x1,-0x64(%rbp)
  mov    $0x2,%r15d
  jmp    L233
L140:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L175
  orq    $0x0,-0x8(%rsp,%rax,1)
L175:
  mov    %rsp,%r11
  test   %r12d,%r12d
  jle    L195
  mov    %r12d,-0x64(%rbp)
L233:
  mov    $0x0,%r9d
  mov    $0x0,%r12d
  jmp    L250
L217:
  mov    %esi,%eax
  cltd
  idiv   %r13d
  test   %edx,%edx
  jne    L43
  jmp    L281
L80:
  mov    %r10d,%eax
  cltd
  idiv   %r13d
  test   %edx,%edx
  je     L281
  movslq %r8d,%rax
  lea    0x0(,%rax,4),%rdx
  cmpl   $0x0,(%r14,%rax,4)
  je     L221
  jmp    L281
L110:
  cmp    $0x3,%edi
  jg     L145
L281:
  add    $0x1,%rcx
  add    $0x1,%edi
L249:
  mov    %esi,%r8d
  add    -0x50(%rbp,%rcx,4),%r8d
  js     L110
  cmp    %r8d,%ebx
  jl     L110
  test   %ecx,%ecx
  je     L217
  cmp    $0x2,%ecx
  je     L80
L43:
  movslq %r8d,%rax
  lea    0x0(,%rax,4),%rdx
  cmpl   $0x0,(%r14,%rax,4)
  jne    L110
L221:
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  cmpl   $0x0,(%rax)
  jne    L110
  mov    %r15d,(%rax)
  movslq %r12d,%rax
  mov    %r8d,(%r11,%rax,4)
  lea    0x1(%r12),%r12d
  jmp    L110
L145:
  add    $0x1,%r9
  cmp    %r9d,-0x64(%rbp)
  jle    L150
L250:
  mov    -0x60(%rbp),%rax
  mov    (%rax,%r9,4),%esi
  mov    $0x1,%edi
  mov    $0x0,%ecx
  lea    0x1(%rsi),%r10d
  jmp    L249
L150:
  mov    %ebx,%edx
  mov    %r11,%rsi
  mov    -0x60(%rbp),%rdi
  call   <memcpy@plt>
  mov    -0x70(%rbp),%rsp
  test   %r12d,%r12d
  je     L84
  mov    %rsp,-0x70(%rbp)
  add    $0x1,%r15d
  mov    -0x78(%rbp),%rax
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L30:
  cmp    %rdx,%rsp
  je     L140
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L30
L195:
  mov    %ebx,%edx
  mov    %r11,%rsi
  mov    -0x60(%rbp),%rdi
  call   <memcpy@plt>
  mov    -0x70(%rbp),%rsp
L84:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L268
  mov    -0x58(%rbp),%rax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L268:
  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;
}
```