	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iwl_read_otp_word
_iwl_read_otp_word:                     ## @iwl_read_otp_word
	.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, %r15d
	movq	%rdi, %r12
	movq	_CSR_EEPROM_REG@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_CSR_EEPROM_REG_MSK_ADDR@GOTPCREL(%rip), %rax
	leal	(%r15,%r15), %edx
	andl	(%rax), %edx
	callq	_iwl_write32
	movl	(%r13), %esi
	movq	_CSR_EEPROM_REG_READ_VALID_MSK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_IWL_EEPROM_ACCESS_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rdi
	movl	%ecx, %edx
	callq	_iwl_poll_bit
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_iwl_read32
	movl	%eax, %r15d
	movq	_CSR_OTP_GP_REG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_iwl_read32
	movq	_CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_4
## %bb.3:
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_iwl_set_bit
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_IWL_ERR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_IWL_ERR
	jmp	LBB0_7
LBB0_4:
	movq	_CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_6
## %bb.5:
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_iwl_set_bit
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_IWL_ERR
LBB0_6:
	sarl	$16, %r15d
	movl	%r15d, %edi
	callq	_cpu_to_le16
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CSR_EEPROM_REG,4,2             ## @CSR_EEPROM_REG
	.comm	_CSR_EEPROM_REG_MSK_ADDR,4,2    ## @CSR_EEPROM_REG_MSK_ADDR
	.comm	_CSR_EEPROM_REG_READ_VALID_MSK,4,2 ## @CSR_EEPROM_REG_READ_VALID_MSK
	.comm	_IWL_EEPROM_ACCESS_TIMEOUT,4,2  ## @IWL_EEPROM_ACCESS_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Time out reading OTP[%d]\n"

	.comm	_CSR_OTP_GP_REG,4,2             ## @CSR_OTP_GP_REG
	.comm	_CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK,4,2 ## @CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK
L_.str.1:                               ## @.str.1
	.asciz	"Uncorrectable OTP ECC error, abort OTP read\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK,4,2 ## @CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK
L_.str.2:                               ## @.str.2
	.asciz	"Correctable OTP ECC error, continue read\n"

	.no_dead_strip	_iwl_read_otp_word
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iwl_read_otp_word
_iwl_read_otp_word:                     ; @iwl_read_otp_word
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _CSR_EEPROM_REG@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CSR_EEPROM_REG@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh2:
	adrp	x8, _CSR_EEPROM_REG_MSK_ADDR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CSR_EEPROM_REG_MSK_ADDR@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	and	w2, w8, w21, lsl #1
	bl	_iwl_write32
	ldr	w1, [x23]
Lloh5:
	adrp	x8, _CSR_EEPROM_REG_READ_VALID_MSK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CSR_EEPROM_REG_READ_VALID_MSK@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x8, _IWL_EEPROM_ACCESS_TIMEOUT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IWL_EEPROM_ACCESS_TIMEOUT@GOTPAGEOFF]
Lloh10:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x3, x2
	bl	_iwl_poll_bit
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_iwl_read32
	mov	x21, x0
Lloh11:
	adrp	x22, _CSR_OTP_GP_REG@GOTPAGE
Lloh12:
	ldr	x22, [x22, _CSR_OTP_GP_REG@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_iwl_read32
Lloh13:
	adrp	x8, _CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	tst	w2, w0
	b.eq	LBB0_4
; %bb.2:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_iwl_set_bit
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_IWL_ERR
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_7
LBB0_3:
	mov	x22, x0
	str	x21, [sp]
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_IWL_ERR
	b	LBB0_7
LBB0_4:
Lloh23:
	adrp	x8, _CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	tst	w2, w0
	b.eq	LBB0_6
; %bb.5:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_iwl_set_bit
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_IWL_ERR
LBB0_6:
	asr	w0, w21, #16
	bl	_cpu_to_le16
	mov	w22, #0
	str	w0, [x20]
LBB0_7:
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_CSR_EEPROM_REG,4,2             ; @CSR_EEPROM_REG
	.comm	_CSR_EEPROM_REG_MSK_ADDR,4,2    ; @CSR_EEPROM_REG_MSK_ADDR
	.comm	_CSR_EEPROM_REG_READ_VALID_MSK,4,2 ; @CSR_EEPROM_REG_READ_VALID_MSK
	.comm	_IWL_EEPROM_ACCESS_TIMEOUT,4,2  ; @IWL_EEPROM_ACCESS_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Time out reading OTP[%d]\n"

	.comm	_CSR_OTP_GP_REG,4,2             ; @CSR_OTP_GP_REG
	.comm	_CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK,4,2 ; @CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK
l_.str.1:                               ; @.str.1
	.asciz	"Uncorrectable OTP ECC error, abort OTP read\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK,4,2 ; @CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK
l_.str.2:                               ; @.str.2
	.asciz	"Correctable OTP ECC error, continue read\n"

	.no_dead_strip	_iwl_read_otp_word
.subsections_via_symbols
