	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bgzf_close                     ## -- Begin function bgzf_close
	.p2align	4, 0x90
_bgzf_close:                            ## @bgzf_close
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	$-1, %r14d
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.1:
	movq	%rdi, %rbx
	cmpb	$119, (%rdi)
	jne	LBB0_7
## %bb.2:
	movq	%rbx, %rdi
	callq	_bgzf_flush
	testq	%rax, %rax
	jne	LBB0_10
## %bb.3:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_deflate_block
	movq	8(%rbx), %rdi
	movl	24(%rbx), %ecx
	movl	$1, %esi
	movl	%eax, %edx
	callq	_fwrite
	movl	24(%rbx), %edi
	callq	_fflush
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_BGZF_ERR_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 28(%rbx)
	jmp	LBB0_10
LBB0_5:
	cmpb	$119, (%rbx)
	jne	LBB0_7
## %bb.6:
	movl	24(%rbx), %edi
	callq	_fclose
	jmp	LBB0_8
LBB0_7:
	movl	24(%rbx), %edi
	callq	__bgzf_close
LBB0_8:
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movq	16(%rbx), %rdi
	callq	_free
	movq	8(%rbx), %rdi
	callq	_free
	movq	%rbx, %rdi
	callq	_free_cache
	movq	%rbx, %rdi
	callq	_free
	xorl	%r14d, %r14d
LBB0_10:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BGZF_ERR_IO,4,2                ## @BGZF_ERR_IO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bgzf_close                     ; -- Begin function bgzf_close
	.p2align	2
_bgzf_close:                            ; @bgzf_close
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cbz	x0, LBB0_9
; %bb.1:
	mov	x19, x0
	ldrb	w8, [x0]
	cmp	w8, #119
	b.ne	LBB0_7
; %bb.2:
	mov	x0, x19
	bl	_bgzf_flush
	cbnz	x0, LBB0_9
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	bl	_deflate_block
	mov	x2, x0
	ldr	x0, [x19, #8]
	ldr	w3, [x19, #24]
	mov	w1, #1
	bl	_fwrite
	ldr	w0, [x19, #24]
	bl	_fflush
	cbz	x0, LBB0_5
; %bb.4:
Lloh0:
	adrp	x8, _BGZF_ERR_IO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BGZF_ERR_IO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19, #28]
	orr	w8, w9, w8
	str	w8, [x19, #28]
	mov	w0, #-1
	b	LBB0_10
LBB0_5:
	ldrb	w8, [x19]
	cmp	w8, #119
	b.ne	LBB0_7
; %bb.6:
	ldr	w0, [x19, #24]
	bl	_fclose
	b	LBB0_8
LBB0_7:
	ldr	w0, [x19, #24]
	bl	__bgzf_close
LBB0_8:
	cbz	w0, LBB0_11
LBB0_9:
	mov	w0, #-1
LBB0_10:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_11:
	ldr	x0, [x19, #16]
	bl	_free
	ldr	x0, [x19, #8]
	bl	_free
	mov	x0, x19
	bl	_free_cache
	mov	x0, x19
	bl	_free
	mov	w0, #0
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BGZF_ERR_IO,4,2                ; @BGZF_ERR_IO
.subsections_via_symbols
