user: 请从给定的汇编指令推导出C源代码：

```asm
<stbi_write_png_to_mem>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %rdi,-0xa8(%rbp)
  mov    %esi,-0xac(%rbp)
  mov    %edx,-0xb0(%rbp)
  mov    %ecx,-0xb4(%rbp)
  mov    %r8d,-0xb8(%rbp)
  mov    %r9,-0xc0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0xffffffff,-0x40(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movl   $0x4,-0x38(%rbp)
  movl   $0x2,-0x34(%rbp)
  movl   $0x6,-0x30(%rbp)
  movabs $0xa1a0a0d474e5089,%rax
  mov    %rax,-0x20(%rbp)
  cmpl   $0x0,-0xac(%rbp)
  jne    L56
  mov    -0xb0(%rbp),%eax
  imul   -0xb8(%rbp),%eax
  mov    %eax,-0xac(%rbp)
L56:
  mov    -0xb0(%rbp),%eax
  imul   -0xb8(%rbp),%eax
  add    $0x1,%eax
  imul   -0xb4(%rbp),%eax
  cltq
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x70(%rbp)
  cmpq   $0x0,-0x70(%rbp)
  jne    L219
  mov    $0x0,%eax
  jmp    L23
L219:
  mov    -0xb0(%rbp),%eax
  imul   -0xb8(%rbp),%eax
  cltq
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x68(%rbp)
  cmpq   $0x0,-0x68(%rbp)
  jne    L306
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L23
L306:
  movl   $0x0,-0x94(%rbp)
  jmp    L53
L230:
  cmpl   $0x0,-0x94(%rbp)
  je     L328
  lea    D14(%rip),%rax
  jmp    L148
L328:
  lea    D42(%rip),%rax
L148:
  mov    %rax,-0x50(%rbp)
  movl   $0x0,-0x88(%rbp)
  movl   $0x7fffffff,-0x84(%rbp)
  movl   $0x0,-0x8c(%rbp)
  jmp    L376
L425:
  cmpl   $0x0,-0x8c(%rbp)
  je     L315
  mov    -0x88(%rbp),%eax
  jmp    L68
L315:
  mov    $0x0,%eax
L68:
  mov    %eax,-0x90(%rbp)
  jmp    L312
L319:
  mov    -0x90(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x7c(%rbp)
  movl   $0x0,-0x80(%rbp)
  mov    -0xac(%rbp),%eax
  imul   -0x94(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x48(%rbp)
  movl   $0x0,-0x98(%rbp)
  jmp    L236
L278:
  cmpl   $0x6,-0x7c(%rbp)
  ja     L201
  mov    -0x7c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D47(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D47(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x68(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  jmp    L201
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x68(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  jmp    L201
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x98(%rbp),%eax
  sub    -0xac(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L201
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x98(%rbp),%eax
  sub    -0xac(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  shr    %al
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L201
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%ebx
  mov    -0x98(%rbp),%eax
  sub    -0xac(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x0,%edx
  mov    %eax,%esi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <stbiw__paeth@plt>
  sub    %eax,%ebx
  mov    %ebx,%ecx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L201
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x68(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  jmp    L201
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x68(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  nop
L201:
  addl   $0x1,-0x98(%rbp)
L236:
  mov    -0x98(%rbp),%eax
  cmp    -0xb8(%rbp),%eax
  jl     L278
  mov    -0xb8(%rbp),%eax
  mov    %eax,-0x98(%rbp)
  jmp    L138
L212:
  cmpl   $0x6,-0x7c(%rbp)
  ja     L67
  mov    -0x7c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D23(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D23(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x68(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  jmp    L67
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x98(%rbp),%eax
  sub    -0xb8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L67
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x98(%rbp),%eax
  sub    -0xac(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L67
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x98(%rbp),%eax
  sub    -0xb8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0x98(%rbp),%eax
  sub    -0xac(%rbp),%eax
  movslq %eax,%rsi
  mov    -0x48(%rbp),%rax
  add    %rsi,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %ecx,%eax
  sar    %eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L67
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%ebx
  mov    -0x98(%rbp),%eax
  sub    -0xac(%rbp),%eax
  sub    -0xb8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x98(%rbp),%eax
  sub    -0xac(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0x98(%rbp),%eax
  sub    -0xb8(%rbp),%eax
  movslq %eax,%rsi
  mov    -0x48(%rbp),%rax
  add    %rsi,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <stbiw__paeth@plt>
  sub    %eax,%ebx
  mov    %ebx,%ecx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L67
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x98(%rbp),%eax
  sub    -0xb8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  shr    %al
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L67
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%ebx
  mov    -0x98(%rbp),%eax
  sub    -0xb8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <stbiw__paeth@plt>
  sub    %eax,%ebx
  mov    %ebx,%ecx
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  nop
L67:
  addl   $0x1,-0x98(%rbp)
L138:
  mov    -0xb0(%rbp),%eax
  imul   -0xb8(%rbp),%eax
  cmp    %eax,-0x98(%rbp)
  jl     L212
  cmpl   $0x0,-0x8c(%rbp)
  jne    L344
  movl   $0x0,-0x98(%rbp)
  jmp    L253
L42:
  mov    -0x98(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %eax,%edx
  neg    %dl
  cmovns %edx,%eax
  movzbl %al,%eax
  add    %eax,-0x80(%rbp)
  addl   $0x1,-0x98(%rbp)
L253:
  mov    -0xb0(%rbp),%eax
  imul   -0xb8(%rbp),%eax
  cmp    %eax,-0x98(%rbp)
  jl     L42
  mov    -0x80(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jge    L267
  mov    -0x80(%rbp),%eax
  mov    %eax,-0x84(%rbp)
  mov    -0x90(%rbp),%eax
  mov    %eax,-0x88(%rbp)
L267:
  addl   $0x1,-0x90(%rbp)
L312:
  cmpl   $0x4,-0x90(%rbp)
  jle    L319
  jmp    L195
L344:
  nop
L195:
  addl   $0x1,-0x8c(%rbp)
L376:
  cmpl   $0x1,-0x8c(%rbp)
  jle    L425
  mov    -0xb0(%rbp),%eax
  imul   -0xb8(%rbp),%eax
  add    $0x1,%eax
  imul   -0x94(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  mov    -0x88(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0xb0(%rbp),%eax
  imul   -0xb8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xb0(%rbp),%eax
  imul   -0xb8(%rbp),%eax
  add    $0x1,%eax
  imul   -0x94(%rbp),%eax
  cltq
  lea    0x1(%rax),%rcx
  mov    -0x70(%rbp),%rax
  add    %rax,%rcx
  mov    -0x68(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memmove@plt>
  addl   $0x1,-0x94(%rbp)
L53:
  mov    -0x94(%rbp),%eax
  cmp    -0xb4(%rbp),%eax
  jl     L230
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0xb0(%rbp),%eax
  imul   -0xb8(%rbp),%eax
  add    $0x1,%eax
  imul   -0xb4(%rbp),%eax
  mov    %eax,%esi
  lea    -0x9c(%rbp),%rdx
  mov    -0x70(%rbp),%rax
  mov    $0x8,%ecx
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stbi_zlib_compress@plt>
  cltq
  mov    %rax,-0x60(%rbp)
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  cmpq   $0x0,-0x60(%rbp)
  jne    L383
  mov    $0x0,%eax
  jmp    L23
L383:
  mov    -0x9c(%rbp),%eax
  add    $0x39,%eax
  cltq
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x58(%rbp)
  cmpq   $0x0,-0x58(%rbp)
  jne    L289
  mov    $0x0,%eax
  jmp    L23
L289:
  mov    -0x9c(%rbp),%eax
  lea    0x39(%rax),%edx
  mov    -0xc0(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x78(%rbp)
  mov    -0x78(%rbp),%rax
  mov    -0x20(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x8,%rax
  mov    %rax,-0x78(%rbp)
  mov    -0x78(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x1,%rax
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x2,%rax
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x3,%rax
  movb   $0xd,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x78(%rbp)
  mov    $0x49,%edx
  mov    -0x78(%rbp),%rax
  mov    %dl,(%rax)
  mov    $0x48,%edx
  mov    -0x78(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    $0x44,%edx
  mov    -0x78(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    $0x52,%edx
  mov    -0x78(%rbp),%rax
  add    $0x3,%rax
  mov    %dl,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x78(%rbp)
  mov    -0xb0(%rbp),%eax
  sar    $0x18,%eax
  mov    %eax,%edx
  mov    -0x78(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0xb0(%rbp),%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0x78(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    -0xb0(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x78(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x3,%rax
  mov    -0xb0(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x78(%rbp)
  mov    -0xb4(%rbp),%eax
  sar    $0x18,%eax
  mov    %eax,%edx
  mov    -0x78(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0xb4(%rbp),%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0x78(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    -0xb4(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x78(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x3,%rax
  mov    -0xb4(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x78(%rbp)
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movb   $0x8,(%rax)
  mov    -0xb8(%rbp),%eax
  cltq
  mov    -0x40(%rbp,%rax,4),%ecx
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x78(%rbp)
  movb   $0x0,(%rax)
  lea    -0x78(%rbp),%rax
  mov    $0xd,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stbiw__wpcrc@plt>
  mov    -0x9c(%rbp),%eax
  sar    $0x18,%eax
  mov    %eax,%edx
  mov    -0x78(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x9c(%rbp),%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0x78(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    -0x9c(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x78(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    -0x9c(%rbp),%edx
  mov    -0x78(%rbp),%rax
  add    $0x3,%rax
  mov    %dl,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x78(%rbp)
  mov    $0x49,%edx
  mov    -0x78(%rbp),%rax
  mov    %dl,(%rax)
  mov    $0x44,%edx
  mov    -0x78(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    $0x41,%edx
  mov    -0x78(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    $0x54,%edx
  mov    -0x78(%rbp),%rax
  add    $0x3,%rax
  mov    %dl,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x78(%rbp)
  mov    -0x9c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  mov    -0x60(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memmove@plt>
  mov    -0x78(%rbp),%rdx
  mov    -0x9c(%rbp),%eax
  cltq
  add    %rdx,%rax
  mov    %rax,-0x78(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x9c(%rbp),%edx
  lea    -0x78(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stbiw__wpcrc@plt>
  mov    -0x78(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x1,%rax
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x2,%rax
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x3,%rax
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x78(%rbp)
  mov    $0x49,%edx
  mov    -0x78(%rbp),%rax
  mov    %dl,(%rax)
  mov    $0x45,%edx
  mov    -0x78(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    $0x4e,%edx
  mov    -0x78(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    $0x44,%edx
  mov    -0x78(%rbp),%rax
  add    $0x3,%rax
  mov    %dl,(%rax)
  mov    -0x78(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x78(%rbp)
  lea    -0x78(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stbiw__wpcrc@plt>
  mov    -0xc0(%rbp),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x78(%rbp),%rax
  cmp    %rax,%rdx
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    -0x58(%rbp),%rax
L23:
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L321
  call   <__stack_chk_fail@plt>
L321:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len) {
  int ctype[5] = {-1, 0, 4, 2, 6};
  unsigned char sig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
  unsigned char *out, *o, *filt, *zlib;
  signed char *line_buffer;
  int i, j, k, p, zlen;
  if (stride_bytes == 0)
    stride_bytes = x * n;
  filt = (unsigned char *)malloc((x * n + 1) * y);
  if (!filt)
    return 0;
  line_buffer = (signed char *)malloc(x * n);
  if (!line_buffer) {
    free(filt);
    return 0;
  }
  for (j = 0; j < y; ++j) {
    static int mapping[] = {0, 1, 2, 3, 4};
    static int firstmap[] = {0, 1, 0, 5, 6};
    int *mymap = j ? mapping : firstmap;
    int best = 0, bestval = 0x7fffffff;
    for (p = 0; p < 2; ++p) {
      for (k = p ? best : 0; k < 5; ++k) {
        int type = mymap[k], est = 0;
        unsigned char *z = pixels + stride_bytes * j;
        for (i = 0; i < n; ++i)
          switch (type) {
          case 0:
            line_buffer[i] = z[i];
            break;
          case 1:
            line_buffer[i] = z[i];
            break;
          case 2:
            line_buffer[i] = z[i] - z[i - stride_bytes];
            break;
          case 3:
            line_buffer[i] = z[i] - (z[i - stride_bytes] >> 1);
            break;
          case 4:
            line_buffer[i] = (signed char)(z[i] - stbiw__paeth(0, z[i - stride_bytes], 0));
            break;
          case 5:
            line_buffer[i] = z[i];
            break;
          case 6:
            line_buffer[i] = z[i];
            break;
          }
        for (i = n; i < x * n; ++i) {
          switch (type) {
          case 0:
            line_buffer[i] = z[i];
            break;
          case 1:
            line_buffer[i] = z[i] - z[i - n];
            break;
          case 2:
            line_buffer[i] = z[i] - z[i - stride_bytes];
            break;
          case 3:
            line_buffer[i] = z[i] - ((z[i - n] + z[i - stride_bytes]) >> 1);
            break;
          case 4:
            line_buffer[i] = z[i] - stbiw__paeth(z[i - n], z[i - stride_bytes], z[i - stride_bytes - n]);
            break;
          case 5:
            line_buffer[i] = z[i] - (z[i - n] >> 1);
            break;
          case 6:
            line_buffer[i] = z[i] - stbiw__paeth(z[i - n], 0, 0);
            break;
          }
        }
        if (p)
          break;
        for (i = 0; i < x * n; ++i)
          est += abs((signed char)line_buffer[i]);
        if (est < bestval) {
          bestval = est;
          best = k;
        }
      }
    }
    filt[j * (x * n + 1)] = (unsigned char)best;
    memmove(filt + j * (x * n + 1) + 1, line_buffer, x * n);
  }
  free(line_buffer);
  zlib = stbi_zlib_compress(filt, y * (x * n + 1), &zlen, 8);
  free(filt);
  if (!zlib)
    return 0;
  out = (unsigned char *)malloc(8 + 12 + 13 + 12 + zlen + 12);
  if (!out)
    return 0;
  *out_len = 8 + 12 + 13 + 12 + zlen + 12;
  o = out;
  memmove(o, sig, 8);
  o += 8;
  ((o)[0] = (unsigned char)(((13) >> 24) & 0xff), (o)[1] = (unsigned char)(((13) >> 16) & 0xff), (o)[2] = (unsigned char)(((13) >> 8) & 0xff), (o)[3] = (unsigned char)(((13)) & 0xff), (o) += 4);
  ;
  ((o)[0] = (unsigned char)(("IHDR"[0]) & 0xff), (o)[1] = (unsigned char)(("IHDR"[1]) & 0xff), (o)[2] = (unsigned char)(("IHDR"[2]) & 0xff), (o)[3] = (unsigned char)(("IHDR"[3]) & 0xff), (o) += 4);
  ((o)[0] = (unsigned char)(((x) >> 24) & 0xff), (o)[1] = (unsigned char)(((x) >> 16) & 0xff), (o)[2] = (unsigned char)(((x) >> 8) & 0xff), (o)[3] = (unsigned char)(((x)) & 0xff), (o) += 4);
  ;
  ((o)[0] = (unsigned char)(((y) >> 24) & 0xff), (o)[1] = (unsigned char)(((y) >> 16) & 0xff), (o)[2] = (unsigned char)(((y) >> 8) & 0xff), (o)[3] = (unsigned char)(((y)) & 0xff), (o) += 4);
  ;
  *o++ = 8;
  *o++ = (unsigned char)((ctype[n]) & 0xff);
  *o++ = 0;
  *o++ = 0;
  *o++ = 0;
  stbiw__wpcrc(&o, 13);
  ((o)[0] = (unsigned char)(((zlen) >> 24) & 0xff), (o)[1] = (unsigned char)(((zlen) >> 16) & 0xff), (o)[2] = (unsigned char)(((zlen) >> 8) & 0xff), (o)[3] = (unsigned char)(((zlen)) & 0xff), (o) += 4);
  ;
  ((o)[0] = (unsigned char)(("IDAT"[0]) & 0xff), (o)[1] = (unsigned char)(("IDAT"[1]) & 0xff), (o)[2] = (unsigned char)(("IDAT"[2]) & 0xff), (o)[3] = (unsigned char)(("IDAT"[3]) & 0xff), (o) += 4);
  memmove(o, zlib, zlen);
  o += zlen;
  free(zlib);
  stbiw__wpcrc(&o, zlen);
  ((o)[0] = (unsigned char)(((0) >> 24) & 0xff), (o)[1] = (unsigned char)(((0) >> 16) & 0xff), (o)[2] = (unsigned char)(((0) >> 8) & 0xff), (o)[3] = (unsigned char)(((0)) & 0xff), (o) += 4);
  ;
  ((o)[0] = (unsigned char)(("IEND"[0]) & 0xff), (o)[1] = (unsigned char)(("IEND"[1]) & 0xff), (o)[2] = (unsigned char)(("IEND"[2]) & 0xff), (o)[3] = (unsigned char)(("IEND"[3]) & 0xff), (o) += 4);
  stbiw__wpcrc(&o, 0);
  assert(o == out + *out_len);
  return out;
}
```