	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmnand_send_cmd
_brcmnand_send_cmd:                     ## @brcmnand_send_cmd
	.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
	movl	%esi, %r14d
	movq	(%rdi), %rbx
	movq	_BRCMNAND_CMD_ADDRESS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_brcmnand_read_reg
	movl	4(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_dev_dbg
	xorl	%edi, %edi
	cmpl	$0, (%rbx)
	setne	%dil
	callq	_BUG_ON
	movl	%r14d, (%rbx)
	movq	_NAND_CTRL_RDY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%edx, %esi
	xorl	%ecx, %ecx
	callq	_bcmnand_ctrl_poll_status
	movl	%eax, %edi
	callq	_WARN_ON
	xorl	%eax, %eax
	callq	_mb
	movq	_BRCMNAND_CMD_START@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%rbx, %rdi
	callq	_brcmnand_cmd_shift
	movl	%eax, %ecx
	shll	%cl, %r14d
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_brcmnand_write_reg             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BRCMNAND_CMD_ADDRESS,4,2       ## @BRCMNAND_CMD_ADDRESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"send native cmd %d addr 0x%llx\n"

	.comm	_NAND_CTRL_RDY,4,2              ## @NAND_CTRL_RDY
	.comm	_BRCMNAND_CMD_START,4,2         ## @BRCMNAND_CMD_START
	.no_dead_strip	_brcmnand_send_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmnand_send_cmd
_brcmnand_send_cmd:                     ; @brcmnand_send_cmd
	.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	x19, x1
	ldr	x20, [x0]
Lloh0:
	adrp	x8, _BRCMNAND_CMD_ADDRESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BRCMNAND_CMD_ADDRESS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_brcmnand_read_reg
	mov	x3, x0
	ldr	w0, [x20, #4]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_dbg
	ldr	w8, [x20]
	cmp	w8, #0
	cset	w0, ne
	bl	_BUG_ON
	str	w19, [x20]
Lloh5:
	adrp	x8, _NAND_CTRL_RDY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NAND_CTRL_RDY@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x1
	mov	w3, #0
	bl	_bcmnand_ctrl_poll_status
	bl	_WARN_ON
	bl	_mb
Lloh8:
	adrp	x8, _BRCMNAND_CMD_START@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BRCMNAND_CMD_START@GOTPAGEOFF]
Lloh10:
	ldr	w21, [x8]
	mov	x0, x20
	bl	_brcmnand_cmd_shift
	lsl	w2, w19, w0
	mov	x0, x20
	mov	x1, 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
	b	_brcmnand_write_reg
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BRCMNAND_CMD_ADDRESS,4,2       ; @BRCMNAND_CMD_ADDRESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"send native cmd %d addr 0x%llx\n"

	.comm	_NAND_CTRL_RDY,4,2              ; @NAND_CTRL_RDY
	.comm	_BRCMNAND_CMD_START,4,2         ; @BRCMNAND_CMD_START
	.no_dead_strip	_brcmnand_send_cmd
.subsections_via_symbols
