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

```asm
<UI_dup_input_boolean>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r14
  mov    %rsi,%rbp
  mov    %rdx,%r12
  mov    %rcx,%r13
  mov    %r8,%rbx
  mov    %r9d,%r15d
  test   %rsi,%rsi
  je     L13
  mov    %rsi,%rdi
  call   <BUF_strdup@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L62
L13:
  test   %r12,%r12
  je     L118
  mov    %r12,%rdi
  call   <BUF_strdup@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L18
L118:
  test   %r13,%r13
  je     L63
  mov    %r13,%rdi
  call   <BUF_strdup@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L20
L63:
  test   %rbx,%rbx
  je     L116
  mov    %rbx,%rdi
  call   <BUF_strdup@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L60
L116:
  sub    $0x8,%rsp
  push   0x48(%rsp)
  push   %r15
  mov    D89(%rip),%rax
  mov    (%rax),%eax
  push   %rax
  mov    $0x1,%r9d
  mov    %rbx,%r8
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <general_allocate_boolean@plt>
  add    $0x20,%rsp
L57:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L62:
  mov    D25(%rip),%rax
  mov    (%rax),%esi
  mov    D51(%rip),%rax
  mov    (%rax),%edi
  call   <UIerr@plt>
  mov    %rbp,%r13
  mov    %rbp,%r12
  jmp    L51
L18:
  mov    D25(%rip),%rax
  mov    (%rax),%esi
  mov    D51(%rip),%rax
  mov    (%rax),%edi
  call   <UIerr@plt>
  mov    %r12,%r13
  jmp    L51
L20:
  mov    D25(%rip),%rax
  mov    (%rax),%esi
  mov    D51(%rip),%rax
  mov    (%rax),%edi
  call   <UIerr@plt>
  jmp    L51
L60:
  mov    D25(%rip),%rax
  mov    (%rax),%esi
  mov    D51(%rip),%rax
  mov    (%rax),%edi
  call   <UIerr@plt>
L51:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    $0x0,%edi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L57
```

assistant: ```c
int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, const char *ok_chars, const char *cancel_chars, int flags, char *result_buf) {
  char *prompt_copy = NULL;
  char *action_desc_copy = NULL;
  char *ok_chars_copy = NULL;
  char *cancel_chars_copy = NULL;
  if (prompt) {
    prompt_copy = BUF_strdup(prompt);
    if (prompt_copy == NULL) {
      UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE);
      goto err;
    }
  }
  if (action_desc) {
    action_desc_copy = BUF_strdup(action_desc);
    if (action_desc_copy == NULL) {
      UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE);
      goto err;
    }
  }
  if (ok_chars) {
    ok_chars_copy = BUF_strdup(ok_chars);
    if (ok_chars_copy == NULL) {
      UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE);
      goto err;
    }
  }
  if (cancel_chars) {
    cancel_chars_copy = BUF_strdup(cancel_chars);
    if (cancel_chars_copy == NULL) {
      UIerr(UI_F_UI_DUP_INPUT_BOOLEAN, ERR_R_MALLOC_FAILURE);
      goto err;
    }
  }
  return general_allocate_boolean(ui, prompt_copy, action_desc_copy, ok_chars_copy, cancel_chars_copy, 1, UIT_BOOLEAN, flags, result_buf);
err:
  free(prompt_copy);
  free(action_desc_copy);
  free(ok_chars_copy);
  free(cancel_chars_copy);
  return -1;
}
```