	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_length
_read_length:                           ## @read_length
	.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	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_EP_PAGE_DWORDS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	xorl	%eax, %eax
	testq	%r12, %r12
	je	LBB0_14
## %bb.1:
	movq	_CMD_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$1, %eax
	shll	%cl, %eax
	leaq	(%r12,%rbx), %rcx
	cltq
	cmpq	%rax, %rcx
	jle	LBB0_3
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_14
LBB0_3:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	_EP_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rsi, %r13
	andq	%rbx, %r13
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_7
## %bb.4:
	notq	%rsi
	andq	%rbx, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_read_page
	movq	_EP_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	subq	%r13, %rax
	leaq	(%r14,%r13,8), %rsi
	cmpq	%r12, %rax
	jge	LBB0_5
## %bb.6:
	movq	%r15, %rdi
	movq	%rax, %r14
	movq	%rax, %rdx
	callq	_memcpy
	addq	%r14, %rbx
	subq	%r14, %r12
	addq	%r14, %r15
LBB0_7:
	movq	_EP_PAGE_SIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jl	LBB0_10
## %bb.8:
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_read_page
	movq	_EP_PAGE_SIZE@GOTPCREL(%rip), %r14
	movq	(%r14), %rdx
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_memcpy
	movq	(%r14), %rax
	addq	%rax, %rbx
	subq	%rax, %r12
	addq	%rax, %r15
	cmpq	%rax, %r12
	jge	LBB0_9
LBB0_10:
	testq	%r12, %r12
	je	LBB0_13
## %bb.11:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_read_page
	movq	%r15, %rdi
	movq	%rbx, %rsi
	jmp	LBB0_12
LBB0_5:
	movq	%r15, %rdi
LBB0_12:
	movq	%r12, %rdx
	callq	_memcpy
LBB0_13:
	xorl	%eax, %eax
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_16
## %bb.15:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EP_PAGE_DWORDS,4,2             ## @EP_PAGE_DWORDS
	.comm	_CMD_SHIFT,4,2                  ## @CMD_SHIFT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EP_PAGE_MASK,8,3               ## @EP_PAGE_MASK
	.comm	_EP_PAGE_SIZE,8,3               ## @EP_PAGE_SIZE
	.no_dead_strip	_read_length
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_length
_read_length:                           ; @read_length
	.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	x20, x3
	mov	x19, x2
	mov	x21, x1
	mov	x22, 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	x8, _EP_PAGE_DWORDS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EP_PAGE_DWORDS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #3
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x23, x9, x8
	mov	sp, x23
	cbz	x2, LBB0_12
; %bb.1:
	add	x8, x19, x21
Lloh8:
	adrp	x9, _CMD_SHIFT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CMD_SHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	mov	w10, #1
	lsl	w9, w10, w9
	cmp	x8, w9, sxtw
	b.le	LBB0_3
; %bb.2:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
LBB0_3:
Lloh14:
	adrp	x8, _EP_PAGE_MASK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EP_PAGE_MASK@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
Lloh17:
	adrp	x25, _EP_PAGE_SIZE@GOTPAGE
Lloh18:
	ldr	x25, [x25, _EP_PAGE_SIZE@GOTPAGEOFF]
	ands	x24, x8, x21
	b.eq	LBB0_6
; %bb.4:
	bic	x1, x21, x8
	mov	x0, x22
	mov	x2, x23
	bl	_read_page
	ldr	x8, [x25]
	add	x1, x23, x24, lsl #3
	sub	x24, x8, x24
	cmp	x24, x19
	b.ge	LBB0_10
; %bb.5:
	mov	x0, x20
	mov	x2, x24
	bl	_memcpy
	add	x21, x24, x21
	sub	x19, x19, x24
	add	x20, x20, x24
LBB0_6:
	ldr	x8, [x25]
	cmp	x19, x8
	b.lt	LBB0_8
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x23
	bl	_read_page
	ldr	x2, [x25]
	mov	x0, x20
	mov	x1, x23
	bl	_memcpy
	ldr	x8, [x25]
	add	x21, x8, x21
	add	x20, x20, x8
	sub	x19, x19, x8
	cmp	x19, x8
	b.ge	LBB0_7
LBB0_8:
	cbz	x19, LBB0_12
; %bb.9:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x23
	bl	_read_page
	mov	x0, x20
	mov	x1, x23
	b	LBB0_11
LBB0_10:
	mov	x0, x20
LBB0_11:
	mov	x2, x19
	bl	_memcpy
LBB0_12:
	mov	w0, #0
LBB0_13:
	ldur	x8, [x29, #-72]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %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:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EP_PAGE_DWORDS,4,2             ; @EP_PAGE_DWORDS
	.comm	_CMD_SHIFT,4,2                  ; @CMD_SHIFT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EP_PAGE_MASK,8,3               ; @EP_PAGE_MASK
	.comm	_EP_PAGE_SIZE,8,3               ; @EP_PAGE_SIZE
	.no_dead_strip	_read_length
.subsections_via_symbols
