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

```asm
<cmdshell_init_write>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  mov    $0x3e8,%edx
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rdi,%r13
  lea    D9(%rip),%rdi
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x408,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3f8(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  movb   $0x0,0x10(%rsp)
  mov    %rbp,%rsi
  call   <input_line@plt>
  test   %eax,%eax
  je     L113
  mov    %rbp,%rdi
  call   <str_isspace@plt>
  test   %rax,%rax
  je     L100
L113:
  mov    %r13,%rsi
  lea    D81(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L140:
  mov    $0x3e8,%edx
  mov    %rbp,%rsi
  movb   $0x0,0x10(%rsp)
  lea    D150(%rip),%rdi
  call   <input_line@plt>
  test   %eax,%eax
  je     L154
  mov    %rbp,%rdi
  call   <str_isspace@plt>
  test   %rax,%rax
  je     L37
L154:
  mov    %r12,%rsi
  lea    D81(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L181:
  mov    $0x3e8,%edx
  mov    %rbp,%rsi
  movb   $0x0,0x10(%rsp)
  lea    D112(%rip),%rdi
  call   <input_line@plt>
  test   %eax,%eax
  je     L193
  mov    %rbp,%rdi
  call   <str_isspace@plt>
  test   %rax,%rax
  je     L218
L193:
  mov    %r15,%rsi
  lea    D81(%rip),%rdi
  xor    %eax,%eax
  xor    %ebx,%ebx
  call   <printf@plt>
L87:
  mov    $0x3e8,%edx
  mov    %rbp,%rsi
  movb   $0x0,0x10(%rsp)
  lea    D137(%rip),%rdi
  call   <input_line@plt>
  test   %eax,%eax
  je     L31
  mov    %rbp,%rdi
  call   <str_isspace@plt>
  test   %rax,%rax
  je     L200
L31:
  mov    %r14,%rsi
  lea    D81(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L38:
  mov    %ebx,%eax
  xor    $0x1,%eax
  mov    0x3f8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L213
  add    $0x408,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L200:
  lea    D87(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    %rbp,%rsi
  test   %rax,%rax
  je     L159
  lea    D86(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    %rbp,%rsi
  test   %rax,%rax
  jne    L212
L159:
  mov    %r14,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  lea    D77(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L38
  nopl   0x0(%rax,%rax,1)
L100:
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  lea    D77(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L140
  nopl   0x0(%rax)
L37:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  lea    D77(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L181
  nopl   0x0(%rax)
L218:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    $0xf,%eax
  jle    L209
  mov    $0xf,%edx
  mov    %rbp,%rsi
  xor    %eax,%eax
  mov    $0x1,%ebx
  lea    D125(%rip),%rdi
  call   <printf@plt>
  jmp    L87
  nopl   (%rax)
L209:
  mov    %rbp,%rdi
  call   <str_isdigit@plt>
  test   %eax,%eax
  je     L126
  lea    D73(%rip),%rsi
  lea    0x8(%rsp),%rdx
  mov    %rbp,%rdi
  call   <sscanf@plt>
  mov    %rbp,%rsi
  cmp    $0x1,%eax
  je     L102
  lea    D48(%rip),%rdi
  xor    %eax,%eax
  mov    $0x1,%ebx
  call   <printf@plt>
  jmp    L87
L126:
  mov    %rbp,%rsi
  lea    D105(%rip),%rdi
  mov    $0x1,%ebx
  call   <printf@plt>
  jmp    L87
  nopl   0x0(%rax)
L212:
  lea    D98(%rip),%rdi
  xor    %eax,%eax
  mov    $0x1,%ebx
  call   <printf@plt>
  jmp    L38
  nopl   0x0(%rax,%rax,1)
L102:
  mov    %r15,%rdi
  xor    %ebx,%ebx
  call   <strcpy@plt>
  mov    %rbp,%rsi
  lea    D77(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L87
L213:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D9
data_type: string
name: parse_data
arguments: data_label: D81
data_type: string
name: parse_data
arguments: data_label: D150
data_type: string
name: parse_data
arguments: data_label: D112
data_type: string
name: parse_data
arguments: data_label: D137
data_type: string
name: parse_data
arguments: data_label: D87
data_type: string
name: parse_data
arguments: data_label: D86
data_type: string
name: parse_data
arguments: data_label: D77
data_type: string
name: parse_data
arguments: data_label: D125
data_type: string
name: parse_data
arguments: data_label: D73
data_type: string
name: parse_data
arguments: data_label: D48
data_type: string
name: parse_data
arguments: data_label: D105
data_type: string
name: parse_data
arguments: data_label: D98
data_type: string

tool: D9: Input source (path): 

tool: D81: Ok unchanged "%s"


tool: D150: Input destination (path): 

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

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

tool: D87: xor

tool: D86: none

tool: D77: Ok "%s"


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


tool: D73: %lf

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


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


tool: D98: 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;
}
```