	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmnand_read_byte
_brcmnand_read_byte:                    ## @brcmnand_read_byte
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_nand_get_controller_data
	movq	%rax, %r15
	movq	16(%rax), %r14
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	addl	$-128, %eax
	cmpl	$5, %eax
	ja	LBB0_16
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_10:
	movslq	8(%r15), %rsi
	movslq	4(%r15), %rax
	addq	%rax, %rsi
	movq	_FC_BYTES@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rbx
	decq	%rbx
	andq	%rsi, %rbx
	testq	%rax, %rax
	jle	LBB0_13
## %bb.11:
	testl	%ebx, %ebx
	jne	LBB0_13
## %bb.12:
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nand_change_read_column_op
LBB0_13:
	movq	(%r14), %rax
	movl	(%rax,%rbx,4), %ebx
	jmp	LBB0_16
LBB0_8:
	movq	_BRCMNAND_INTFC_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_brcmnand_read_reg
	movl	%eax, %ebx
	movq	_INTFC_FLASH_STATUS@GOTPCREL(%rip), %rax
	movq	_wp_on@GOTPCREL(%rip), %rcx
	andl	(%rax), %ebx
	cmpl	$0, (%rcx)
	je	LBB0_16
## %bb.9:
	movq	_NAND_STATUS_WP@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	jmp	LBB0_16
LBB0_7:
	movl	4(%r15), %esi
	movq	%r14, %rdi
	callq	_oob_reg_read
	movl	%eax, %ebx
	jmp	LBB0_16
LBB0_14:
	movslq	4(%r15), %rax
	movq	_ONFI_SUBFEATURE_PARAM_LEN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	cmpq	%rax, %rdx
	jle	LBB0_16
## %bb.15:
	decq	%rdx
	xorl	%ecx, %ecx
	cmpq	%rax, %rdx
	sete	%cl
	movq	_LL_OP_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_brcmnand_low_level_op
	movq	_BRCMNAND_LL_RDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_brcmnand_read_reg
	movzbl	%al, %ebx
	jmp	LBB0_16
LBB0_2:
	movl	4(%r15), %eax
	cmpl	$3, %eax
	jg	LBB0_5
## %bb.3:
	movq	_BRCMNAND_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_brcmnand_read_reg
	movl	%eax, %ebx
	movb	4(%r15), %al
	shlb	$3, %al
	movb	$24, %cl
	jmp	LBB0_4
LBB0_5:
	cmpl	$7, %eax
	ja	LBB0_16
## %bb.6:
	movq	_BRCMNAND_ID_EXT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_brcmnand_read_reg
	movl	%eax, %ebx
	movb	4(%r15), %al
	shlb	$3, %al
	movb	$56, %cl
LBB0_4:
	subb	%al, %cl
	sarl	%cl, %ebx
