user: Demonstrate the C code that generates the assembly output below:

```asm
<change_path>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,%rbx
  mov    %rdx,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    (%rsi),%r12d
  mov    0x4(%rsi),%ebp
  movl   $0x3,0x8(%rsi)
  mov    $0x0,%r13d
  mov    $0x1,%r14d
  jmp    L100
L119:
  cmp    $0x4,%eax
  jne    L30
  sub    $0x1,%ebp
  add    $0x1,%r14d
  jmp    L30
L147:
  add    $0x1,%r12d
  add    $0x1,%r14d
L30:
  mov    %ebp,%edx
  mov    %r12d,%esi
  mov    0x8(%rsp),%rdi
  call   <validate_position@plt>
  test   %rax,%rax
  je     L6
  movslq %r13d,%rdx
  lea    (%rdx,%rdx,1),%rax
  lea    (%rax,%rdx,1),%rcx
  mov    %r12d,0x10(%rsp,%rcx,4)
  mov    %ebp,0x14(%rsp,%rcx,4)
  mov    0x8(%rbx),%edx
  mov    %edx,0x18(%rsp,%rcx,4)
  add    $0x1,%r13d
L6:
  mov    0x4(%rbx),%ebp
  mov    (%rbx),%r12d
  mov    0x8(%rbx),%eax
  add    $0x1,%eax
  cmp    $0x5,%eax
  mov    $0x1,%ecx
  cmovge %ecx,%eax
  mov    %eax,0x8(%rbx)
  cmp    $0x4,%r14d
  jg     L102
L100:
  mov    0x8(%rbx),%eax
  cmp    $0x3,%eax
  je     L114
  jg     L119
  cmp    $0x1,%eax
  je     L147
  cmp    $0x2,%eax
  jne    L30
  add    $0x1,%ebp
  add    $0x1,%r14d
  jmp    L30
L114:
  sub    $0x1,%r12d
  add    $0x1,%r14d
  jmp    L30
L102:
  mov    0x4(%r15),%edx
  lea    0x10(%rsp),%rdi
  mov    (%r15),%esi
  call   <score@plt>
  movss  %xmm0,0x8(%rsp)
  cmp    $0x1,%r13d
  jle    L29
  lea    0x1c(%rsp),%r12
  mov    $0x0,%r14d
  mov    $0x1,%ebp
L87:
  mov    0x4(%r15),%edx
  mov    (%r15),%esi
  mov    %r12,%rdi
  call   <score@plt>
  movss  0x8(%rsp),%xmm1
  comiss %xmm0,%xmm1
  minss  %xmm1,%xmm0
  movss  %xmm0,0x8(%rsp)
  cmova  %ebp,%r14d
  add    $0x1,%ebp
  add    $0xc,%r12
  cmp    %ebp,%r13d
  jne    L87
L44:
  movslq %r14d,%r14
  lea    (%r14,%r14,1),%rax
  lea    (%rax,%r14,1),%rdx
  mov    0x10(%rsp,%rdx,4),%edx
  mov    %edx,(%rbx)
  lea    (%rax,%r14,1),%rdx
  mov    0x14(%rsp,%rdx,4),%edx
  mov    %edx,0x4(%rbx)
  add    %r14,%rax
  mov    0x18(%rsp,%rax,4),%eax
  mov    %eax,0x8(%rbx)
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L45
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L29:
  mov    $0x0,%r14d
  jmp    L44
L45:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void change_path(char maze[23][30], int ghost[3], int target[2]) {
  int changes[4][3];
  int i = 1, j = 0, x, y, menor_indice;
  float menor_score, score_aux;
  y = ghost[0];
  x = ghost[1];
  ghost[2] = 3;
  while (i <= 4) {
    switch (ghost[2]) {
    case 1:
      y = y + 1;
      i++;
      break;
    case 2:
      x = x + 1;
      i++;
      break;
    case 3:
      y = y - 1;
      i++;
      break;
    case 4:
      x = x - 1;
      i++;
      break;
    }
    if (validate_position(maze, y, x)) {
      changes[j][0] = y;
      changes[j][1] = x;
      changes[j][2] = ghost[2];
      j++;
    }
    x = ghost[1];
    y = ghost[0];
    ghost[2] = ghost[2] + 1;
    if (ghost[2] > 4) {
      ghost[2] = 1;
    }
  }
  menor_indice = 0;
  menor_score = score(changes[0], target[0], target[1]);
  for (i = 1; i < j; i++) {
    score_aux = score(changes[i], target[0], target[1]);
    if (score_aux < menor_score) {
      menor_score = score_aux;
      menor_indice = i;
    }
  }
  ghost[0] = changes[menor_indice][0];
  ghost[1] = changes[menor_indice][1];
  ghost[2] = changes[menor_indice][2];
}
```