user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<FITS_image_size>:
  endbr64
  push   %r15
  mov    $0x46,%edx
  push   %r14
  mov    %rsi,%r14
  mov    $0x20,%esi
  push   %r13
  mov    %edi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  lea    0x30(%rsp),%rbp
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    %rbp,%rcx
  mov    %r14,%rsi
  mov    %r13d,%edi
  lea    D105(%rip),%rdx
  call   <get_FITS_key@plt>
  cmp    $0xffffffff,%eax
  je     L146
  cmp    $0x1,%eax
  jne    L145
L170:
  lea    D61(%rip),%r12
  lea    0x1c(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <sscanf@plt>
  test   %eax,%eax
  jle    L195
  lea    0x28(%rsp),%r15
  lea    D53(%rip),%rsi
  mov    0x1c(%rsp),%ebx
  mov    %r15,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rcx
  mov    %r15,%rdx
  mov    %r14,%rsi
  mov    %r13d,%edi
  call   <get_FITS_key@plt>
  cmp    $0xffffffff,%eax
  je     L22
  cmp    $0x2,%eax
  jne    L94
L113:
  lea    0x20(%rsp),%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  test   %eax,%eax
  jle    L87
  mov    0x20(%rsp),%eax
  test   %eax,%eax
  je     L15
  mov    %ebx,%edx
  neg    %edx
  cmovs  %ebx,%edx
  sar    $0x3,%edx
  mov    %edx,0x4(%rsp)
  test   %eax,%eax
  jle    L210
  lea    0x2d(%rsp),%rax
  mov    $0x1,%ebx
  mov    %rax,0x8(%rsp)
  jmp    L107
  xchg   %ax,%ax
L227:
  mov    %rbp,%rcx
  mov    %r15,%rdx
  mov    %r14,%rsi
  mov    %r13d,%edi
  call   <get_FITS_key@plt>
  cmp    $0xffffffff,%eax
  je     L101
  lea    0x2(%rbx),%edx
  cmp    %eax,%edx
  je     L174
  mov    %r15,%rsi
  lea    D24(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L174:
  lea    0x24(%rsp),%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  test   %eax,%eax
  jle    L9
  mov    0x4(%rsp),%eax
  imul   0x24(%rsp),%eax
  add    $0x1,%ebx
  mov    %eax,0x4(%rsp)
  cmp    %ebx,0x20(%rsp)
  jl     L15
L107:
  mov    0x8(%rsp),%rdi
  mov    %ebx,%ecx
  mov    %r12,%rdx
  mov    $0x3,%esi
  call   <snprintf@plt>
  test   %eax,%eax
  jg     L227
  mov    %r15,%rsi
  lea    D80(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L15:
  mov    0x78(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L177
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L145:
  lea    D18(%rip),%rdi
  call   <puts@plt>
  jmp    L170
  nopl   0x0(%rax)
L94:
  lea    D33(%rip),%rdi
  call   <puts@plt>
  jmp    L113
  nopl   0x0(%rax)
L195:
  lea    D23(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L15
L87:
  lea    D16(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L15
L146:
  lea    D128(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L15
  nopl   0x0(%rax,%rax,1)
L101:
  mov    %r15,%rsi
  lea    D21(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L15
L9:
  mov    %r15,%rsi
  lea    D97(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L15
  nopl   0x0(%rax,%rax,1)
L22:
  lea    D69(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L15
L210:
  mov    %edx,%eax
  jmp    L15
L177:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D105
data_type: string
name: read_data
arguments: tag: D61
data_type: string
name: read_data
arguments: tag: D53
data_type: string
name: read_data
arguments: tag: D24
data_type: string
name: read_data
arguments: tag: D80
data_type: string
name: read_data
arguments: tag: D18
data_type: string
name: read_data
arguments: tag: D33
data_type: string
name: read_data
arguments: tag: D23
data_type: string
name: read_data
arguments: tag: D16
data_type: string
name: read_data
arguments: tag: D128
data_type: string
name: read_data
arguments: tag: D21
data_type: string
name: read_data
arguments: tag: D97
data_type: string
name: read_data
arguments: tag: D69
data_type: string

tool: D105: BITPIX

tool: D61: %d

tool: D53: NAXIS

tool: D24: 
	WARNING! header does not conform to FITS standard (%s)


tool: D80: 
	ERROR! FITS_image_size(): %s


tool: D18: 
	WARNING! header does not conform to FITS standard (BITPIX)

tool: D33: 
	WARNING! header does not conform to FITS standard (NAXIS)

tool: D23: 
	ERROR! FITS_image_size(): reading BITPIX

tool: D16: 
	ERROR! FITS_image_size(): reading NAXIS

tool: D128: 
	ERROR! FITS_image_size(): BITPIX not found in the header

tool: D21: 
	ERROR! FITS_image_size(): %s not found in the header


tool: D97: 
	ERROR! FITS_image_size(): reading %s


tool: D69: 
	ERROR! FITS_image_size(): NAXIS not found in the header

assistant: ```c
int FITS_image_size(const int ncards, char **header) {
  char val[70], keyword[8];
  int i, p, bitpix, bytepix, naxis, naxisn, size;
  memset(val, ' ', 70);
  if ((p = get_FITS_key(ncards, header, "BITPIX", val)) == -1) {
    printf("\n\tERROR! FITS_image_size(): BITPIX not found in the header\n");
    return (0);
  }
  if (p != 1)
    printf("\n\tWARNING! header does not conform to FITS standard (BITPIX)\n");
  if (sscanf(val, "%d", &bitpix) < 1) {
    printf("\n\tERROR! FITS_image_size(): reading BITPIX\n");
    return (0);
  }
  bytepix = abs(bitpix) / 8;
  strcpy(keyword, "NAXIS");
  if ((p = get_FITS_key(ncards, header, keyword, val)) == -1) {
    printf("\n\tERROR! FITS_image_size(): NAXIS not found in the header\n");
    return (0);
  }
  if (p != 2)
    printf("\n\tWARNING! header does not conform to FITS standard (NAXIS)\n");
  if (sscanf(val, "%d", &naxis) < 1) {
    printf("\n\tERROR! FITS_image_size(): reading NAXIS\n");
    return (0);
  }
  if (naxis == 0)
    return (0);
  size = bytepix;
  for (i = 1; i <= naxis; i++) {
    if (snprintf((keyword + 5), 8 - 5, "%d", i) < 1) {
      printf("\n\tERROR! FITS_image_size(): %s\n", keyword);
      return (0);
    }
    if ((p = get_FITS_key(ncards, header, keyword, val)) == -1) {
      printf("\n\tERROR! FITS_image_size(): %s not found in the header\n", keyword);
      return (0);
    }
    if (p != i + 2)
      printf("\n\tWARNING! header does not conform to FITS standard (%s)\n", keyword);
    if (sscanf(val, "%d", &naxisn) < 1) {
      printf("\n\tERROR! FITS_image_size(): reading %s\n", keyword);
      return (0);
    }
    size *= naxisn;
  }
  return (size);
}
```