	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lan743x_otp_write
_lan743x_otp_write:                     ## @lan743x_otp_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
	movq	%rcx, %r14
	leaq	(%rdx,%rsi), %rax
	movq	_MAX_OTP_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_2:
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	callq	_lan743x_otp_power_up
	testl	%eax, %eax
	js	LBB0_9
## %bb.3:
	movq	%r13, %rdi
	callq	_lan743x_otp_wait_till_not_busy
	testl	%eax, %eax
	js	LBB0_9
## %bb.4:
	movq	_OTP_PRGM_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_OTP_PRGM_MODE_BYTE_@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_lan743x_csr_write
	testq	%r15, %r15
	jle	LBB0_8
## %bb.5:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r12,%rbx), %rsi
	movq	%r13, %rdi
	callq	_lan743x_otp_set_address
	movq	_OTP_PRGM_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14,%rbx,4), %edx
	movq	%r13, %rdi
	callq	_lan743x_csr_write
	movq	_OTP_TST_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_OTP_TST_CMD_PRGVRFY_@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_lan743x_csr_write
	movq	_OTP_CMD_GO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_OTP_CMD_GO_GO_@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_lan743x_csr_write
	movq	%r13, %rdi
	callq	_lan743x_otp_wait_till_not_busy
	testl	%eax, %eax
	js	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_7
LBB0_8:
	movq	%r13, %rdi
	callq	_lan743x_otp_power_down
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_OTP_SIZE,8,3               ## @MAX_OTP_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_OTP_PRGM_MODE,4,2              ## @OTP_PRGM_MODE
	.comm	_OTP_PRGM_MODE_BYTE_,4,2        ## @OTP_PRGM_MODE_BYTE_
	.comm	_OTP_PRGM_DATA,4,2              ## @OTP_PRGM_DATA
	.comm	_OTP_TST_CMD,4,2                ## @OTP_TST_CMD
	.comm	_OTP_TST_CMD_PRGVRFY_,4,2       ## @OTP_TST_CMD_PRGVRFY_
	.comm	_OTP_CMD_GO,4,2                 ## @OTP_CMD_GO
	.comm	_OTP_CMD_GO_GO_,4,2             ## @OTP_CMD_GO_GO_
	.no_dead_strip	_lan743x_otp_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lan743x_otp_write
_lan743x_otp_write:                     ; @lan743x_otp_write
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, _MAX_OTP_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_OTP_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x9, x2, x1
	cmp	x9, x8
	b.le	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_2:
	mov	x19, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	bl	_lan743x_otp_power_up
	tbnz	w0, #31, LBB0_9
; %bb.3:
	mov	x0, x20
	bl	_lan743x_otp_wait_till_not_busy
	tbnz	w0, #31, LBB0_9
; %bb.4:
Lloh6:
	adrp	x8, _OTP_PRGM_MODE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _OTP_PRGM_MODE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _OTP_PRGM_MODE_BYTE_@GOTPAGE
Lloh10:
	ldr	x8, [x8, _OTP_PRGM_MODE_BYTE_@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_lan743x_csr_write
	cmp	x21, #1
	b.lt	LBB0_8
; %bb.5:
Lloh12:
	adrp	x23, _OTP_PRGM_DATA@GOTPAGE
Lloh13:
	ldr	x23, [x23, _OTP_PRGM_DATA@GOTPAGEOFF]
Lloh14:
	adrp	x24, _OTP_TST_CMD@GOTPAGE
Lloh15:
	ldr	x24, [x24, _OTP_TST_CMD@GOTPAGEOFF]
Lloh16:
	adrp	x25, _OTP_TST_CMD_PRGVRFY_@GOTPAGE
Lloh17:
	ldr	x25, [x25, _OTP_TST_CMD_PRGVRFY_@GOTPAGEOFF]
Lloh18:
	adrp	x26, _OTP_CMD_GO@GOTPAGE
Lloh19:
	ldr	x26, [x26, _OTP_CMD_GO@GOTPAGEOFF]
Lloh20:
	adrp	x27, _OTP_CMD_GO_GO_@GOTPAGE
Lloh21:
	ldr	x27, [x27, _OTP_CMD_GO_GO_@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_lan743x_otp_set_address
	ldr	w1, [x23]
	ldr	w2, [x19]
	mov	x0, x20
	bl	_lan743x_csr_write
	ldr	w1, [x24]
	ldr	w2, [x25]
	mov	x0, x20
	bl	_lan743x_csr_write
	ldr	w1, [x26]
	ldr	w2, [x27]
	mov	x0, x20
	bl	_lan743x_csr_write
	mov	x0, x20
	bl	_lan743x_otp_wait_till_not_busy
	tbnz	w0, #31, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x19, x19, #4
	add	x22, x22, #1
	subs	x21, x21, #1
	b.ne	LBB0_6
LBB0_8:
	mov	x0, x20
	bl	_lan743x_otp_power_down
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_OTP_SIZE,8,3               ; @MAX_OTP_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_OTP_PRGM_MODE,4,2              ; @OTP_PRGM_MODE
	.comm	_OTP_PRGM_MODE_BYTE_,4,2        ; @OTP_PRGM_MODE_BYTE_
	.comm	_OTP_PRGM_DATA,4,2              ; @OTP_PRGM_DATA
	.comm	_OTP_TST_CMD,4,2                ; @OTP_TST_CMD
	.comm	_OTP_TST_CMD_PRGVRFY_,4,2       ; @OTP_TST_CMD_PRGVRFY_
	.comm	_OTP_CMD_GO,4,2                 ; @OTP_CMD_GO
	.comm	_OTP_CMD_GO_GO_,4,2             ; @OTP_CMD_GO_GO_
	.no_dead_strip	_lan743x_otp_write
.subsections_via_symbols
