user: 下面的汇编指令对应的C源代码是什么：

```asm
<xml_write_to_mtd>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x20,%rsp
  mov    (%rdi),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  test   %rdi,%rdi
  je     L20
  cmpq   $0x0,(%rdx)
  mov    %rdx,%r12
  je     L20
  test   %esi,%esi
  je     L88
L59:
  call   <strlen@plt>
  lea    0x6(%rax),%edi
  mov    %eax,%ebp
  call   <malloc@plt>
  mov    (%rbx),%rsi
  mov    %rax,%rdi
  mov    %rax,0x8(%rsp)
  call   <strcpy@plt>
  mov    (%rbx),%rdi
  lea    0x1(%rbp),%esi
  call   <crc32@plt>
  mov    0x8(%rsp),%rcx
  movslq %ebp,%rdx
  mov    %rax,%rsi
  mov    %al,0x1(%rcx,%rdx,1)
  mov    0x8(%rsp),%rcx
  shr    $0x10,%rsi
  mov    %ah,0x2(%rcx,%rdx,1)
  mov    0x8(%rsp),%rcx
  shr    $0x18,%rax
  mov    %sil,0x3(%rcx,%rdx,1)
  mov    0x8(%rsp),%rcx
  lea    0x8(%rsp),%rsi
  mov    %al,0x4(%rcx,%rdx,1)
  mov    0x8(%rsp),%rax
  movb   $0x0,0x9(%rax,%rdx,1)
  mov    (%r12),%rdi
  call   <write_block_device@plt>
  mov    0x8(%rsp),%rdi
  mov    %eax,%r12d
  call   <free@plt>
L33:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L68
  add    $0x20,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L88:
  lea    D10(%rip),%rdi
  call   <printf@plt>
  lea    0x10(%rsp),%rsi
  lea    D2(%rip),%rdi
  call   <scanf@plt>
  cmp    $0x1,%eax
  je     L15
L34:
  mov    $0x1,%r12d
  jmp    L33
  nopw   0x0(%rax,%rax,1)
L20:
  lea    D38(%rip),%rdi
  mov    $0x1,%r12d
  call   <perror@plt>
  jmp    L33
  nopl   0x0(%rax)
L15:
  mov    0x10(%rsp),%rdi
  mov    $0x1,%edx
  lea    D13(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L34
  mov    0x10(%rsp),%rdi
  test   %rdi,%rdi
  je     L22
  call   <free@plt>
L22:
  mov    (%rbx),%rdi
  jmp    L59
L68:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D10
data_type: string
name: retrieve_data
arguments: data_tag: D2
data_type: string
name: retrieve_data
arguments: data_tag: D38
data_type: string
name: retrieve_data
arguments: data_tag: D13
data_type: string

tool: D10: Update RedBoot non-volatile configuration - continue (y/n)? 

tool: D2: %a[a-z]

tool: D38: Error writing to device: Insufficient Data


tool: D13: y

assistant: ```c
int xml_write_to_mtd(char **fisroot_str, int assume_yes, char **target) {
  int ret = 0;
  int len = 0;
  char *tmp_str = NULL;
  char *affirm = NULL;
  unsigned long checksum;
  if ((!*fisroot_str) || (!*target)) {
    perror("Error writing to device: Insufficient Data\n");
    return 1;
  }
  if (!assume_yes) {
    printf("Update RedBoot non-volatile configuration - continue (y/n)? ");
    ret = scanf("%a[a-z]", &affirm);
    if (ret == 1) {
      if (strncmp(affirm, "y", 1))
        return 1;
    } else {
      return 1;
    }
    ret = 0;
    if (affirm)
      free(affirm);
  };
  len = strlen(*fisroot_str);
  tmp_str = malloc(len + 6);
  strcpy(tmp_str, *fisroot_str);
  checksum = crc32((unsigned char *)*fisroot_str, len + 1);
  *(tmp_str + len + 1) = checksum & 0xFF;
  *(tmp_str + len + 2) = (checksum >> 8) & 0xFF;
  *(tmp_str + len + 3) = (checksum >> 16) & 0xFF;
  *(tmp_str + len + 4) = (checksum >> 24) & 0xFF;
  ;
  tmp_str[len + sizeof checksum + 1] = '\0';
  ;
  ret = write_block_device(*target, &tmp_str);
  free(tmp_str);
  return ret;
}
```