	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _chm_decompress_block
__chm_decompress_block:                 ## @_chm_decompress_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	$6144, %edx                     ## imm = 0x1800
	addl	32(%rbx), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movq	(%rbx), %rcx
	movq	%r14, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_2
## %bb.1:
	movq	%r14, %rax
	cqto
	idivq	%rcx
	jmp	LBB0_3
LBB0_2:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_3:
	movslq	%edx, %rax
	movq	%r14, %rcx
	subq	%rax, %rcx
	movq	8(%rdi), %rbx
	movq	%r14, %rax
	subq	%rbx, %rax
	cmpq	%rbx, %rcx
	cmovgq	%rdx, %rax
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	cmpq	%rbx, %r14
	cmovlq	%rdx, %rax
	testl	%eax, %eax
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_18
## %bb.4:
	jle	LBB0_20
## %bb.5:
	movq	%rbx, %r14
	movslq	%eax, %r15
	incq	%r15
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%ecx, %r12d
	subl	%eax, %r12d
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_8 Depth=1
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, 8(%r13)
	movq	%r13, %rdi
LBB0_7:                                 ##   in Loop: Header=BB0_8 Depth=1
	decq	%r15
	incl	%r12d
	cmpq	$1, %r15
	jle	LBB0_20
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rax
	movslq	%r12d, %r14
	cmpq	%r14, %rax
	je	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	(%rdi), %rcx
	movq	%r14, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_17
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r14, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	LBB0_12
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	40(%rax), %edi
	callq	_LZXreset
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%r12d, %eax
	cltd
	idivl	16(%rdi)
	movq	24(%rdi), %rax
	movslq	%edx, %r13
	movl	%r12d, (%rax,%r13,4)
	movq	48(%rdi), %rax
	movq	(%rax,%r13,8), %rbx
	testq	%rbx, %rbx
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	32(%rcx), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	48(%rdi), %rcx
	movq	%rax, (%rcx,%r13,8)
	movq	48(%rdi), %rax
	movq	(%rax,%r13,8), %rbx
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%rdi, %r13
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	movq	%r14, %rsi
	leaq	-64(%rbp), %rdx
	leaq	-56(%rbp), %rcx
	callq	__chm_get_cmpblock_bounds
	testl	%eax, %eax
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	je	LBB0_30
## %bb.15:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	-64(%rbp), %rdx
	movq	-56(%rbp), %rcx
	movq	%r13, %rdi
	movq	%rsi, %r14
	callq	__chm_fetch_bytes
	movq	%r14, %rsi
	cmpq	-56(%rbp), %rax
	jne	LBB0_30
## %bb.16:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	32(%r13), %r8d
	movl	40(%r13), %edi
	movq	%rbx, %rdx
	movl	%eax, %ecx
	callq	_LZXdecompress
	movq	%r14, %rsi
	movq	_DECR_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
	jmp	LBB0_30
LBB0_17:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	testq	%rdx, %rdx
	jne	LBB0_12
	jmp	LBB0_11
LBB0_18:
	testq	%rdx, %rdx
	jne	LBB0_20
## %bb.19:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	40(%rax), %edi
	movq	%rsi, %rbx
	callq	_LZXreset
	movq	%rbx, %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_20:
	movslq	16(%rdi), %rcx
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rax
	orq	%rcx, %rax
	movq	%rsi, %r12
	shrq	$32, %rax
	je	LBB0_22
## %bb.21:
	movq	%r15, %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rbx
	jmp	LBB0_23
LBB0_22:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %ebx
LBB0_23:
	movq	24(%rdi), %rax
	movl	%r15d, (%rax,%rbx,4)
	movq	48(%rdi), %rax
	movq	(%rax,%rbx,8), %r14
	testq	%r14, %r14
	jne	LBB0_25
## %bb.24:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	32(%rcx), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	48(%rdi), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	48(%rdi), %rax
	movq	(%rax,%rbx,8), %r14
LBB0_25:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, (%rax)
	leaq	-64(%rbp), %rdx
	leaq	-56(%rbp), %rcx
	movq	%rdi, %rbx
	movq	%r15, %rsi
	callq	__chm_get_cmpblock_bounds
	testl	%eax, %eax
	je	LBB0_29
## %bb.26:
	movq	-64(%rbp), %rdx
	movq	-56(%rbp), %rcx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	__chm_fetch_bytes
	cmpq	-56(%rbp), %rax
	jne	LBB0_29
## %bb.27:
	movl	32(%rbx), %r8d
	movl	40(%rbx), %edi
	movq	%r12, %rsi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	_LZXdecompress
	movq	_DECR_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_29
## %bb.28:
	movslq	%r15d, %rax
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	_HeapFree
	movq	32(%rbx), %rbx
	jmp	LBB0_32
LBB0_29:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r12, %rdx
	jmp	LBB0_31
LBB0_30:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	movq	%rsi, %r14
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r14, %rdx
LBB0_31:
	callq	_HeapFree
