	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t3_mc7_bd_read                 ## -- Begin function t3_mc7_bd_read
	.p2align	4, 0x90
_t3_mc7_bd_read:                        ## @t3_mc7_bd_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rdi, %r12
	movl	(%rdi), %edi
	leal	7(%rdi), %eax
	testl	%edi, %edi
	cmovnsl	%edi, %eax
	sarl	$3, %eax
	cmpl	%esi, %eax
	jbe	LBB0_2
## %bb.1:
	leal	(%rdx,%rsi), %edi
	cmpl	%eax, %edi
	ja	LBB0_2
## %bb.4:
	testl	%edx, %edx
	je	LBB0_5
## %bb.6:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	16(%r12), %rbx
	movb	4(%r12), %cl
	movl	$8, %r13d
	shll	%cl, %r13d
	imull	%esi, %r13d
	movq	_A_MC7_BD_OP@GOTPCREL(%rip), %r15
	movq	_F_BUSY@GOTPCREL(%rip), %r14
	jmp	LBB0_7
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%rax)
	addq	$4, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	testl	%edx, %edx
	je	LBB0_20
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
                                        ##       Child Loop BB0_10 Depth 3
	movb	4(%r12), %cl
	movl	$-1, %eax
	shll	%cl, %eax
	decl	%edx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	notl	%eax
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_8 Depth=2
	movslq	%edx, %rcx
	leaq	_t3_mc7_bd_read.step(%rip), %rdx
	movl	(%rdx,%rcx,4), %ecx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	imull	%edx, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	orl	%eax, -44(%rbp)                 ## 4-byte Folded Spill
LBB0_18:                                ##   in Loop: Header=BB0_8 Depth=2
	addl	$8, %r13d
	leal	-1(%rdx), %eax
	testl	%edx, %edx
                                        ## kill: def $eax killed $eax def $rax
	jle	LBB0_19
LBB0_8:                                 ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_10 Depth 3
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_A_MC7_BD_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_t3_write_reg
	movq	(%r15), %rsi
	addq	8(%r12), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_t3_write_reg
	movq	(%r15), %rsi
	addq	8(%r12), %rsi
	movq	%rbx, %rdi
	callq	_t3_read_reg
	testl	%eax, (%r14)
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movl	$-9, %r13d
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_7 Depth=1
                                        ##     Parent Loop BB0_8 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	(%r15), %rsi
	addq	8(%r12), %rsi
	movq	%rbx, %rdi
	callq	_t3_read_reg
	andl	(%r14), %eax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=3
	leal	1(%r13), %ecx
	testl	%r13d, %r13d
	movl	%ecx, %r13d
	jne	LBB0_10
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=2
	testl	%eax, %eax
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	jne	LBB0_21
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=2
	movq	_A_MC7_BD_DATA1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	movq	%rbx, %rdi
	callq	_t3_read_reg
	movl	4(%r12), %edx
	testq	%rdx, %rdx
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_8 Depth=2
	cmpl	$2, %edx
	jl	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_8 Depth=2
	leaq	_t3_mc7_bd_read.shift(%rip), %rcx
	movb	(%rcx,%rdx,4), %cl
	sarl	%cl, %eax
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=2
	movq	_A_MC7_BD_DATA0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	movq	%rbx, %rdi
	callq	_t3_read_reg
                                        ## implicit-def: $eax
                                        ## kill: killed $eax
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_21:
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_20:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	xorl	%eax, %eax
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @t3_mc7_bd_read.shift
_t3_mc7_bd_read.shift:
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	16                              ## 0x10
	.long	24                              ## 0x18

	.p2align	4                               ## @t3_mc7_bd_read.step
_t3_mc7_bd_read.step:
	.long	0                               ## 0x0
	.long	32                              ## 0x20
	.long	16                              ## 0x10
	.long	8                               ## 0x8

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_A_MC7_BD_ADDR,8,3              ## @A_MC7_BD_ADDR
	.comm	_A_MC7_BD_OP,8,3                ## @A_MC7_BD_OP
	.comm	_F_BUSY,4,2                     ## @F_BUSY
	.comm	_EIO,4,2                        ## @EIO
	.comm	_A_MC7_BD_DATA1,8,3             ## @A_MC7_BD_DATA1
	.comm	_A_MC7_BD_DATA0,8,3             ## @A_MC7_BD_DATA0
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t3_mc7_bd_read                 ; -- Begin function t3_mc7_bd_read
	.p2align	2
_t3_mc7_bd_read:                        ; @t3_mc7_bd_read
	.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
	ldr	w8, [x0]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #3
	add	w9, w2, w1
	cmp	w8, w1
	ccmp	w9, w8, #2, hi
	b.ls	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_17
LBB0_2:
	cbz	w2, LBB0_18