LBB0_16:
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_dbg
	incl	4(%r15)
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
LJTI0_0:
	.long	L0_0_set_8
	.long	L0_0_set_10
	.long	L0_0_set_7
	.long	L0_0_set_2
	.long	L0_0_set_10
	.long	L0_0_set_14
	.end_data_region
                                        ## -- End function
	.comm	_BRCMNAND_ID,4,2                ## @BRCMNAND_ID
	.comm	_BRCMNAND_ID_EXT,4,2            ## @BRCMNAND_ID_EXT
	.comm	_BRCMNAND_INTFC_STATUS,4,2      ## @BRCMNAND_INTFC_STATUS
	.comm	_INTFC_FLASH_STATUS,4,2         ## @INTFC_FLASH_STATUS
	.comm	_wp_on,4,2                      ## @wp_on
	.comm	_NAND_STATUS_WP,4,2             ## @NAND_STATUS_WP
	.comm	_FC_BYTES,4,2                   ## @FC_BYTES
	.comm	_ONFI_SUBFEATURE_PARAM_LEN,8,3  ## @ONFI_SUBFEATURE_PARAM_LEN
	.comm	_LL_OP_RD,4,2                   ## @LL_OP_RD
	.comm	_BRCMNAND_LL_RDATA,4,2          ## @BRCMNAND_LL_RDATA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read byte = 0x%02x\n"

	.no_dead_strip	_brcmnand_read_byte
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmnand_read_byte
_brcmnand_read_byte:                    ; @brcmnand_read_byte
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x0
	bl	_nand_get_controller_data
	mov	x19, x0
	ldr	x20, [x0, #16]
	ldr	w8, [x0]
	sub	w8, w8, #128
	cmp	w8, #5
	b.hi	LBB0_15
; %bb.1:
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	ldp	w9, w8, [x19, #4]
Lloh2:
	adrp	x10, _FC_BYTES@GOTPAGE
Lloh3:
	ldr	x10, [x10, _FC_BYTES@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	sub	w10, w10, #1
	add	w1, w9, w8
	and	w22, w10, w1
	cmp	w9, #1
	ccmp	w22, #0, #0, ge
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x21
	mov	x2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_nand_change_read_column_op
LBB0_4:
	ldr	x8, [x20]
	ldr	w21, [x8, w22, sxtw #2]
	b	LBB0_16
LBB0_5:
Lloh5:
	adrp	x8, _BRCMNAND_INTFC_STATUS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BRCMNAND_INTFC_STATUS@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_brcmnand_read_reg
Lloh8:
	adrp	x8, _INTFC_FLASH_STATUS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _INTFC_FLASH_STATUS@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	and	w21, w8, w0
Lloh11:
	adrp	x8, _wp_on@GOTPAGE
Lloh12:
	ldr	x8, [x8, _wp_on@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cbz	w8, LBB0_16
; %bb.6:
Lloh14:
	adrp	x8, _NAND_STATUS_WP@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NAND_STATUS_WP@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	orr	w21, w8, w21
	b	LBB0_16
LBB0_7:
	ldr	w1, [x19, #4]
	mov	x0, x20
	bl	_oob_reg_read
	mov	x21, x0
	b	LBB0_16
LBB0_8:
	ldrsw	x8, [x19, #4]
Lloh17:
	adrp	x9, _ONFI_SUBFEATURE_PARAM_LEN@GOTPAGE
Lloh18:
	ldr	x9, [x9, _ONFI_SUBFEATURE_PARAM_LEN@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.le	LBB0_15
; %bb.9:
	sub	x9, x9, #1
	cmp	x9, x8
	cset	w3, eq
Lloh20:
	adrp	x8, _LL_OP_RD@GOTPAGE
Lloh21:
	ldr	x8, [x8, _LL_OP_RD@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_brcmnand_low_level_op
Lloh23:
	adrp	x8, _BRCMNAND_LL_RDATA@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BRCMNAND_LL_RDATA@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_brcmnand_read_reg
	and	w21, w0, #0xff
	b	LBB0_16
LBB0_10:
	ldr	w8, [x19, #4]
	cmp	w8, #3
	b.gt	LBB0_12
; %bb.11:
Lloh26:
	adrp	x8, _BRCMNAND_ID@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BRCMNAND_ID@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_brcmnand_read_reg
	ldr	w8, [x19, #4]
	mov	w9, #24
	b	LBB0_14
LBB0_12:
	cmp	w8, #7
	b.hi	LBB0_15
; %bb.13:
Lloh29:
	adrp	x8, _BRCMNAND_ID_EXT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _BRCMNAND_ID_EXT@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_brcmnand_read_reg
	ldr	w8, [x19, #4]
	mov	w9, #56
LBB0_14:
	sub	w8, w9, w8, lsl #3
	asr	w21, w0, w8
	b	LBB0_16
LBB0_15:
	mov	w21, #0
LBB0_16:
	ldr	w0, [x20, #8]
Lloh32:
	adrp	x1, l_.str@PAGE
Lloh33:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
                                        ; -- End function
	.comm	_BRCMNAND_ID,4,2                ; @BRCMNAND_ID
	.comm	_BRCMNAND_ID_EXT,4,2            ; @BRCMNAND_ID_EXT
	.comm	_BRCMNAND_INTFC_STATUS,4,2      ; @BRCMNAND_INTFC_STATUS
	.comm	_INTFC_FLASH_STATUS,4,2         ; @INTFC_FLASH_STATUS
	.comm	_wp_on,4,2                      ; @wp_on
	.comm	_NAND_STATUS_WP,4,2             ; @NAND_STATUS_WP
	.comm	_FC_BYTES,4,2                   ; @FC_BYTES
	.comm	_ONFI_SUBFEATURE_PARAM_LEN,8,3  ; @ONFI_SUBFEATURE_PARAM_LEN
	.comm	_LL_OP_RD,4,2                   ; @LL_OP_RD
	.comm	_BRCMNAND_LL_RDATA,4,2          ; @BRCMNAND_LL_RDATA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read byte = 0x%02x\n"

	.no_dead_strip	_brcmnand_read_byte
.subsections_via_symbols
