// File: /workspace/github_c_makefile_star2_O0/snej[P]zdelta/deflate.c
// Function: zd_deflateEnd
int ZEXPORT zd_deflateEnd (strm)
    zd_streamp strm;
{
  int status;

  if (strm == ZD_NULL || strm->state == ZD_NULL) return ZD_STREAM_ERROR;
  
  status = strm->state->status;
  if (status != INIT_STATE && status != BUSY_STATE &&
      status != FINISH_STATE) {
    return ZD_STREAM_ERROR;
  }

  /* Deallocate in reverse order of allocations: */
  /* zdelta: deallocate zdelta buffers           */
  TRY_FREE(strm, strm->state->pending_buf);
  TRY_FREE(strm, strm->state->ref_head[0]);
  TRY_FREE(strm, strm->state->ref_prev[0]);
  TRY_FREE(strm, strm->state->head);
  TRY_FREE(strm, strm->state->prev);

  /* zdelta: strm->state->window now points at the middle of
   *         strm->state->ref_window
   */
  TRY_FREE(strm, strm->state->ref_window[0]);
  ZFREE(strm, strm->state);
  strm->state = ZD_NULL;
  return status == BUSY_STATE ? ZD_DATA_ERROR : ZD_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x308e
movq -0x10(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x309a
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x3216
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x2a, -0x14(%rbp)
je 0x30c9
cmpl $0x71, -0x14(%rbp)
je 0x30c9
cmpl $0x29a, -0x14(%rbp)     # imm = 0x29A
je 0x30c9
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x3216
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x30f6
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x70(%rcx), %rdi
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
movq 0x10(%rcx), %rsi
callq *%rax
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, 0x80(%rax)
je 0x3129
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x70(%rcx), %rdi
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
movq 0x80(%rcx), %rsi
callq *%rax
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, 0x70(%rax)
je 0x3156
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x70(%rcx), %rdi
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
movq 0x70(%rcx), %rsi
callq *%rax
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, 0x78(%rax)
je 0x3183
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x70(%rcx), %rdi
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
movq 0x78(%rcx), %rsi
callq *%rax
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, 0x68(%rax)
je 0x31b0
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x70(%rcx), %rdi
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
movq 0x68(%rcx), %rsi
callq *%rax
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, 0x50(%rax)
je 0x31dd
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x70(%rcx), %rdi
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
movq 0x50(%rcx), %rsi
callq *%rax
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x70(%rcx), %rdi
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rsi
callq *%rax
movq -0x10(%rbp), %rax
movq $0x0, 0x58(%rax)
movl -0x14(%rbp), %edx
xorl %eax, %eax
movl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
cmpl $0x71, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop