user: Translate the below assembly code into C programming language:

```asm
<negamax_create_dist_map>:
  endbr64
  push   %rbp
  imul   %esi,%edx
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  mov    %rdi,%r14
  mov    %edx,%edi
  push   %r13
  mov    %ecx,%r13d
  push   %r12
  mov    %edx,%r12d
  push   %rbx
  mov    %esi,%ebx
  mov    $0x4,%esi
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <calloc@plt>
  mov    %rsp,%rcx
  mov    %rax,%r15
  movslq %r13d,%rax
  movl   $0x1,(%r15,%rax,4)
  movslq %r12d,%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     L0
L220:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L220
L0:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L104
L273:
  lea    0x3(%rsp),%r10
  mov    %rax,%rsi
  and    $0xff0,%eax
  mov    $0x1,%r9d
  mov    %r10,%rdx
  mov    %rax,-0x68(%rbp)
  sub    $0x8,%rax
  and    $0xfffffffffffff000,%rsi
  shr    $0x2,%rdx
  mov    %rsi,-0x60(%rbp)
  and    $0xfffffffffffffffc,%r10
  mov    $0x1,%r8d
  mov    %r13d,0x0(,%rdx,4)
  mov    %rax,-0x70(%rbp)
  nopl   (%rax)
L209:
  mov    %rsp,%rax
  sub    -0x60(%rbp),%rax
  mov    %rsp,-0x48(%rbp)
  add    $0x1,%r8d
  cmp    %rax,%rsp
  je     L260
L151:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rax,%rsp
  jne    L151
L260:
  mov    -0x68(%rbp),%rax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L170
  mov    -0x70(%rbp),%rax
  orq    $0x0,(%rsp,%rax,1)
L170:
  mov    %rsp,%r11
  xor    %esi,%esi
  xor    %r13d,%r13d
  cs nopw 0x0(%rax,%rax,1)
L182:
  mov    (%r10,%rsi,4),%ecx
  mov    %ecx,%edi
  sub    $0x1,%edi
  js     L79
  cmp    %edi,%r12d
  jl     L79
  mov    %ecx,%eax
  cltd
  idiv   %ebx
  test   %edx,%edx
  je     L79
  movslq %edi,%rdx
  lea    0x0(,%rdx,4),%rax
  mov    (%r14,%rdx,4),%edx
  test   %edx,%edx
  jne    L79
  add    %r15,%rax
  mov    (%rax),%edx
  test   %edx,%edx
  jne    L79
  mov    %r8d,(%rax)
  movslq %r13d,%rax
  add    $0x1,%r13d
  mov    %edi,(%r11,%rax,4)
L79:
  mov    %ecx,%eax
  sub    %ebx,%eax
  js     L65
  cmp    %eax,%r12d
  jl     L65
  movslq %eax,%rdi
  lea    0x0(,%rdi,4),%rdx
  mov    (%r14,%rdi,4),%edi
  test   %edi,%edi
  jne    L65
  add    %r15,%rdx
  mov    (%rdx),%edi
  test   %edi,%edi
  jne    L65
  mov    %r8d,(%rdx)
  movslq %r13d,%rdx
  add    $0x1,%r13d
  mov    %eax,(%r11,%rdx,4)
L65:
  mov    %ecx,%edi
  add    $0x1,%edi
  js     L251
  cmp    %edi,%r12d
  jl     L251
  mov    %edi,%eax
  cltd
  idiv   %ebx
  test   %edx,%edx
  je     L251
  movslq %edi,%rdx
  lea    0x0(,%rdx,4),%rax
  mov    (%r14,%rdx,4),%edx
  test   %edx,%edx
  jne    L251
  add    %r15,%rax
  mov    (%rax),%edx
  test   %edx,%edx
  jne    L251
  mov    %r8d,(%rax)
  movslq %r13d,%rax
  add    $0x1,%r13d
  mov    %edi,(%r11,%rax,4)
L251:
  add    %ebx,%ecx
  js     L211
  cmp    %ecx,%r12d
  jl     L211
  movslq %ecx,%rdx
  mov    (%r14,%rdx,4),%edi
  lea    0x0(,%rdx,4),%rax
  test   %edi,%edi
  jne    L211
  add    %r15,%rax
  mov    (%rax),%edx
  test   %edx,%edx
  jne    L211
  mov    %r8d,(%rax)
  movslq %r13d,%rax
  add    $0x1,%r13d
  mov    %ecx,(%r11,%rax,4)
L211:
  add    $0x1,%rsi
  cmp    %esi,%r9d
  jg     L182
  mov    %r10,%rdi
  mov    %r12d,%edx
  mov    %r11,%rsi
  mov    %r8d,-0x54(%rbp)
  mov    %r10,-0x50(%rbp)
  call   <memcpy@plt>
  test   %r13d,%r13d
  mov    -0x48(%rbp),%rsp
  mov    -0x50(%rbp),%r10
  mov    -0x54(%rbp),%r8d
  je     L180
  mov    %r13d,%r9d
  jmp    L209
L180:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L221
  lea    -0x28(%rbp),%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L104:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L273
L221:
  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;
}
```