	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lan743x_otp_read
_lan743x_otp_read:                      ## @lan743x_otp_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
	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:
	testq	%r15, %r15
	jle	LBB0_8
## %bb.5:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r12,%rbx), %rsi
	movq	%r13, %rdi
	callq	_lan743x_otp_set_address
	movq	%r13, %rdi
	callq	_lan743x_otp_read_go
	movq	%r13, %rdi
	callq	_lan743x_otp_wait_till_not_busy
	testl	%eax, %eax
	js	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	_OTP_READ_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_lan743x_csr_read
	movl	%eax, (%r14,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_6
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_READ_DATA,4,2              ## @OTP_READ_DATA
	.no_dead_strip	_lan743x_otp_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lan743x_otp_read
_lan743x_otp_read:                      ; @lan743x_otp_read
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
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:
	cmp	x21, #1
	b.lt	LBB0_8
; %bb.5:
Lloh6:
	adrp	x23, _OTP_READ_DATA@GOTPAGE
Lloh7:
	ldr	x23, [x23, _OTP_READ_DATA@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_lan743x_otp_set_address
	mov	x0, x20
	bl	_lan743x_otp_read_go
	mov	x0, x20
	bl	_lan743x_otp_wait_till_not_busy
	tbnz	w0, #31, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x23]
	mov	x0, x20
	bl	_lan743x_csr_read
	str	w0, [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, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_OTP_SIZE,8,3               ; @MAX_OTP_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_OTP_READ_DATA,4,2              ; @OTP_READ_DATA
	.no_dead_strip	_lan743x_otp_read
.subsections_via_symbols
