	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tg3_ape_otp_read
_tg3_ape_otp_read:                      ## @tg3_ape_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	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_tg3_nvram_lock
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	shll	$3, %ebx
	movq	_TG3_APE_OTP_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_APE_OTP_ADDR_CPU_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_tg3_ape_write32
	movq	_TG3_APE_OTP_CTRL@GOTPCREL(%rip), %rbx
	movq	_APE_OTP_CTRL_PROG_EN@GOTPCREL(%rip), %rax
	movq	_APE_OTP_CTRL_CMD_RD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	(%rbx), %esi
	movq	_APE_OTP_CTRL_START@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_tg3_ape_write32
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_tg3_ape_read32
	movl	$10, %edi
	callq	_udelay
	movl	$100, %r12d
	movq	_TG3_APE_OTP_STATUS@GOTPCREL(%rip), %r14
	movq	_APE_OTP_STATUS_CMD_DONE@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_tg3_ape_read32
	movl	%eax, %ebx
	testl	%eax, (%r13)
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$10, %edi
	callq	_udelay
	decl	%r12d
	jne	LBB0_2
	jmp	LBB0_5
LBB0_3:
	movq	_TG3_APE_OTP_RD_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_tg3_ape_read32
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
LBB0_5:
	movq	_TG3_APE_OTP_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_tg3_ape_write32
	movq	%r15, %rdi
	callq	_tg3_nvram_unlock
	testl	%ebx, (%r13)
	jne	LBB0_7
## %bb.6:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_7:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TG3_APE_OTP_ADDR,4,2           ## @TG3_APE_OTP_ADDR
	.comm	_APE_OTP_ADDR_CPU_ENABLE,4,2    ## @APE_OTP_ADDR_CPU_ENABLE
	.comm	_TG3_APE_OTP_CTRL,4,2           ## @TG3_APE_OTP_CTRL
	.comm	_APE_OTP_CTRL_PROG_EN,4,2       ## @APE_OTP_CTRL_PROG_EN
	.comm	_APE_OTP_CTRL_CMD_RD,4,2        ## @APE_OTP_CTRL_CMD_RD
	.comm	_APE_OTP_CTRL_START,4,2         ## @APE_OTP_CTRL_START
	.comm	_TG3_APE_OTP_STATUS,4,2         ## @TG3_APE_OTP_STATUS
	.comm	_APE_OTP_STATUS_CMD_DONE,4,2    ## @APE_OTP_STATUS_CMD_DONE
	.comm	_TG3_APE_OTP_RD_DATA,4,2        ## @TG3_APE_OTP_RD_DATA
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_tg3_ape_otp_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tg3_ape_otp_read
_tg3_ape_otp_read:                      ; @tg3_ape_otp_read
	.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, x2
	mov	x21, x1
	mov	x19, x0
	bl	_tg3_nvram_lock
	cbnz	w0, LBB0_7
; %bb.1:
Lloh0:
	adrp	x8, _TG3_APE_OTP_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TG3_APE_OTP_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _APE_OTP_ADDR_CPU_ENABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _APE_OTP_ADDR_CPU_ENABLE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	orr	w2, w8, w21, lsl #3
	mov	x0, x19
	bl	_tg3_ape_write32
Lloh6:
	adrp	x22, _TG3_APE_OTP_CTRL@GOTPAGE
Lloh7:
	ldr	x22, [x22, _TG3_APE_OTP_CTRL@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh8:
	adrp	x8, _APE_OTP_CTRL_PROG_EN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _APE_OTP_CTRL_PROG_EN@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _APE_OTP_CTRL_CMD_RD@GOTPAGE
Lloh12:
	ldr	x9, [x9, _APE_OTP_CTRL_CMD_RD@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh14:
	adrp	x9, _APE_OTP_CTRL_START@GOTPAGE
Lloh15:
	ldr	x9, [x9, _APE_OTP_CTRL_START@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_tg3_ape_write32
	ldr	w1, [x22]
	mov	x0, x19
	bl	_tg3_ape_read32
	mov	w0, #10
	bl	_udelay
	mov	w24, #100
Lloh17:
	adrp	x25, _TG3_APE_OTP_STATUS@GOTPAGE
Lloh18:
	ldr	x25, [x25, _TG3_APE_OTP_STATUS@GOTPAGEOFF]
Lloh19:
	adrp	x23, _APE_OTP_STATUS_CMD_DONE@GOTPAGE
Lloh20:
	ldr	x23, [x23, _APE_OTP_STATUS_CMD_DONE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	mov	x0, x19
	bl	_tg3_ape_read32
	mov	x21, x0
	ldr	w8, [x23]
	tst	w8, w0
	b.ne	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #10
	bl	_udelay
	subs	w24, w24, #1
	b.ne	LBB0_2
	b	LBB0_5
LBB0_4:
Lloh21:
	adrp	x8, _TG3_APE_OTP_RD_DATA@GOTPAGE
Lloh22:
	ldr	x8, [x8, _TG3_APE_OTP_RD_DATA@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_tg3_ape_read32
	str	w0, [x20]
LBB0_5:
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #0
	bl	_tg3_ape_write32
	mov	x0, x19
	bl	_tg3_nvram_unlock
	mov	w0, #0
	ldr	w8, [x23]
	tst	w8, w21
	b.ne	LBB0_7
; %bb.6:
Lloh24:
	adrp	x8, _EBUSY@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_TG3_APE_OTP_ADDR,4,2           ; @TG3_APE_OTP_ADDR
	.comm	_APE_OTP_ADDR_CPU_ENABLE,4,2    ; @APE_OTP_ADDR_CPU_ENABLE
	.comm	_TG3_APE_OTP_CTRL,4,2           ; @TG3_APE_OTP_CTRL
	.comm	_APE_OTP_CTRL_PROG_EN,4,2       ; @APE_OTP_CTRL_PROG_EN
	.comm	_APE_OTP_CTRL_CMD_RD,4,2        ; @APE_OTP_CTRL_CMD_RD
	.comm	_APE_OTP_CTRL_START,4,2         ; @APE_OTP_CTRL_START
	.comm	_TG3_APE_OTP_STATUS,4,2         ; @TG3_APE_OTP_STATUS
	.comm	_APE_OTP_STATUS_CMD_DONE,4,2    ; @APE_OTP_STATUS_CMD_DONE
	.comm	_TG3_APE_OTP_RD_DATA,4,2        ; @TG3_APE_OTP_RD_DATA
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_tg3_ape_otp_read
.subsections_via_symbols
