	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tricn_write
_tricn_write:                           ## @tricn_write
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %ebx
	movl	%ecx, %r15d
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movq	_TRICN_CMD_ATTEMPTS@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	%r9d, %edi
	callq	_V_WRITE_DATA
	movl	%eax, %r14d
	movl	%ebx, %edi
	callq	_V_REGISTER_OFFSET
	orl	%eax, %r14d
	movl	%r15d, %edi
	callq	_V_CHANNEL_ADDR
	movl	%eax, %r15d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_V_MODULE_ADDR
	orl	%eax, %r15d
	orl	%r14d, %r15d
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_V_BUNDLE_ADDR
	orl	%eax, %r15d
	movq	_TRICN_CMD_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_V_SPI4_COMMAND
	orl	%eax, %r15d
	movq	_A_ESPI_CMD_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	movl	%r15d, %edi
	callq	_writel
	movq	_A_ESPI_GOSTAT@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	addq	8(%r12), %rsi
	xorl	%edi, %edi
	callq	_writel
	decl	%r13d
	movq	_F_ESPI_CMD_BUSY@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	addq	8(%r12), %rdi
	callq	_readl
	movl	%eax, %ebx
	subl	$1, %r13d
	setb	%al
	andl	(%r15), %ebx
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	testb	%al, %al
	je	LBB0_1
LBB0_3:
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.4:
	movl	(%r12), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TRICN_CMD_ATTEMPTS,4,2         ## @TRICN_CMD_ATTEMPTS
	.comm	_TRICN_CMD_WRITE,4,2            ## @TRICN_CMD_WRITE
	.comm	_A_ESPI_CMD_ADDR,8,3            ## @A_ESPI_CMD_ADDR
	.comm	_A_ESPI_GOSTAT,8,3              ## @A_ESPI_GOSTAT
	.comm	_F_ESPI_CMD_BUSY,4,2            ## @F_ESPI_CMD_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: TRICN write timed out\n"

	.no_dead_strip	_tricn_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tricn_write
_tricn_write:                           ; @tricn_write
	.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
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _TRICN_CMD_ATTEMPTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TRICN_CMD_ATTEMPTS@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
	mov	x0, x5
	bl	_V_WRITE_DATA
	mov	x24, x0
	mov	x0, x20
	bl	_V_REGISTER_OFFSET
	orr	w20, w0, w24
	mov	x0, x21
	bl	_V_CHANNEL_ADDR
	orr	w20, w20, w0
	mov	x0, x22
	bl	_V_MODULE_ADDR
	orr	w20, w20, w0
	mov	x0, x23
	bl	_V_BUNDLE_ADDR
	orr	w20, w20, w0
Lloh3:
	adrp	x8, _TRICN_CMD_WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TRICN_CMD_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_V_SPI4_COMMAND
	orr	w0, w20, w0
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x9, _A_ESPI_CMD_ADDR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _A_ESPI_CMD_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x21, _A_ESPI_GOSTAT@GOTPAGE
Lloh10:
	ldr	x21, [x21, _A_ESPI_GOSTAT@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	sub	w22, w25, #1
Lloh11:
	adrp	x23, _F_ESPI_CMD_BUSY@GOTPAGE
Lloh12:
	ldr	x23, [x23, _F_ESPI_CMD_BUSY@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x23]
	and	w20, w8, w0
	cmp	w20, #0
	ccmp	w22, #0, #4, ne
	sub	w22, w22, #1
	b.ne	LBB0_1
; %bb.2:
	cbz	w20, LBB0_4
; %bb.3:
	ldr	w1, [x19]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
LBB0_4:
	mov	x0, x20
	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
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_TRICN_CMD_ATTEMPTS,4,2         ; @TRICN_CMD_ATTEMPTS
	.comm	_TRICN_CMD_WRITE,4,2            ; @TRICN_CMD_WRITE
	.comm	_A_ESPI_CMD_ADDR,8,3            ; @A_ESPI_CMD_ADDR
	.comm	_A_ESPI_GOSTAT,8,3              ; @A_ESPI_GOSTAT
	.comm	_F_ESPI_CMD_BUSY,4,2            ; @F_ESPI_CMD_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: TRICN write timed out\n"

	.no_dead_strip	_tricn_write
.subsections_via_symbols
