	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _chm_decompress_region
__chm_decompress_region:                ## @_chm_decompress_region
	.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
	movq	$0, -48(%rbp)
	testq	%rcx, %rcx
	jle	LBB0_1
## %bb.2:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	56(%rdi), %rbx
	movq	%rdx, %rax
	orq	%rbx, %rax
	shrq	$32, %rax
	je	LBB0_3
## %bb.4:
	movq	%rdx, %rax
	xorl	%edx, %edx
	divq	%rbx
	movq	%rdx, %r12
	movq	%rax, %r13
	jmp	LBB0_5
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_3:
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	%ebx
	movl	%edx, %r12d
	movl	%eax, %r13d
LBB0_5:
	subq	%r12, %rbx
	cmpq	%rcx, %rbx
	cmovaeq	%rcx, %rbx
	movl	20(%r14), %edi
	callq	_CHM_ACQUIRE_LOCK
	movl	40(%r14), %edi
	callq	_CHM_ACQUIRE_LOCK
	movq	(%r14), %rcx
	movq	8(%r14), %rsi
	movq	%r13, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_6
## %bb.7:
	movq	%r13, %rax
	xorl	%edx, %edx
	divq	%rsi
	cmpq	%r13, (%rcx,%rdx,8)
	je	LBB0_9
	jmp	LBB0_11
LBB0_6:
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $edx killed $edx def $rdx
	cmpq	%r13, (%rcx,%rdx,8)
	jne	LBB0_11
LBB0_9:
	movq	48(%r14), %rax
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	leaq	(%rax,%r12,4), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_memcpy
	movl	40(%r14), %edi
	callq	_CHM_RELEASE_LOCK
	jmp	LBB0_14
LBB0_11:
	movl	40(%r14), %edi
	callq	_CHM_RELEASE_LOCK
	cmpq	$0, 32(%r14)
	jne	LBB0_13
## %bb.12:
	movl	$-1, 16(%r14)
	movl	24(%r14), %edi
	callq	_LZXinit
	movq	%rax, 32(%r14)
LBB0_13:
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	__chm_decompress_block
	cmpq	%rbx, %rax
	cmovbq	%rax, %rbx
	shlq	$2, %r12
	addq	-48(%rbp), %r12
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_memcpy
LBB0_14:
	movl	20(%r14), %edi
	callq	_CHM_RELEASE_LOCK
LBB0_15:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	__chm_decompress_region
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _chm_decompress_region
__chm_decompress_region:                ; @_chm_decompress_region
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	str	xzr, [sp, #8]
	cmp	x3, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x0, #56]
	udiv	x22, x2, x8
	msub	x23, x22, x8, x2
	sub	x8, x8, x23
	cmp	x8, x3
	csel	x19, x8, x3, lo
	ldr	w0, [x0, #20]
	bl	_CHM_ACQUIRE_LOCK
	ldr	w0, [x20, #40]
	bl	_CHM_ACQUIRE_LOCK
	ldp	x9, x8, [x20]
	udiv	x10, x22, x8
	msub	x8, x10, x8, x22
	ldr	x9, [x9, x8, lsl #3]
	cmp	x9, x22
	b.ne	LBB0_4
; %bb.2:
	ldr	x9, [x20, #48]
	ldr	x8, [x9, x8, lsl #3]
	cbz	x8, LBB0_4
; %bb.3:
	add	x1, x8, x23, lsl #2
	mov	x0, x21
	mov	x2, x19
	bl	_memcpy
	ldr	w0, [x20, #40]
	bl	_CHM_RELEASE_LOCK
	b	LBB0_7
LBB0_4:
	ldr	w0, [x20, #40]
	bl	_CHM_RELEASE_LOCK
	ldr	x8, [x20, #32]
	cbnz	x8, LBB0_6
; %bb.5:
	mov	w8, #-1
	str	w8, [x20, #16]
	ldr	w0, [x20, #24]
	bl	_LZXinit
	str	x0, [x20, #32]
LBB0_6:
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x22
	bl	__chm_decompress_block
	cmp	x0, x19
	csel	x19, x0, x19, lo
	ldr	x8, [sp, #8]
	add	x1, x8, x23, lsl #2
	mov	x0, x21
	mov	x2, x19
	bl	_memcpy
LBB0_7:
	ldr	w0, [x20, #20]
	bl	_CHM_RELEASE_LOCK
	b	LBB0_9
LBB0_8:
	mov	x19, #0
LBB0_9:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	__chm_decompress_region
.subsections_via_symbols
