user: 请将以下的汇编代码转换成C语言代码：

```asm
<qfits_card_build>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x3c8,%rsp
  mov    %rdi,-0x3b8(%rbp)
  mov    %rsi,-0x3c0(%rbp)
  mov    %rdx,-0x3c8(%rbp)
  mov    %rcx,-0x3d0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x3ac(%rbp)
  cmpq   $0x0,-0x3b8(%rbp)
  je     L306
  cmpq   $0x0,-0x3c0(%rbp)
  je     L306
  mov    -0x3b8(%rbp),%rax
  mov    $0x50,%edx
  mov    $0x20,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  cmpq   $0x0,-0x3c0(%rbp)
  je     L42
  mov    -0x3c0(%rbp),%rax
  lea    D89(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L321
  mov    -0x3b8(%rbp),%rax
  lea    D89(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L312
L321:
  mov    -0x3c0(%rbp),%rax
  lea    D28(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L101
  mov    -0x3c0(%rbp),%rax
  lea    D59(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L101
  mov    -0x3c0(%rbp),%rax
  mov    $0x8,%edx
  lea    D38(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L291
L101:
  mov    -0x3c0(%rbp),%rdx
  mov    -0x3b8(%rbp),%rax
  lea    D11(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  cmpq   $0x0,-0x3c8(%rbp)
  je     L110
  mov    -0x3c8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x3b0(%rbp)
  cmpl   $0x48,-0x3b0(%rbp)
  jle    L367
  movl   $0x48,-0x3b0(%rbp)
L367:
  mov    -0x3b8(%rbp),%rax
  lea    0x8(%rax),%rcx
  mov    -0x3b0(%rbp),%edx
  mov    -0x3c8(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <strncpy@plt>
  jmp    L312
L291:
  cmpq   $0x0,-0x3c8(%rbp)
  jne    L6
  movb   $0x0,-0x3a0(%rbp)
  jmp    L262
L6:
  mov    -0x3c8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jg     L60
  movb   $0x0,-0x3a0(%rbp)
  jmp    L262
L60:
  mov    -0x3c8(%rbp),%rdx
  lea    -0x3a0(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
L262:
  cmpq   $0x0,-0x3d0(%rbp)
  jne    L237
  lea    -0x280(%rbp),%rax
  lea    D111(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  jmp    L260
L237:
  mov    -0x3d0(%rbp),%rdx
  lea    -0x280(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
L260:
  mov    -0x3c0(%rbp),%rax
  mov    $0x8,%edx
  lea    D63(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L223
  addl   $0x1,-0x3ac(%rbp)
L223:
  lea    -0x3a0(%rbp),%rax
  mov    %rax,%rdi
  call   <qfits_is_int@plt>
  test   %rax,%rax
  jne    L301
  lea    -0x3a0(%rbp),%rax
  mov    %rax,%rdi
  call   <qfits_is_float@plt>
  test   %rax,%rax
  jne    L301
  lea    -0x3a0(%rbp),%rax
  mov    %rax,%rdi
  call   <qfits_is_boolean@plt>
  test   %rax,%rax
  jne    L301
  lea    -0x3a0(%rbp),%rax
  mov    %rax,%rdi
  call   <qfits_is_complex@plt>
  test   %rax,%rax
  je     L50
L301:
  cmpl   $0x0,-0x3ac(%rbp)
  je     L9
  lea    -0x280(%rbp),%rsi
  lea    -0x3a0(%rbp),%rcx
  mov    -0x3c0(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  mov    %rsi,%r8
  lea    D72(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L246
L9:
  lea    -0x280(%rbp),%rsi
  lea    -0x3a0(%rbp),%rcx
  mov    -0x3c0(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  mov    %rsi,%r8
  lea    D62(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L246:
  lea    -0x220(%rbp),%rcx
  mov    -0x3b8(%rbp),%rax
  mov    $0x50,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x3b8(%rbp),%rax
  add    $0x50,%rax
  movb   $0x0,(%rax)
  jmp    L312
L50:
  movzbl -0x3a0(%rbp),%eax
  test   %al,%al
  jne    L345
  cmpl   $0x0,-0x3ac(%rbp)
  je     L280
  lea    -0x280(%rbp),%rcx
  mov    -0x3c0(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  lea    D36(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L132
L280:
  lea    -0x280(%rbp),%rcx
  mov    -0x3c0(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  lea    D100(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L132:
  lea    -0x220(%rbp),%rcx
  mov    -0x3b8(%rbp),%rax
  mov    $0x50,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x3b8(%rbp),%rax
  add    $0x50,%rax
  movb   $0x0,(%rax)
  jmp    L312
L345:
  lea    -0x2e0(%rbp),%rax
  mov    $0x51,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x3a0(%rbp),%rax
  mov    %rax,%rdi
  call   <qfits_pretty_string@plt>
  mov    %rax,%rdx
  lea    -0x340(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  movl   $0x0,-0x3a4(%rbp)
  movl   $0x0,-0x3a8(%rbp)
  jmp    L337
L210:
  mov    -0x3a8(%rbp),%eax
  cltq
  movzbl -0x340(%rbp,%rax,1),%eax
  cmp    $0x27,%al
  jne    L160
  mov    -0x3a4(%rbp),%eax
  cltq
  movb   $0x27,-0x2e0(%rbp,%rax,1)
  addl   $0x1,-0x3a4(%rbp)
  mov    -0x3a4(%rbp),%eax
  cltq
  movb   $0x27,-0x2e0(%rbp,%rax,1)
  jmp    L45
L160:
  mov    -0x3a8(%rbp),%eax
  cltq
  movzbl -0x340(%rbp,%rax,1),%edx
  mov    -0x3a4(%rbp),%eax
  cltq
  mov    %dl,-0x2e0(%rbp,%rax,1)
L45:
  addl   $0x1,-0x3a8(%rbp)
  addl   $0x1,-0x3a4(%rbp)
L337:
  mov    -0x3a8(%rbp),%eax
  cltq
  movzbl -0x340(%rbp,%rax,1),%eax
  test   %al,%al
  jne    L210
  cmpl   $0x0,-0x3ac(%rbp)
  je     L200
  lea    -0x280(%rbp),%rsi
  lea    -0x2e0(%rbp),%rcx
  mov    -0x3c0(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  mov    %rsi,%r8
  lea    D112(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    -0x3c0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  lea    -0x2e0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %ebx,%eax
  cmp    $0x4c,%eax
  jle    L393
  movb   $0x27,-0x1d1(%rbp)
  jmp    L393
L200:
  lea    -0x280(%rbp),%rsi
  lea    -0x2e0(%rbp),%rcx
  mov    -0x3c0(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  mov    %rsi,%r8
  lea    D61(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L393:
  lea    -0x220(%rbp),%rcx
  mov    -0x3b8(%rbp),%rax
  mov    $0x50,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x3b8(%rbp),%rax
  add    $0x50,%rax
  movb   $0x0,(%rax)
  jmp    L312
L306:
  nop
  jmp    L312
L42:
  nop
  jmp    L312
L110:
  nop
L312:
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L175
  call   <__stack_chk_fail@plt>
L175:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D89
type_guessed: string
name: parse_data
arguments: data_tag: D28
type_guessed: string
name: parse_data
arguments: data_tag: D59
type_guessed: string
name: parse_data
arguments: data_tag: D38
type_guessed: string
name: parse_data
arguments: data_tag: D11
type_guessed: string
name: parse_data
arguments: data_tag: D111
type_guessed: string
name: parse_data
arguments: data_tag: D63
type_guessed: string
name: parse_data
arguments: data_tag: D72
type_guessed: string
name: parse_data
arguments: data_tag: D62
type_guessed: string
name: parse_data
arguments: data_tag: D36
type_guessed: string
name: parse_data
arguments: data_tag: D100
type_guessed: string
name: parse_data
arguments: data_tag: D112
type_guessed: string
name: parse_data
arguments: data_tag: D61
type_guessed: string

tool: D89: END

tool: D28: HISTORY

tool: D59: COMMENT

tool: D38:         

tool: D11: %s 

tool: D111: no comment

tool: D63: HIERARCH

tool: D72: %-29s= %s / %s

tool: D62: %-8.8s= %20s / %-48s

tool: D36: %-29s=                    / %s

tool: D100: %-8.8s=                      / %-48s

tool: D112: %-29s= '%s' / %s

tool: D61: %-8.8s= '%-8s' / %s

assistant: ```c
void qfits_card_build(char *line, const char *key, const char *val, const char *com) {
  int len;
  int hierarch = 0;
  char cval[81];
  char cval2[81];
  char cval_q[81];
  char ccom[81];
  char safe_line[512];
  int i, j;
  if (line == NULL || key == NULL)
    return;
  memset(line, ' ', 80);
  if (key == NULL)
    return;
  if (!strcmp(key, "END")) {
    sprintf(line, "END");
    return;
  }
  if (!strcmp(key, "HISTORY") || !strcmp(key, "COMMENT") || !strncmp(key, "        ", 8)) {
    sprintf(line, "%s ", key);
    if (val == NULL)
      return;
    len = strlen(val);
    if (len > 72)
      len = 72;
    strncpy(line + 8, val, len);
    return;
  }
  if (val == NULL)
    cval[0] = (char)0;
  else if (strlen(val) < 1)
    cval[0] = (char)0;
  else
    strcpy(cval, val);
  if (com == NULL)
    strcpy(ccom, "no comment");
  else
    strcpy(ccom, com);
  if (!strncmp(key, "HIERARCH", 8))
    hierarch++;
  if (qfits_is_int(cval) || qfits_is_float(cval) || qfits_is_boolean(cval) || qfits_is_complex(cval)) {
    if (hierarch)
      sprintf(safe_line, "%-29s= %s / %s", key, cval, ccom);
    else
      sprintf(safe_line, "%-8.8s= %20s / %-48s", key, cval, ccom);
    strncpy(line, safe_line, 80);
    line[80] = (char)0;
    return;
  }
  if (cval[0] == 0) {
    if (hierarch) {
      sprintf(safe_line, "%-29s=                    / %s", key, ccom);
    } else {
      sprintf(safe_line, "%-8.8s=                      / %-48s", key, ccom);
    }
    strncpy(line, safe_line, 80);
    line[80] = (char)0;
    return;
  }
  memset(cval_q, 0, 81);
  strcpy(cval2, qfits_pretty_string(cval));
  j = 0;
  i = 0;
  while (cval2[i] != (char)0) {
    if (cval2[i] == '\'') {
      cval_q[j] = '\'';
      j++;
      cval_q[j] = '\'';
    } else {
      cval_q[j] = cval2[i];
    }
    i++;
    j++;
  }
  if (hierarch) {
    sprintf(safe_line, "%-29s= '%s' / %s", key, cval_q, ccom);
    if (strlen(key) + strlen(cval_q) + 3 >= 80)
      safe_line[79] = '\'';
  } else {
    sprintf(safe_line, "%-8.8s= '%-8s' / %s", key, cval_q, ccom);
  }
  strncpy(line, safe_line, 80);
  line[80] = (char)0;
  return;
}
```