	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_read
_do_read:                               ## @do_read
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_rand_eb
	movl	%eax, %r14d
	xorl	%eax, %eax
	callq	_rand_offs
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_rand_len
	movq	_bbt@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	%r14d, %rdx
	cmpq	$0, 8(%rcx,%rdx,8)
                                        ## kill: def $eax killed $eax def $rax
	movq	_mtd@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	movl	(%rdi), %esi
	je	LBB0_2
## %bb.1:
	cmpl	%esi, %ebx
	cmovgel	%esi, %r15d
	subl	%r15d, %ebx
	leal	(%rbx,%rax), %ecx
	movl	%esi, %edx
	subl	%ebx, %edx
	cmpl	%esi, %ecx
	cmovlel	%eax, %edx
	movl	%edx, %eax
LBB0_2:
	imull	%r14d, %esi
	addl	%ebx, %esi
	movq	_readbuf@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%eax, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtdtest_read                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_bbt,8,3                        ## @bbt
	.comm	_mtd,8,3                        ## @mtd
	.comm	_readbuf,4,2                    ## @readbuf
	.no_dead_strip	_do_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_read
_do_read:                               ; @do_read
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_rand_eb
	mov	x19, x0
	bl	_rand_offs
	mov	x20, x0
	bl	_rand_len
Lloh0:
	adrp	x8, _bbt@GOTPAGE
Lloh1:
	ldr	x8, [x8, _bbt@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	w9, w19, #1
	ldr	x9, [x8, w9, sxtw #3]
Lloh3:
	adrp	x8, _mtd@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mtd@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w10, [x8]
	cmp	w20, w10
	csel	w11, wzr, w10, lt
	sub	w11, w20, w11
	add	w12, w11, w0
	sub	w13, w10, w11
	cmp	w12, w10
	csel	w12, w13, w0, gt
	cmp	x9, #0
	csel	w2, w0, w12, eq
	csel	w9, w20, w11, eq
Lloh6:
	adrp	x11, _readbuf@GOTPAGE
Lloh7:
	ldr	x11, [x11, _readbuf@GOTPAGEOFF]
	madd	w1, w10, w19, w9
Lloh8:
	ldr	w3, [x11]
	mov	x0, x8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mtdtest_read
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_bbt,8,3                        ; @bbt
	.comm	_mtd,8,3                        ; @mtd
	.comm	_readbuf,4,2                    ; @readbuf
	.no_dead_strip	_do_read
.subsections_via_symbols
