	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chdstream_load_hunk
_chdstream_load_hunk:                   ## @chdstream_load_hunk
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$1, %eax
	cmpq	%rsi, (%rdi)
	je	LBB0_7
## %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	16(%rdi), %edi
	movq	8(%r15), %rdx
	callq	_chd_read
	movq	%rax, %rcx
	movq	_CHDERR_NONE@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_7
## %bb.2:
	cmpq	$0, 24(%r15)
	je	LBB0_6
## %bb.3:
	movl	16(%r15), %edi
	callq	_chd_get_header
	movl	(%rax), %eax
	cmpl	$2, %eax
	jl	LBB0_6
## %bb.4:
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movslq	%ecx, %r12
	movq	8(%r15), %r13
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13,%rbx,4), %edi
	callq	_SWAP16
	movl	%eax, (%r13,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_5
LBB0_6:
	movq	%r14, (%r15)
	movl	$1, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHDERR_NONE,8,3                ## @CHDERR_NONE
	.no_dead_strip	_chdstream_load_hunk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chdstream_load_hunk
_chdstream_load_hunk:                   ; @chdstream_load_hunk
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0]
	cmp	x8, x1
	b.eq	LBB0_7
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0, #16]
	ldr	x2, [x20, #8]
	bl	_chd_read
Lloh0:
	adrp	x8, _CHDERR_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CHDERR_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.2:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_6
; %bb.3:
	ldr	w0, [x20, #16]
	bl	_chd_get_header
	ldr	w9, [x0]
	cmp	w9, #0
	cinc	w8, w9, lt
	cmp	w9, #2
	b.lt	LBB0_6
; %bb.4:
	sbfx	x21, x8, #1, #31
	ldr	x22, [x20, #8]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	bl	_SWAP16
	str	w0, [x22], #4
	subs	x21, x21, #1
	b.ne	LBB0_5
LBB0_6:
	str	x19, [x20]
LBB0_7:
	mov	w0, #1
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CHDERR_NONE,8,3                ; @CHDERR_NONE
	.no_dead_strip	_chdstream_load_hunk
.subsections_via_symbols
