user: Translate the below assembly code into C programming language:

```asm
<cmdshell_init_write>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  mov    $0x3e8,%edx
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rdi,%r13
  lea    D83(%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     L41
  mov    %rbp,%rdi
  call   <str_isspace@plt>
  test   %rax,%rax
  je     L21
L41:
  mov    %r13,%rsi
  lea    D143(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L144:
  mov    $0x3e8,%edx
  mov    %rbp,%rsi
  movb   $0x0,0x10(%rsp)
  lea    D119(%rip),%rdi
  call   <input_line@plt>
  test   %eax,%eax
  je     L194
  mov    %rbp,%rdi
  call   <str_isspace@plt>
  test   %rax,%rax
  je     L195
L194:
  mov    %r12,%rsi
  lea    D143(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L217:
  mov    $0x3e8,%edx
  mov    %rbp,%rsi
  movb   $0x0,0x10(%rsp)
  lea    D172(%rip),%rdi
  call   <input_line@plt>
  test   %eax,%eax
  je     L148
  mov    %rbp,%rdi
  call   <str_isspace@plt>
  test   %rax,%rax
  je     L67
L148:
  mov    %r15,%rsi
  lea    D143(%rip),%rdi
  xor    %eax,%eax
  xor    %ebx,%ebx
  call   <printf@plt>
L57:
  mov    $0x3e8,%edx
  mov    %rbp,%rsi
  movb   $0x0,0x10(%rsp)
  lea    D113(%rip),%rdi
  call   <input_line@plt>
  test   %eax,%eax
  je     L40
  mov    %rbp,%rdi
  call   <str_isspace@plt>
  test   %rax,%rax
  je     L178
L40:
  mov    %r14,%rsi
  lea    D143(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L129:
  mov    %ebx,%eax
  xor    $0x1,%eax
  mov    0x3f8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L174
  add    $0x408,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L178:
  lea    D179(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    %rbp,%rsi
  test   %rax,%rax
  je     L64
  lea    D164(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    %rbp,%rsi
  test   %rax,%rax
  jne    L3
L64:
  mov    %r14,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  lea    D31(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L129
  nopl   0x0(%rax,%rax,1)
L21:
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  lea    D31(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L144
  nopl   0x0(%rax)
L195:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  lea    D31(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L217
  nopl   0x0(%rax)
L67:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    $0xf,%eax
  jle    L115
  mov    $0xf,%edx
  mov    %rbp,%rsi
  xor    %eax,%eax
  mov    $0x1,%ebx
  lea    D68(%rip),%rdi
  call   <printf@plt>
  jmp    L57
  nopl   (%rax)
L115:
  mov    %rbp,%rdi
  call   <str_isdigit@plt>
  test   %eax,%eax
  je     L210
  lea    D132(%rip),%rsi
  lea    0x8(%rsp),%rdx
  mov    %rbp,%rdi
  call   <sscanf@plt>
  mov    %rbp,%rsi
  cmp    $0x1,%eax
  je     L60
  lea    D10(%rip),%rdi
  xor    %eax,%eax
  mov    $0x1,%ebx
  call   <printf@plt>
  jmp    L57
L210:
  mov    %rbp,%rsi
  lea    D30(%rip),%rdi
  mov    $0x1,%ebx
  call   <printf@plt>
  jmp    L57
  nopl   0x0(%rax)
L3:
  lea    D47(%rip),%rdi
  xor    %eax,%eax
  mov    $0x1,%ebx
  call   <printf@plt>
  jmp    L129
  nopl   0x0(%rax,%rax,1)
L60:
  mov    %r15,%rdi
  xor    %ebx,%ebx
  call   <strcpy@plt>
  mov    %rbp,%rsi
  lea    D31(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L57
L174:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D83
data_type: string
name: read_data
arguments: data_tag: D143
data_type: string
name: read_data
arguments: data_tag: D119
data_type: string
name: read_data
arguments: data_tag: D172
data_type: string
name: read_data
arguments: data_tag: D113
data_type: string
name: read_data
arguments: data_tag: D179
data_type: string
name: read_data
arguments: data_tag: D164
data_type: string
name: read_data
arguments: data_tag: D31
data_type: string
name: read_data
arguments: data_tag: D68
data_type: string
name: read_data
arguments: data_tag: D132
data_type: string
name: read_data
arguments: data_tag: D10
data_type: string
name: read_data
arguments: data_tag: D30
data_type: string
name: read_data
arguments: data_tag: D47
data_type: string

tool: D83: Input source (path): 

tool: D143: Ok unchanged "%s"


tool: D119: Input destination (path): 

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

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

tool: D179: xor

tool: D164: none

tool: D31: Ok "%s"


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


tool: D132: %lf

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


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


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