user: Converte this assembly snippet into its equivalent C code:

```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     L98
  mov    %rsi,%rdi
  call   <OPENSSL_strdup@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L38
L98:
  test   %r12,%r12
  je     L94
  mov    %r12,%rdi
  call   <OPENSSL_strdup@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L35
L94:
  test   %r13,%r13
  je     L52
  mov    %r13,%rdi
  call   <OPENSSL_strdup@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L44
L52:
  test   %rbx,%rbx
  je     L28
  mov    %rbx,%rdi
  call   <OPENSSL_strdup@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L84
L28:
  sub    $0x8,%rsp
  push   0x48(%rsp)
  push   %r15
  mov    D71(%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
L16:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L38:
  mov    D51(%rip),%rax
  mov    (%rax),%esi
  mov    D72(%rip),%rax
  mov    (%rax),%edi
  call   <UIerr@plt>
  mov    %rbp,%r13
  mov    %rbp,%r12
  jmp    L76
L35:
  mov    D51(%rip),%rax
  mov    (%rax),%esi
  mov    D72(%rip),%rax
  mov    (%rax),%edi
  call   <UIerr@plt>
  mov    %r12,%r13
  jmp    L76
L44:
  mov    D51(%rip),%rax
  mov    (%rax),%esi
  mov    D72(%rip),%rax
  mov    (%rax),%edi
  call   <UIerr@plt>
  jmp    L76
L84:
  mov    D51(%rip),%rax
  mov    (%rax),%esi
  mov    D72(%rip),%rax
  mov    (%rax),%edi
  call   <UIerr@plt>
L76:
  mov    %rbp,%rdi
  call   <OPENSSL_free@plt>
  mov    %r12,%rdi
  call   <OPENSSL_free@plt>
  mov    %r13,%rdi
  call   <OPENSSL_free@plt>
  mov    $0x0,%edi
  call   <OPENSSL_free@plt>
  mov    $0xffffffff,%eax
  jmp    L16
```

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 = OPENSSL_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 = OPENSSL_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 = OPENSSL_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 = OPENSSL_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:
  OPENSSL_free(prompt_copy);
  OPENSSL_free(action_desc_copy);
  OPENSSL_free(ok_chars_copy);
  OPENSSL_free(cancel_chars_copy);
  return -1;
}
```