	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath5k_pci_eeprom_read
_ath5k_pci_eeprom_read:                 ## @ath5k_pci_eeprom_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, %r15d
	movq	(%rdi), %r12
	movq	(%r12), %rax
	movq	_AR5K_AR5210@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_AR5K_PCICFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR5K_PCICFG_EEAE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_AR5K_REG_ENABLE_BITS
	movq	_AR5K_EEPROM_BASE@GOTPCREL(%rip), %rax
	shll	$2, %r15d
	movslq	%r15d, %rsi
	addq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_ath5k_hw_reg_read
	jmp	LBB0_3
LBB0_2:
	movq	_AR5K_EEPROM_BASE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_ath5k_hw_reg_write
	movq	_AR5K_EEPROM_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR5K_EEPROM_CMD_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_AR5K_REG_ENABLE_BITS
LBB0_3:
	movq	_AR5K_TUNE_REGISTER_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%r15d, %r15d
	testl	%ebx, %ebx
	jle	LBB0_9
## %bb.4:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	incl	%ebx
	movq	_AR5K_EEPROM_STATUS@GOTPCREL(%rip), %r13
	movq	_AR5K_EEPROM_STAT_RDDONE@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rsi
	movq	%r12, %rdi
	callq	_ath5k_hw_reg_read
	testl	%eax, (%r14)
	jne	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$15, %edi
	movl	$20, %esi
	callq	_usleep_range
	decl	%ebx
	cmpl	$1, %ebx
	jg	LBB0_5
	jmp	LBB0_9
LBB0_6:
	movq	_AR5K_EEPROM_STAT_RDERR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_9
## %bb.7:
	movq	_AR5K_EEPROM_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_ath5k_hw_reg_read
	movzwl	%ax, %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movl	$1, %r15d
LBB0_9:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR5K_AR5210,8,3                ## @AR5K_AR5210
	.comm	_AR5K_PCICFG,4,2                ## @AR5K_PCICFG
	.comm	_AR5K_PCICFG_EEAE,4,2           ## @AR5K_PCICFG_EEAE
	.comm	_AR5K_EEPROM_BASE,8,3           ## @AR5K_EEPROM_BASE
	.comm	_AR5K_EEPROM_CMD,4,2            ## @AR5K_EEPROM_CMD
	.comm	_AR5K_EEPROM_CMD_READ,4,2       ## @AR5K_EEPROM_CMD_READ
	.comm	_AR5K_TUNE_REGISTER_TIMEOUT,4,2 ## @AR5K_TUNE_REGISTER_TIMEOUT
	.comm	_AR5K_EEPROM_STATUS,8,3         ## @AR5K_EEPROM_STATUS
	.comm	_AR5K_EEPROM_STAT_RDDONE,4,2    ## @AR5K_EEPROM_STAT_RDDONE
	.comm	_AR5K_EEPROM_STAT_RDERR,4,2     ## @AR5K_EEPROM_STAT_RDERR
	.comm	_AR5K_EEPROM_DATA,8,3           ## @AR5K_EEPROM_DATA
	.no_dead_strip	_ath5k_pci_eeprom_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath5k_pci_eeprom_read
_ath5k_pci_eeprom_read:                 ; @ath5k_pci_eeprom_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
	mov	x19, x2
	mov	x21, x1
	ldr	x20, [x0]
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _AR5K_AR5210@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AR5K_AR5210@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _AR5K_PCICFG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR5K_PCICFG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _AR5K_PCICFG_EEAE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AR5K_PCICFG_EEAE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_AR5K_REG_ENABLE_BITS
Lloh9:
	adrp	x8, _AR5K_EEPROM_BASE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AR5K_EEPROM_BASE@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	lsl	w9, w21, #2
	add	x1, x8, w9, sxtw
	mov	x0, x20
	bl	_ath5k_hw_reg_read
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x8, _AR5K_EEPROM_BASE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AR5K_EEPROM_BASE@GOTPAGEOFF]
Lloh14:
	ldr	x2, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_ath5k_hw_reg_write
Lloh15:
	adrp	x8, _AR5K_EEPROM_CMD@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AR5K_EEPROM_CMD@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _AR5K_EEPROM_CMD_READ@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AR5K_EEPROM_CMD_READ@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_AR5K_REG_ENABLE_BITS
LBB0_3:
Lloh21:
	adrp	x8, _AR5K_TUNE_REGISTER_TIMEOUT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AR5K_TUNE_REGISTER_TIMEOUT@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.4:
	add	w21, w8, #1
Lloh24:
	adrp	x22, _AR5K_EEPROM_STATUS@GOTPAGE
Lloh25:
	ldr	x22, [x22, _AR5K_EEPROM_STATUS@GOTPAGEOFF]
Lloh26:
	adrp	x23, _AR5K_EEPROM_STAT_RDDONE@GOTPAGE
Lloh27:
	ldr	x23, [x23, _AR5K_EEPROM_STAT_RDDONE@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x22]
	mov	x0, x20
	bl	_ath5k_hw_reg_read
	ldr	w8, [x23]
	tst	w8, w0
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #15
	mov	w1, #20
	bl	_usleep_range
	sub	w21, w21, #1
	cmp	w21, #1
	b.gt	LBB0_5
	b	LBB0_8
LBB0_7:
Lloh28:
	adrp	x8, _AR5K_EEPROM_STAT_RDERR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _AR5K_EEPROM_STAT_RDERR@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_10
LBB0_8:
	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
LBB0_10:
Lloh31:
	adrp	x8, _AR5K_EEPROM_DATA@GOTPAGE
Lloh32:
	ldr	x8, [x8, _AR5K_EEPROM_DATA@GOTPAGEOFF]
Lloh33:
	ldr	x1, [x8]
	mov	x0, x20
	bl	_ath5k_hw_reg_read
	and	w8, w0, #0xffff
	str	x8, [x19]
	mov	w0, #1
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_AR5K_AR5210,8,3                ; @AR5K_AR5210
	.comm	_AR5K_PCICFG,4,2                ; @AR5K_PCICFG
	.comm	_AR5K_PCICFG_EEAE,4,2           ; @AR5K_PCICFG_EEAE
	.comm	_AR5K_EEPROM_BASE,8,3           ; @AR5K_EEPROM_BASE
	.comm	_AR5K_EEPROM_CMD,4,2            ; @AR5K_EEPROM_CMD
	.comm	_AR5K_EEPROM_CMD_READ,4,2       ; @AR5K_EEPROM_CMD_READ
	.comm	_AR5K_TUNE_REGISTER_TIMEOUT,4,2 ; @AR5K_TUNE_REGISTER_TIMEOUT
	.comm	_AR5K_EEPROM_STATUS,8,3         ; @AR5K_EEPROM_STATUS
	.comm	_AR5K_EEPROM_STAT_RDDONE,4,2    ; @AR5K_EEPROM_STAT_RDDONE
	.comm	_AR5K_EEPROM_STAT_RDERR,4,2     ; @AR5K_EEPROM_STAT_RDERR
	.comm	_AR5K_EEPROM_DATA,8,3           ; @AR5K_EEPROM_DATA
	.no_dead_strip	_ath5k_pci_eeprom_read
.subsections_via_symbols
