user: What is the c source code of the assembly code below?

```asm
<cmdshell_init_write>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x400,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    %rdx,%r13
  mov    %rcx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x3f8(%rsp)
  xor    %eax,%eax
  movb   $0x0,0x10(%rsp)
  lea    0x10(%rsp),%rsi
  mov    $0x3e8,%edx
  lea    D68(%rip),%rdi
  call   <input_line@plt>
  test   %eax,%eax
  je     L46
  lea    0x10(%rsp),%rdi
  call   <str_isspace@plt>
  test   %rax,%rax
  je     L110
L46:
  mov    %rbp,%rsi
  lea    D113(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L94:
  movb   $0x0,0x10(%rsp)
  lea    0x10(%rsp),%rsi
  mov    $0x3e8,%edx
  lea    D92(%rip),%rdi
  call   <input_line@plt>
  test   %eax,%eax
  je     L6
  lea    0x10(%rsp),%rdi
  call   <str_isspace@plt>
  test   %rax,%rax
  je     L68
L6:
  mov    %rbx,%rsi
  lea    D113(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L199:
  movb   $0x0,0x10(%rsp)
  lea    0x10(%rsp),%rsi
  mov    $0x3e8,%edx
  lea    D134(%rip),%rdi
  call   <input_line@plt>
  test   %eax,%eax
  je     L97
  lea    0x10(%rsp),%rdi
  call   <str_isspace@plt>
  test   %rax,%rax
  je     L13
L97:
  mov    %r13,%rsi
  lea    D113(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%ebx
L80:
  movb   $0x0,0x10(%rsp)
  lea    0x10(%rsp),%rsi
  mov    $0x3e8,%edx
  lea    D197(%rip),%rdi
  call   <input_line@plt>
  test   %eax,%eax
  je     L38
  lea    0x10(%rsp),%rdi
  call   <str_isspace@plt>
  test   %rax,%rax
  je     L1
L38:
  mov    %r12,%rsi
  lea    D113(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
L3:
  or     %ebx,%eax
  sete   %al
  movzbl %al,%eax
  mov    0x3f8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L219
  add    $0x400,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L110:
  lea    0x10(%rsp),%r14
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %r14,%rsi
  lea    D59(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L94
L68:
  lea    0x10(%rsp),%rbp
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  lea    D59(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L199
L13:
  lea    0x10(%rsp),%rdi
  call   <strlen@plt>
  cmp    $0xf,%eax
  jle    L165
  lea    0x10(%rsp),%rsi
  mov    $0xf,%edx
  lea    D163(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%ebx
  jmp    L80
L165:
  lea    0x10(%rsp),%rdi
  call   <str_isdigit@plt>
  test   %eax,%eax
  jne    L7
  lea    0x10(%rsp),%rsi
  lea    D39(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%ebx
  jmp    L80
L7:
  lea    0x8(%rsp),%rdx
  lea    0x10(%rsp),%rdi
  lea    D146(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L147
  lea    0x10(%rsp),%rsi
  lea    D32(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%ebx
  jmp    L80
L147:
  lea    0x10(%rsp),%rbx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rsi
  lea    D59(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%ebx
  jmp    L80
L1:
  lea    0x10(%rsp),%rdi
  lea    D142(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L209
  lea    0x10(%rsp),%rbp
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  lea    D59(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L3
L209:
  lea    0x10(%rsp),%rdi
  lea    D99(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L84
  lea    0x10(%rsp),%rbp
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  lea    D59(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L3
L84:
  lea    0x10(%rsp),%rsi
  lea    D34(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L3
L219:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D68
type_guessed: string
name: read_data
arguments: data_tag: D113
type_guessed: string
name: read_data
arguments: data_tag: D92
type_guessed: string
name: read_data
arguments: data_tag: D134
type_guessed: string
name: read_data
arguments: data_tag: D197
type_guessed: string
name: read_data
arguments: data_tag: D59
type_guessed: string
name: read_data
arguments: data_tag: D163
type_guessed: string
name: read_data
arguments: data_tag: D39
type_guessed: string
name: read_data
arguments: data_tag: D146
type_guessed: string
name: read_data
arguments: data_tag: D32
type_guessed: string
name: read_data
arguments: data_tag: D142
type_guessed: string
name: read_data
arguments: data_tag: D99
type_guessed: string
name: read_data
arguments: data_tag: D34
type_guessed: string

tool: D68: Input source (path): 

tool: D113: Ok unchanged "%s"


tool: D92: Input destination (path): 

tool: D134: Input offset (number >= 0): 

tool: D197: Input cipher (xor, none): 

tool: D59: Ok "%s"


tool: D163: Fail "%s", should be between 1 and %d digits


tool: D39: Fail "%s", should be an unsigned number


tool: D146: %lf

tool: D32: Fail "%s", should be a number


tool: D142: xor

tool: D99: none

tool: D34: Fail "%s", unknown type


assistant: ```c
int cmdshell_init_write(char src[], char dst[], char offset[], char cipher[]) {
  char input[1000];
  int retval, retin;
  int f_bad_offset, f_bad_cipher;
  *input = '\0';
  f_bad_offset = f_bad_cipher = 0;
  retin = input_line("Input source (path): ", input, sizeof input);
  if (!retin || str_isspace(input)) {
    printf("Ok unchanged \"%s\"\n", src);
  } else {
    strcpy(src, input);
    printf("Ok \"%s\"\n", input);
  }
  *input = '\0';
  retin = input_line("Input destination (path): ", input, sizeof input);
  if (!retin || str_isspace(input)) {
    printf("Ok unchanged \"%s\"\n", dst);
  } else {
    strcpy(dst, input);
    printf("Ok \"%s\"\n", input);
  }
  *input = '\0';
  retin = input_line("Input offset (number >= 0): ", input, sizeof input);
  if (!retin || str_isspace(input)) {
    printf("Ok unchanged \"%s\"\n", offset);
  } else {
    double tmp;
    if (strlen(input) > 15) {
      f_bad_offset = 1;
      printf("Fail \"%s\", should be between 1 and %d digits\n", input, 15);
    } else if (!str_isdigit(input)) {
      f_bad_offset = 1;
      printf("Fail \"%s\", should be an unsigned number\n", input);
    } else if (sscanf(input, "%lf", &tmp) == 1) {
      strcpy(offset, input);
      printf("Ok \"%s\"\n", input);
    } else {
      f_bad_offset = 1;
      printf("Fail \"%s\", should be a number\n", input);
    }
  }
  *input = '\0';
  retin = input_line("Input cipher (xor, none): ", input, sizeof input);
  if (!retin || str_isspace(input)) {
    printf("Ok unchanged \"%s\"\n", cipher);
  } else {
    if (strcmp(input, "xor") == 0) {
      strcpy(cipher, input);
      printf("Ok \"%s\"\n", input);
    } else if (strcmp(input, "none") == 0) {
      strcpy(cipher, input);
      printf("Ok \"%s\"\n", input);
    } else {
      f_bad_cipher = 1;
      printf("Fail \"%s\", unknown type\n", input);
    }
  }
  retval = !(f_bad_offset || f_bad_cipher);
  return retval;
}
```