user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ui_box>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    %ecx,-0x20(%rbp)
  mov    %r8d,-0x24(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <move@plt>
  movl   $0x0,-0x4(%rbp)
  jmp    L162
L63:
  cmpl   $0x0,-0x1c(%rbp)
  je     L52
  cmpl   $0x0,-0x4(%rbp)
  jne    L52
  mov    D28(%rip),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <addch@plt>
  jmp    L64
L52:
  cmpl   $0x0,-0x1c(%rbp)
  je     L84
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x20(%rbp)
  jg     L84
  mov    D52(%rip),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <addch@plt>
  jmp    L64
L84:
  mov    D31(%rip),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <addch@plt>
L64:
  addl   $0x1,-0x4(%rbp)
L162:
  mov    -0x4(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L63
  cmpl   $0x1,-0x1c(%rbp)
  jle    L36
  jmp    L174
L131:
  addl   $0x1,-0x14(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <move@plt>
  mov    D2(%rip),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <addch@plt>
  cmpl   $0x0,-0x24(%rbp)
  je     L195
  movl   $0x2,-0x4(%rbp)
  jmp    L66
L160:
  mov    $0x20,%edi
  call   <addch@plt>
  addl   $0x1,-0x4(%rbp)
L66:
  mov    -0x4(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L160
  jmp    L90
L195:
  mov    -0x18(%rbp),%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  lea    -0x1(%rax),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <move@plt>
L90:
  mov    D2(%rip),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <addch@plt>
L174:
  subl   $0x1,-0x1c(%rbp)
  cmpl   $0x1,-0x1c(%rbp)
  jg     L131
  addl   $0x1,-0x14(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <move@plt>
  movl   $0x0,-0x4(%rbp)
  jmp    L29
L1:
  cmpl   $0x0,-0x4(%rbp)
  jne    L204
  mov    D66(%rip),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <addch@plt>
  jmp    L168
L204:
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x20(%rbp)
  jg     L16
  mov    D54(%rip),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <addch@plt>
  jmp    L168
L16:
  mov    D31(%rip),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <addch@plt>
L168:
  addl   $0x1,-0x4(%rbp)
L29:
  mov    -0x4(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L1
L36:
  nop
  leave
  ret
```

assistant: ```c
void ui_box(int y, int x, int height, int width, int fill) {
  int i;
  move(y, x);
  for (i = 0; i < width; i++) {
    if (height && i == 0) {
      addch(ACS_ULCORNER);
    } else if (height && i + 1 >= width) {
      addch(ACS_URCORNER);
    } else {
      addch(ACS_HLINE);
    }
  }
  if (height > 1) {
    while (--height > 1) {
      move(++y, x);
      addch(ACS_VLINE);
      if (fill) {
        for (i = 2; i < width; i++) {
          addch(' ');
        }
      } else {
        move(y, x + width - 1);
      }
      addch(ACS_VLINE);
    }
    move(++y, x);
    for (i = 0; i < width; i++) {
      if (i == 0) {
        addch(ACS_LLCORNER);
      } else if (i + 1 >= width) {
        addch(ACS_LRCORNER);
      } else {
        addch(ACS_HLINE);
      }
    }
  }
}
```