; %bb.3:
	mov	x21, x0
	str	x3, [sp, #8]                    ; 8-byte Folded Spill
	ldr	x22, [x0, #16]
	ldr	w8, [x0, #4]
	mov	w9, #8
	lsl	w8, w9, w8
	mul	w23, w8, w1
	mov	w9, #-1
Lloh2:
	adrp	x25, _A_MC7_BD_ADDR@GOTPAGE
Lloh3:
	ldr	x25, [x25, _A_MC7_BD_ADDR@GOTPAGEOFF]
Lloh4:
	adrp	x26, _A_MC7_BD_OP@GOTPAGE
Lloh5:
	ldr	x26, [x26, _A_MC7_BD_OP@GOTPAGEOFF]
Lloh6:
	adrp	x27, _F_BUSY@GOTPAGE
Lloh7:
	ldr	x27, [x27, _F_BUSY@GOTPAGEOFF]
Lloh8:
	adrp	x28, _A_MC7_BD_DATA1@GOTPAGE
Lloh9:
	ldr	x28, [x28, _A_MC7_BD_DATA1@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #0
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	str	w19, [x8], #4
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	ldr	w2, [sp, #4]                    ; 4-byte Folded Reload
	mov	w9, #-1
	cbz	w2, LBB0_19
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;       Child Loop BB0_10 Depth 3
	mov	w19, #0
	sub	w2, w2, #1
	str	w2, [sp, #4]                    ; 4-byte Folded Spill
	ldr	w8, [x21, #4]
	lsl	w8, w9, w8
	mvn	w20, w8
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=2
Lloh10:
	adrp	x9, _t3_mc7_bd_read.step@PAGE
Lloh11:
	add	x9, x9, _t3_mc7_bd_read.step@PAGEOFF
	ldr	w8, [x9, w8, sxtw #2]
	mul	w8, w8, w20
	lsl	w8, w0, w8
	orr	w19, w8, w19
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	add	w23, w23, #8
	sub	w8, w20, #1
	cmp	w20, #0
	mov	x20, x8
	b.le	LBB0_4
LBB0_8:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_10 Depth 3
	ldr	x8, [x21, #8]
	ldr	x9, [x25]
	add	x1, x9, x8
	mov	x0, x22
	mov	x2, x23
	bl	_t3_write_reg
	ldr	x8, [x21, #8]
	ldr	x9, [x26]
	add	x1, x9, x8
	mov	x0, x22
	mov	w2, #0
	bl	_t3_write_reg
	ldr	x8, [x21, #8]
	ldr	x9, [x26]
	add	x1, x9, x8
	mov	x0, x22
	bl	_t3_read_reg
	ldr	w8, [x27]
	tst	w8, w0
	b.eq	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	mov	w24, #-9
LBB0_10:                                ;   Parent Loop BB0_5 Depth=1
                                        ;     Parent Loop BB0_8 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x8, [x21, #8]
	ldr	x9, [x26]
	add	x1, x9, x8
	mov	x0, x22
	bl	_t3_read_reg
	ldr	w8, [x27]
	and	w8, w8, w0
	cmp	w8, #0
	ccmp	w24, #0, #4, ne
	add	w24, w24, #1
	b.ne	LBB0_10
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=2
	cbnz	w8, LBB0_16
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	x8, [x21, #8]
	ldr	x9, [x28]
	add	x1, x9, x8
	mov	x0, x22
	bl	_t3_read_reg
	ldr	w8, [x21, #4]
	cbz	w8, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=2
	cmp	w8, #2
	b.lt	LBB0_6
; %bb.14:                               ;   in Loop: Header=BB0_8 Depth=2
Lloh12:
	adrp	x9, _t3_mc7_bd_read.shift@PAGE
Lloh13:
	add	x9, x9, _t3_mc7_bd_read.shift@PAGEOFF
	ldr	w9, [x9, x8, lsl #2]
	asr	w0, w0, w9
	b	LBB0_6
LBB0_15:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	x8, [x21, #8]
Lloh14:
	adrp	x9, _A_MC7_BD_DATA0@GOTPAGE
Lloh15:
	ldr	x9, [x9, _A_MC7_BD_DATA0@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x22
	bl	_t3_read_reg
                                        ; implicit-def: $w19
	b	LBB0_7
LBB0_16:
Lloh17:
	adrp	x8, _EIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_17:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_19
LBB0_18:
	mov	w0, #0
LBB0_19:
	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 AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @t3_mc7_bd_read.shift
_t3_mc7_bd_read.shift:
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	16                              ; 0x10
	.long	24                              ; 0x18

	.p2align	2                               ; @t3_mc7_bd_read.step
_t3_mc7_bd_read.step:
	.long	0                               ; 0x0
	.long	32                              ; 0x20
	.long	16                              ; 0x10
	.long	8                               ; 0x8

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_A_MC7_BD_ADDR,8,3              ; @A_MC7_BD_ADDR
	.comm	_A_MC7_BD_OP,8,3                ; @A_MC7_BD_OP
	.comm	_F_BUSY,4,2                     ; @F_BUSY
	.comm	_EIO,4,2                        ; @EIO
	.comm	_A_MC7_BD_DATA1,8,3             ; @A_MC7_BD_DATA1
	.comm	_A_MC7_BD_DATA0,8,3             ; @A_MC7_BD_DATA0
.subsections_via_symbols
