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

```asm
<pawnPromotion>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L70
L114:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x5,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbq %al,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x70,%al
  jne    L80
L105:
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %al,-0x5(%rbp)
  cmpb   $0x71,-0x5(%rbp)
  je     L26
  cmpb   $0x62,-0x5(%rbp)
  je     L26
  cmpb   $0x6e,-0x5(%rbp)
  je     L26
  cmpb   $0x72,-0x5(%rbp)
  jne    L105
L26:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x5,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbq %al,%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x5(%rbp),%eax
  mov    %al,(%rdx)
  jmp    L37
L80:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x5,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl 0xe7(%rax),%eax
  movsbq %al,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x50,%al
  jne    L37
L39:
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %al,-0x5(%rbp)
  cmpb   $0x51,-0x5(%rbp)
  je     L47
  cmpb   $0x42,-0x5(%rbp)
  je     L47
  cmpb   $0x4e,-0x5(%rbp)
  je     L47
  cmpb   $0x52,-0x5(%rbp)
  jne    L39
L47:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x5,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl 0xe7(%rax),%eax
  movsbq %al,%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x5(%rbp),%eax
  mov    %al,(%rdx)
L37:
  addl   $0x1,-0x4(%rbp)
L70:
  cmpl   $0x7,-0x4(%rbp)
  jle    L114
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D16
type_infered: string
name: parse_data
arguments: tag: D19
type_infered: string

tool: D16: 
Choose what the pawn promotes to (q, b, n or r): 

tool: D19: 
Choose what the pawn promotes to (Q, B, N or R): 

assistant: ```c
void pawnPromotion(char grid[8][8][33], char pieceTranslator[33]) {
  int x;
  char promotion;
  for (x = 0; x < 8; ++x) {
    if (pieceTranslator[(int)grid[x][0][0]] == 'p') {
      do {
        printf("\nChoose what the pawn promotes to (q, b, n or r): ");
        promotion = getch();
      } while ((promotion != 'q') && (promotion != 'b') && (promotion != 'n') && (promotion != 'r'));
      pieceTranslator[(int)grid[x][0][0]] = promotion;
    } else if (pieceTranslator[(int)grid[x][7][0]] == 'P') {
      do {
        printf("\nChoose what the pawn promotes to (Q, B, N or R): ");
        promotion = getch();
      } while ((promotion != 'Q') && (promotion != 'B') && (promotion != 'N') && (promotion != 'R'));
      pieceTranslator[(int)grid[x][7][0]] = promotion;
    }
  }
  return;
}
```