	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bgzf_read_block                ## -- Begin function bgzf_read_block
	.p2align	4, 0x90
_bgzf_read_block:                       ## @bgzf_read_block
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_BLOCK_HEADER_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	shlq	$2, %r12
	movq	%r12, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movl	24(%rbx), %edi
	callq	__bgzf_tell
	movl	%eax, %r15d
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_load_block_from_cache
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_14
## %bb.1:
	movq	24(%rbx), %rdi
	movq	%r13, %rsi
	movl	%r12d, %edx
	callq	__bgzf_read
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	cltq
	cmpq	%rax, %r12
	jne	LBB0_5
## %bb.4:
	movq	%r13, %rdi
	callq	_check_header
	testl	%eax, %eax
	je	LBB0_5
## %bb.7:
	movq	%r13, %rdi
	addq	$64, %rdi
	callq	_unpackInt16
	movl	%eax, %ecx
	incl	%ecx
	movq	32(%rbx), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	_BLOCK_HEADER_LENGTH@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%r13, %rsi
	movl	%ecx, %r13d
	callq	_memcpy
	movslq	(%r12), %rax
	movl	%r13d, %r12d
	subl	%eax, %r12d
	movq	24(%rbx), %rdi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rsi
	movl	%r12d, %edx
	callq	__bgzf_read
	cmpl	%r12d, %eax
	jne	LBB0_8
## %bb.9:
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_inflate_block
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	addl	-52(%rbp), %r12d                ## 4-byte Folded Reload
	cmpl	$0, (%rbx)
	je	LBB0_13
## %bb.12:
	movq	$0, 8(%rbx)
LBB0_13:
	movl	%r15d, 4(%rbx)
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_cache_block
	jmp	LBB0_14
LBB0_5:
	movq	_BGZF_ERR_HEADER@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %eax
	orl	%eax, 16(%rbx)
	movl	$-1, %r14d
	jmp	LBB0_14
LBB0_2:
	movl	$0, (%rbx)
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.15:
	movl	%r14d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_BGZF_ERR_IO@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_10:
	movl	$-1, %r14d
	jmp	LBB0_14
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BLOCK_HEADER_LENGTH,4,2        ## @BLOCK_HEADER_LENGTH
	.comm	_BGZF_ERR_HEADER,4,2            ## @BGZF_ERR_HEADER
	.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_read_block                ; -- Begin function bgzf_read_block
	.p2align	2
_bgzf_read_block:                       ; @bgzf_read_block
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x25, _BLOCK_HEADER_LENGTH@GOTPAGE
Lloh4:
	ldr	x25, [x25, _BLOCK_HEADER_LENGTH@GOTPAGEOFF]
	ldr	w8, [x25]
	lsl	x23, x8, #2
	mov	x9, x23
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x23, #15
	and	x9, x9, #0x7fffffff0
	sub	x22, x8, x9
	mov	sp, x22
	ldr	w0, [x0, #24]
	bl	__bgzf_tell
	mov	x20, x0
	mov	x0, x19
	mov	x1, x20
	bl	_load_block_from_cache
	cbz	x0, LBB0_2
LBB0_1:
	mov	w0, #0
	b	LBB0_13
LBB0_2:
	ldr	x0, [x19, #24]
	mov	x1, x22
	mov	x2, x23
	bl	__bgzf_read
	cbz	w0, LBB0_12
; %bb.3:
	mov	x21, x0
	cmp	x23, w0, sxtw
	b.ne	LBB0_10
; %bb.4:
	mov	x0, x22
	bl	_check_header
	cbz	w0, LBB0_10
; %bb.5:
	add	x0, x22, #64
	bl	_unpackInt16
	add	w23, w0, #1
	ldr	x24, [x19, #32]
	ldr	w2, [x25]
	mov	x0, x24
	mov	x1, x22
	bl	_memcpy
	ldrsw	x8, [x25]
	sub	w22, w23, w8
	ldr	x0, [x19, #24]
	add	x1, x24, x8, lsl #2
	mov	x2, x22
	bl	__bgzf_read
	cmp	w0, w22
	b.ne	LBB0_15
; %bb.6:
	mov	x0, x19
	mov	x1, x23
	bl	_inflate_block
	tbnz	w0, #31, LBB0_16
; %bb.7:
	add	w1, w22, w21
	ldr	w8, [x19]
	cbz	w8, LBB0_9
; %bb.8:
	str	xzr, [x19, #8]
LBB0_9:
	stp	w0, w20, [x19]
	mov	x0, x19
	bl	_cache_block
	b	LBB0_1
LBB0_10:
Lloh7:
	adrp	x8, _BGZF_ERR_HEADER@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BGZF_ERR_HEADER@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	ldr	w9, [x19, #16]
	orr	w8, w9, w8
	str	w8, [x19, #16]
	mov	w0, #-1
	b	LBB0_13
LBB0_12:
	str	wzr, [x19]
LBB0_13:
	ldur	x8, [x29, #-72]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.14:
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_15:
Lloh12:
	adrp	x8, _BGZF_ERR_IO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BGZF_ERR_IO@GOTPAGEOFF]
	b	LBB0_11
LBB0_16:
	mov	w0, #-1
	b	LBB0_13
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_BLOCK_HEADER_LENGTH,4,2        ; @BLOCK_HEADER_LENGTH
	.comm	_BGZF_ERR_HEADER,4,2            ; @BGZF_ERR_HEADER
	.comm	_BGZF_ERR_IO,4,2                ; @BGZF_ERR_IO
.subsections_via_symbols