LBB0_32:
	movq	%rbx, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DECR_OK,8,3                    ## @DECR_OK
	.comm	_stderr,4,2                     ## @stderr
	.no_dead_strip	__chm_decompress_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _chm_decompress_block
__chm_decompress_block:                 ; @_chm_decompress_block
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x2
	mov	x21, x1
	mov	x20, x0
	bl	_GetProcessHeap
	ldr	w8, [x20, #32]
	mov	w9, #6144
	add	w2, w8, w9
	mov	w1, #0
	bl	_HeapAlloc
	mov	x19, x0
	ldp	x8, x23, [x20]
	sdiv	x9, x21, x8
	msub	x9, x9, x8, x21
	sub	x8, x21, w9, sxtw
	sub	x10, x21, x23
	cmp	x8, x23
	ccmp	x21, x23, #8, le
	csel	x8, x9, x10, lt
	cbz	w8, LBB0_13
; %bb.1:
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.2:
	sxtw	x9, w8
	add	x25, x9, #1
	sub	w26, w21, w8
Lloh0:
	adrp	x27, _DECR_OK@GOTPAGE
Lloh1:
	ldr	x27, [x27, _DECR_OK@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	x23, [x20, #8]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	sub	x25, x25, #1
	add	w26, w26, #1
	cmp	x25, #1
	b.le	LBB0_15
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x8, x23
	sxtw	x23, w26
	cmp	x8, x23
	b.eq	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20]
	sdiv	x9, x23, x8
	msub	x8, x9, x8, x23
	cbnz	x8, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x20, #40]
	bl	_LZXreset
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20, #16]
	sdiv	w9, w26, w8
	msub	w8, w9, w8, w26
	ldr	x9, [x20, #24]
	str	w26, [x9, w8, sxtw #2]
	ldr	x9, [x20, #48]
	ldr	x24, [x9, w8, sxtw #3]
	cbnz	x24, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	sxtw	x24, w8
	bl	_GetProcessHeap
	ldr	w2, [x20, #32]
	mov	w1, #0
	bl	_HeapAlloc
	ldr	x8, [x20, #48]
	lsl	x9, x24, #3
	str	x0, [x8, x9]
	ldr	x8, [x20, #48]
	ldr	x24, [x8, x9]
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x2, sp, #8
	mov	x3, sp
	mov	x0, x20
	mov	x1, x23
	bl	__chm_get_cmpblock_bounds
	cbz	w0, LBB0_21
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	ldp	x3, x2, [sp]
	mov	x0, x20
	mov	x1, x19
	bl	__chm_fetch_bytes
	ldr	x8, [sp]
	cmp	x0, x8
	b.ne	LBB0_21
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x3, x0
	ldr	w0, [x20, #40]
	ldr	w4, [x20, #32]
	mov	x1, x19
	mov	x2, x24
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_LZXdecompress
	ldr	x8, [x27]
	cmp	x0, x8
	b.eq	LBB0_3
	b	LBB0_21
LBB0_13:
	cbnz	x9, LBB0_15
; %bb.14:
	ldr	w0, [x20, #40]
	bl	_LZXreset
LBB0_15:
	ldrsw	x8, [x20, #16]
	sdiv	x9, x21, x8
	msub	x24, x9, x8, x21
	ldr	x8, [x20, #24]
	str	w21, [x8, x24, lsl #2]
	ldr	x8, [x20, #48]
	ldr	x23, [x8, x24, lsl #3]
	cbnz	x23, LBB0_17
; %bb.16:
	bl	_GetProcessHeap
	ldr	w2, [x20, #32]
	mov	w1, #0
	bl	_HeapAlloc
	ldr	x8, [x20, #48]
	lsl	x9, x24, #3
	str	x0, [x8, x9]
	ldr	x8, [x20, #48]
	ldr	x23, [x8, x9]
LBB0_17:
	str	x23, [x22]
	add	x2, sp, #8
	mov	x3, sp
	mov	x0, x20
	mov	x1, x21
	bl	__chm_get_cmpblock_bounds
	cbz	w0, LBB0_21
; %bb.18:
	ldp	x3, x2, [sp]
	mov	x0, x20
	mov	x1, x19
	bl	__chm_fetch_bytes
	ldr	x8, [sp]
	cmp	x0, x8
	b.ne	LBB0_21
; %bb.19:
	mov	x3, x0
	ldr	w0, [x20, #40]
	ldr	w4, [x20, #32]
	mov	x1, x19
	mov	x2, x23
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_LZXdecompress
Lloh2:
	adrp	x8, _DECR_OK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DECR_OK@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_21
; %bb.20:
	sxtw	x8, w21
	str	x8, [x20, #8]
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x19
	bl	_HeapFree
	ldr	x0, [x20, #32]
	b	LBB0_22
LBB0_21:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x19
	bl	_HeapFree
	mov	x0, #0
LBB0_22:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_DECR_OK,8,3                    ; @DECR_OK
	.comm	_stderr,4,2                     ; @stderr
	.no_dead_strip	__chm_decompress_block
.subsections_via_symbols
