user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<extract_image>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xd0,%rsp
  mov    %rdi,-0xb8(%rbp)
  mov    %esi,-0xbc(%rbp)
  mov    %edx,-0xc0(%rbp)
  mov    %ecx,-0xc4(%rbp)
  mov    %r8d,-0xc8(%rbp)
  mov    %r9,-0xd0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x88(%rbp)
  movq   $0x0,-0x80(%rbp)
  movq   $0x0,-0x78(%rbp)
  movq   $0x0,-0x60(%rbp)
  mov    -0xbc(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x20000000(%rax),%rdx
  mov    -0xb8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x60(%rbp)
  mov    $0x9000000,%eax
  sub    -0xbc(%rbp),%eax
  mov    %eax,-0xa0(%rbp)
  cmpl   $0x0,-0xc4(%rbp)
  je     L79
  mov    -0xa0(%rbp),%ecx
  lea    -0xa4(%rbp),%rdx
  lea    -0x78(%rbp),%rsi
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <decompress@plt>
  jmp    L12
L79:
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x78(%rbp)
L12:
  movq   $0x0,-0x70(%rbp)
  mov    -0xc0(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x20000000(%rax),%rdx
  mov    -0xb8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x58(%rbp)
  mov    $0x9000000,%eax
  sub    -0xc0(%rbp),%eax
  mov    %eax,-0xa0(%rbp)
  cmpl   $0x0,-0xc8(%rbp)
  je     L42
  mov    -0xa0(%rbp),%edx
  lea    -0x70(%rbp),%rsi
  mov    -0x58(%rbp),%rax
  mov    %edx,%ecx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <decompress@plt>
  jmp    L85
L42:
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x70(%rbp)
L85:
  movq   $0x0,-0x50(%rbp)
  movq   $0x0,-0x48(%rbp)
  movq   $0x0,-0x40(%rbp)
  movq   $0x0,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x68(%rbp)
  jmp    L14
L46:
  mov    -0x70(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  shl    $0x3,%eax
  and    $0xff,%eax
  mov    %eax,-0x98(%rbp)
  mov    -0x70(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sar    $0x5,%eax
  shl    $0xb,%eax
  and    $0xffff,%eax
  mov    %eax,-0x94(%rbp)
  mov    -0x70(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  sar    $0xa,%eax
  shl    $0x13,%eax
  and    $0xf80000,%eax
  mov    %eax,-0x90(%rbp)
  cmpq   $0x0,-0x68(%rbp)
  je     L28
  mov    $0xff000000,%eax
  jmp    L77
L28:
  mov    $0x0,%eax
L77:
  mov    %eax,-0x8c(%rbp)
  mov    -0x98(%rbp),%eax
  or     -0x94(%rbp),%eax
  or     -0x90(%rbp),%eax
  or     -0x8c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%rax
  mov    %edx,-0x50(%rbp,%rax,4)
  addq   $0x1,-0x68(%rbp)
L14:
  cmpq   $0xf,-0x68(%rbp)
  jbe    L46
  mov    -0xa4(%rbp),%esi
  mov    -0x78(%rbp),%rax
  lea    -0x88(%rbp),%rcx
  lea    -0x50(%rbp),%rdx
  mov    %rax,%rdi
  call   <deindex_4bpp@plt>
  mov    %eax,-0x9c(%rbp)
  cmpl   $0x0,-0xc4(%rbp)
  je     L99
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L99:
  mov    -0x88(%rbp),%rax
  lea    -0x80(%rbp),%rdx
  mov    -0x9c(%rbp),%esi
  mov    %rdx,%rcx
  mov    $0x8,%edx
  mov    %rax,%rdi
  call   <detile@plt>
  mov    -0x80(%rbp),%rdx
  mov    -0xd0(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x88(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L67
  call   <__stack_chk_fail@plt>
L67:
  leave
  ret
```

assistant: ```c
void extract_image(uint8_t *buffer, uint32_t imgAddr, uint32_t palAddr, int compImg, int compPal, uint32_t **out) {
  uint32_t destSize, srcSize, *pixels = NULL, *image = NULL;
  uint8_t *output = NULL, *offset = NULL;
  size_t i;
  offset = (uint8_t *)(buffer + (imgAddr - 0x8000000));
  srcSize = (1 << 24) - (imgAddr - 0x8000000);
  if (compImg) {
    decompress((const uint8_t *)offset, &output, &destSize, srcSize);
  } else {
    output = offset;
  }
  uint16_t *paletteGBA = NULL;
  uint8_t *paletteComp = (uint8_t *)((palAddr - 0x8000000) + buffer);
  srcSize = (1 << 24) - (palAddr - 0x8000000);
  if (compPal) {
    decompress((const uint8_t *)paletteComp, (uint8_t **)&paletteGBA, NULL, srcSize);
  } else {
    paletteGBA = (uint16_t *)paletteComp;
  }
  uint32_t paletteRGBA[16] = {};
  for (i = 0; i < 16; i++) {
    uint32_t r, g, b, a;
    r = ((paletteGBA[i] >> 0) & 0x1F) << (3);
    g = ((paletteGBA[i] >> 5) & 0x1F) << (3 + 8);
    b = ((paletteGBA[i] >> 10) & 0x1F) << (3 + 16);
    a = (i ? 0xFF : 0x0) << 24;
    paletteRGBA[i] = r | g | b | a;
  }
  int length = deindex_4bpp(output, destSize, paletteRGBA, &pixels);
  if (compImg)
    free(output);
  detile(pixels, length, 8, &image);
  *out = image;
  free(pixels);
}
```