	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9300_eeprom_restore_internal
_ar9300_eeprom_restore_internal:        ## @ar9300_eeprom_restore_internal
	.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
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_ath9k_hw_common
	movq	%rax, %r13
	movq	%r12, %rdi
	callq	_ath9k_hw_use_flash
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_ar9300_eeprom_restore_flash
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_4:
	movl	(%rbx), %eax
	cmpl	$255, %eax
	je	LBB0_6
## %bb.5:
	xorl	%r14d, %r14d
	testl	%eax, %eax
	jne	LBB0_33
LBB0_6:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$2048, %edi                     ## imm = 0x800
	callq	_kzalloc
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	_ar9300_default@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_memcpy
	movq	%r12, %rdi
	callq	_AR_SREV_9485
	testq	%rax, %rax
	movq	%r15, -112(%rbp)                ## 8-byte Spill
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	je	LBB0_10
## %bb.9:
	movq	_AR9300_BASE_ADDR_4K@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_33
LBB0_10:
	movq	%r12, %rdi
	callq	_AR_SREV_9330
	testq	%rax, %rax
	jne	LBB0_11
## %bb.12:
	movq	_AR9300_BASE_ADDR@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_11:
	movq	_AR9300_BASE_ADDR_512@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %r14d
	movq	_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	_ar9300_read_eeprom@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %edx
	callq	_ar9300_check_eeprom_header
	testq	%rax, %rax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_18
## %bb.14:
	movq	_AR9300_BASE_ADDR_4K@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	_ar9300_read_eeprom@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %edx
	callq	_ar9300_check_eeprom_header
	testq	%rax, %rax
	jne	LBB0_18
## %bb.15:
	movq	_AR9300_BASE_ADDR_512@GOTPCREL(%rip), %r15
	movl	(%r15), %r14d
	movq	_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	_ar9300_read_eeprom@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %edx
	callq	_ar9300_check_eeprom_header
	testq	%rax, %rax
	jne	LBB0_18
## %bb.16:
	movq	_AR9300_BASE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	_ar9300_read_otp@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %edx
	callq	_ar9300_check_eeprom_header
	testq	%rax, %rax
	jne	LBB0_18
## %bb.17:
	movl	(%r15), %r14d
	movq	_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	_ar9300_read_otp@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %edx
	callq	_ar9300_check_eeprom_header
	testq	%rax, %rax
	je	LBB0_32
LBB0_18:
	movq	_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	_COMP_HDR_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%r15d, %r15d
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_19 Depth=1
	movq	_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	leaq	L_.str.4(%rip), %rdx
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	_COMP_HDR_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %ebx
LBB0_30:                                ##   in Loop: Header=BB0_19 Depth=1
	subl	%ebx, %r14d
	incl	%r15d
	cmpl	$100, %r15d
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_31
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%r14d, %esi
	movq	%rbx, %rdx
	callq	*-56(%rbp)                      ## 8-byte Folded Reload
	testl	%eax, %eax
	je	LBB0_32
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	%rbx, %rdi
	callq	_ar9300_check_header
	testl	%eax, %eax
	je	LBB0_31
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	%rbx, %rdi
	leaq	-64(%rbp), %rsi
	leaq	-60(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	leaq	-88(%rbp), %r8
	leaq	-84(%rbp), %r9
	callq	_ar9300_comp_hdr_unpack
	movq	_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-64(%rbp), %r8d
	movl	-60(%rbp), %r9d
	movl	-44(%rbp), %r10d
	movl	-88(%rbp), %r11d
	movl	-84(%rbp), %ebx
	subq	$8, %rsp
	movq	%r13, %rdi
	leaq	L_.str.3(%rip), %rdx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	pushq	%rbx
	pushq	%r11
	pushq	%r10
	callq	_ath_dbg
	addq	$32, %rsp
	movq	%r12, %rdi
	callq	_AR_SREV_9485
	testq	%rax, %rax
	jne	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_19 Depth=1
	cmpl	$1023, -44(%rbp)                ## imm = 0x3FF
	jg	LBB0_25
LBB0_23:                                ##   in Loop: Header=BB0_19 Depth=1
	movq	%r12, %rdi
	callq	_AR_SREV_9485
	movl	-44(%rbp), %ebx
	testq	%rax, %rax
	je	LBB0_26
## %bb.24:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	_EEPROM_DATA_LEN_9485@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jg	LBB0_25
LBB0_26:                                ##   in Loop: Header=BB0_19 Depth=1
	movslq	%ebx, %rdx
	movq	%rdx, -120(%rbp)                ## 8-byte Spill
	movq	_COMP_HDR_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	addl	%edx, %ecx
	movq	_COMP_CKSUM_LEN@GOTPCREL(%rip), %rax
	addl	(%rax), %ecx
	movq	%r12, %rdi
	movl	%r14d, %esi
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdx
	callq	*-56(%rbp)                      ## 8-byte Folded Reload
	movq	_COMP_HDR_LEN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	(,%rax,4), %rdi
	addq	%r13, %rdi
	movl	-44(%rbp), %esi
	callq	_ar9300_comp_cksum
	movl	%eax, %r12d
	movq	_COMP_HDR_LEN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	-120(%rbp), %rax                ## 8-byte Folded Reload
	leaq	(,%rax,4), %rdi
	addq	%r13, %rdi
	callq	_get_unaligned_le16
	movl	%eax, %r13d
	movq	_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.5(%rip), %rdx
	movl	%r12d, %ecx
	movl	%r13d, %r8d
	xorl	%eax, %eax
	callq	_ath_dbg
	cmpl	%r13d, %r12d
	jne	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	-64(%rbp), %edx
	movl	-60(%rbp), %ecx
	movl	-44(%rbp), %eax
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	%r15d, %esi
	movq	-104(%rbp), %r8                 ## 8-byte Reload
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	pushq	-112(%rbp)                      ## 8-byte Folded Reload
	pushq	%rax
	callq	_ar9300_compress_decision
	addq	$16, %rsp
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_29
LBB0_28:                                ##   in Loop: Header=BB0_19 Depth=1
	movq	_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	leaq	L_.str.6(%rip), %rdx
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	-96(%rbp), %r12                 ## 8-byte Reload
LBB0_29:                                ##   in Loop: Header=BB0_19 Depth=1
	movq	_COMP_HDR_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	addl	%ecx, %ebx
	movq	_COMP_CKSUM_LEN@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	jmp	LBB0_30
LBB0_31:
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_33
LBB0_32:
	movq	%rbx, %rdi
	callq	_kfree
	movl	$-1, %r14d
LBB0_33:
	movl	%r14d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ar9300_default,4,2             ## @ar9300_default
	.comm	_AR9300_BASE_ADDR_4K,4,2        ## @AR9300_BASE_ADDR_4K
	.comm	_AR9300_BASE_ADDR_512,4,2       ## @AR9300_BASE_ADDR_512
	.comm	_AR9300_BASE_ADDR,4,2           ## @AR9300_BASE_ADDR
	.comm	_EEPROM,4,2                     ## @EEPROM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Trying EEPROM access at Address 0x%04x\n"

L_.str.1:                               ## @.str.1
	.asciz	"Trying OTP access at Address 0x%04x\n"

L_.str.2:                               ## @.str.2
	.asciz	"Found valid EEPROM data\n"

	.comm	_COMP_HDR_LEN,4,2               ## @COMP_HDR_LEN
L_.str.3:                               ## @.str.3
	.asciz	"Found block at %x: code=%d ref=%d length=%d major=%d minor=%d\n"

	.comm	_EEPROM_DATA_LEN_9485,4,2       ## @EEPROM_DATA_LEN_9485
L_.str.4:                               ## @.str.4
	.asciz	"Skipping bad header\n"

	.comm	_COMP_CKSUM_LEN,4,2             ## @COMP_CKSUM_LEN
L_.str.5:                               ## @.str.5
	.asciz	"checksum %x %x\n"

L_.str.6:                               ## @.str.6
	.asciz	"skipping block with bad checksum\n"

	.comm	_MSTATE,4,2                     ## @MSTATE
	.no_dead_strip	_ar9300_eeprom_restore_internal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9300_eeprom_restore_internal
_ar9300_eeprom_restore_internal:        ; @ar9300_eeprom_restore_internal
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	bl	_ath9k_hw_common
	mov	x22, x0
	mov	x0, x21
	bl	_ath9k_hw_use_flash
	cbz	x0, LBB0_5
; %bb.1:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_ar9300_eeprom_restore_flash
	cbz	x0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_28
LBB0_3:
	ldr	w8, [x20]
	cmp	w8, #255
	b.eq	LBB0_5
; %bb.4:
	cbnz	w8, LBB0_31
LBB0_5:
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #2048
	bl	_kzalloc
	cbz	x0, LBB0_27
; %bb.6:
	mov	x23, x0
Lloh5:
	adrp	x1, _ar9300_default@GOTPAGE
Lloh6:
	ldr	x1, [x1, _ar9300_default@GOTPAGEOFF]
	str	x20, [sp, #48]                  ; 8-byte Folded Spill
	mov	x0, x20
	str	w19, [sp, #60]                  ; 4-byte Folded Spill
	mov	x2, x19
	bl	_memcpy
	mov	x0, x21
	bl	_AR_SREV_9485
Lloh7:
	adrp	x19, _AR9300_BASE_ADDR_4K@GOTPAGE
Lloh8:
	ldr	x19, [x19, _AR9300_BASE_ADDR_4K@GOTPAGEOFF]
	mov	x8, x19
	cbnz	x0, LBB0_8
; %bb.7:
	mov	x0, x21
	bl	_AR_SREV_9330
Lloh9:
	adrp	x8, _AR9300_BASE_ADDR_512@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AR9300_BASE_ADDR_512@GOTPAGEOFF]
Lloh11:
	adrp	x9, _AR9300_BASE_ADDR@GOTPAGE
Lloh12:
	ldr	x9, [x9, _AR9300_BASE_ADDR@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
LBB0_8:
	ldr	w25, [x8]
Lloh13:
	adrp	x20, _EEPROM@GOTPAGE
Lloh14:
	ldr	x20, [x20, _EEPROM@GOTPAGEOFF]
	ldr	w1, [x20]
	str	x25, [sp]
Lloh15:
	adrp	x2, l_.str@PAGE
Lloh16:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	bl	_ath_dbg
Lloh17:
	adrp	x24, _ar9300_read_eeprom@GOTPAGE
Lloh18:
	ldr	x24, [x24, _ar9300_read_eeprom@GOTPAGEOFF]
	mov	x0, x21
	mov	x1, x24
	mov	x2, x25
	bl	_ar9300_check_eeprom_header
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	cbnz	x0, LBB0_13
; %bb.9:
	ldr	w25, [x19]
	ldr	w1, [x20]
	str	x25, [sp]
Lloh19:
	adrp	x2, l_.str@PAGE
Lloh20:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	bl	_ath_dbg
Lloh21:
	adrp	x24, _ar9300_read_eeprom@GOTPAGE
Lloh22:
	ldr	x24, [x24, _ar9300_read_eeprom@GOTPAGEOFF]
	mov	x0, x21
	mov	x1, x24
	mov	x2, x25
	bl	_ar9300_check_eeprom_header
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	cbnz	x0, LBB0_13
; %bb.10:
Lloh23:
	adrp	x19, _AR9300_BASE_ADDR_512@GOTPAGE
Lloh24:
	ldr	x19, [x19, _AR9300_BASE_ADDR_512@GOTPAGEOFF]
	ldr	w25, [x19]
	ldr	w1, [x20]
	str	x25, [sp]
Lloh25:
	adrp	x2, l_.str@PAGE
Lloh26:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	bl	_ath_dbg
Lloh27:
	adrp	x24, _ar9300_read_eeprom@GOTPAGE
Lloh28:
	ldr	x24, [x24, _ar9300_read_eeprom@GOTPAGEOFF]
	mov	x0, x21
	mov	x1, x24
	mov	x2, x25
	bl	_ar9300_check_eeprom_header
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	cbnz	x0, LBB0_13
; %bb.11:
Lloh29:
	adrp	x8, _AR9300_BASE_ADDR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AR9300_BASE_ADDR@GOTPAGEOFF]
Lloh31:
	ldr	w25, [x8]
	ldr	w1, [x20]
	str	x25, [sp]
Lloh32:
	adrp	x2, l_.str.1@PAGE
Lloh33:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_ath_dbg
Lloh34:
	adrp	x24, _ar9300_read_otp@GOTPAGE
Lloh35:
	ldr	x24, [x24, _ar9300_read_otp@GOTPAGEOFF]
	mov	x0, x21
	mov	x1, x24
	mov	x2, x25
	bl	_ar9300_check_eeprom_header
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	cbnz	x0, LBB0_13
; %bb.12:
	ldr	w25, [x19]
	ldr	w1, [x20]
	str	x25, [sp]
Lloh36:
	adrp	x2, l_.str.1@PAGE
Lloh37:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_ath_dbg
Lloh38:
	adrp	x24, _ar9300_read_otp@GOTPAGE
Lloh39:
	ldr	x24, [x24, _ar9300_read_otp@GOTPAGEOFF]
	mov	x0, x21
	mov	x1, x24
	mov	x2, x25
	bl	_ar9300_check_eeprom_header
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	cbz	x0, LBB0_30
LBB0_13:
	ldr	w1, [x20]
Lloh40:
	adrp	x2, l_.str.2@PAGE
Lloh41:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x22
	bl	_ath_dbg
	mov	w26, #0
Lloh42:
	adrp	x27, _COMP_HDR_LEN@GOTPAGE
Lloh43:
	ldr	x27, [x27, _COMP_HDR_LEN@GOTPAGEOFF]
	ldr	w3, [x27]
Lloh44:
	adrp	x19, l_.str.3@PAGE
Lloh45:
	add	x19, x19, l_.str.3@PAGEOFF
	str	x24, [sp, #64]                  ; 8-byte Folded Spill
	b	LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	w1, [x20]
	mov	x0, x22
Lloh46:
	adrp	x2, l_.str.4@PAGE
Lloh47:
	add	x2, x2, l_.str.4@PAGEOFF
	bl	_ath_dbg
	ldr	w3, [x27]
	mov	x8, x3
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	sub	w25, w25, w8
	add	w26, w26, #1
	cmp	w26, #100
	b.eq	LBB0_26
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x25
	mov	x2, x23
	blr	x24
	cbz	w0, LBB0_30
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x23
	bl	_ar9300_check_header
	cbz	w0, LBB0_26
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	sub	x1, x29, #84
	add	x2, sp, #88
	add	x3, sp, #84
	add	x4, sp, #80
	add	x5, sp, #76
	mov	x0, x23
	bl	_ar9300_comp_hdr_unpack
	ldr	w1, [x20]
	ldur	w8, [x29, #-84]
	ldp	w10, w9, [sp, #84]
	ldp	w12, w11, [sp, #76]
	stp	x11, x12, [sp, #32]
	stp	x9, x10, [sp, #16]
	stp	x25, x8, [sp]
	mov	x0, x22
	mov	x2, x19
	bl	_ath_dbg
	mov	x0, x21
	bl	_AR_SREV_9485
	cbnz	x0, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	w8, [sp, #84]
	cmp	w8, #1023
	b.gt	LBB0_14
LBB0_20:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x21
	bl	_AR_SREV_9485
	ldr	w28, [sp, #84]
	cbz	x0, LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_16 Depth=1
Lloh48:
	adrp	x8, _EEPROM_DATA_LEN_9485@GOTPAGE
Lloh49:
	ldr	x8, [x8, _EEPROM_DATA_LEN_9485@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
	cmp	w28, w8
	b.gt	LBB0_14
LBB0_22:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	w8, [x27]
Lloh51:
	adrp	x9, _COMP_CKSUM_LEN@GOTPAGE
Lloh52:
	ldr	x9, [x9, _COMP_CKSUM_LEN@GOTPAGEOFF]
Lloh53:
	ldr	w9, [x9]
	add	w8, w8, w28
	add	w3, w8, w9
	mov	x0, x21
	mov	x1, x25
	mov	x2, x23
	blr	x24
	ldrsw	x8, [x27]
	add	x0, x23, x8, lsl #2
	ldr	w1, [sp, #84]
	bl	_ar9300_comp_cksum
	mov	x19, x0
	mov	x24, x27
	ldr	w8, [x27]
	add	w8, w8, w28
	add	x0, x23, w8, sxtw #2
	bl	_get_unaligned_le16
	mov	x27, x20
	mov	x20, x0
	ldr	w1, [x27]
	stp	x19, x20, [sp]
	mov	x0, x22
Lloh54:
	adrp	x2, l_.str.5@PAGE
Lloh55:
	add	x2, x2, l_.str.5@PAGEOFF
	bl	_ath_dbg
	cmp	w19, w20
	b.ne	LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_16 Depth=1
	ldur	w2, [x29, #-84]
	ldp	w6, w3, [sp, #84]
	mov	x0, x21
	mov	x1, x26
	ldr	x4, [sp, #48]                   ; 8-byte Folded Reload
	mov	x5, x23
	ldr	w7, [sp, #60]                   ; 4-byte Folded Reload
	bl	_ar9300_compress_decision
	b	LBB0_25
LBB0_24:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	w1, [x27]
	mov	x0, x22
Lloh56:
	adrp	x2, l_.str.6@PAGE
Lloh57:
	add	x2, x2, l_.str.6@PAGEOFF
	bl	_ath_dbg
LBB0_25:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x20, x27
	mov	x27, x24
	ldr	w3, [x24]
Lloh58:
	adrp	x8, _COMP_CKSUM_LEN@GOTPAGE
Lloh59:
	ldr	x8, [x8, _COMP_CKSUM_LEN@GOTPAGEOFF]
Lloh60:
	ldr	w8, [x8]
	add	w9, w3, w28
	add	w8, w9, w8
	ldr	x24, [sp, #64]                  ; 8-byte Folded Reload
Lloh61:
	adrp	x19, l_.str.3@PAGE
Lloh62:
	add	x19, x19, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_26:
	mov	x0, x23
	bl	_kfree
	b	LBB0_29
LBB0_27:
Lloh63:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh64:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_28:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_29:
	mov	x0, x25
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_30:
	mov	x0, x23
	bl	_kfree
	mov	w25, #-1
	b	LBB0_29
LBB0_31:
	mov	w25, #0
	b	LBB0_29
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpAdd	Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGot	Lloh63, Lloh64
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ar9300_default,4,2             ; @ar9300_default
	.comm	_AR9300_BASE_ADDR_4K,4,2        ; @AR9300_BASE_ADDR_4K
	.comm	_AR9300_BASE_ADDR_512,4,2       ; @AR9300_BASE_ADDR_512
	.comm	_AR9300_BASE_ADDR,4,2           ; @AR9300_BASE_ADDR
	.comm	_EEPROM,4,2                     ; @EEPROM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Trying EEPROM access at Address 0x%04x\n"

l_.str.1:                               ; @.str.1
	.asciz	"Trying OTP access at Address 0x%04x\n"

l_.str.2:                               ; @.str.2
	.asciz	"Found valid EEPROM data\n"

	.comm	_COMP_HDR_LEN,4,2               ; @COMP_HDR_LEN
l_.str.3:                               ; @.str.3
	.asciz	"Found block at %x: code=%d ref=%d length=%d major=%d minor=%d\n"

	.comm	_EEPROM_DATA_LEN_9485,4,2       ; @EEPROM_DATA_LEN_9485
l_.str.4:                               ; @.str.4
	.asciz	"Skipping bad header\n"

	.comm	_COMP_CKSUM_LEN,4,2             ; @COMP_CKSUM_LEN
l_.str.5:                               ; @.str.5
	.asciz	"checksum %x %x\n"

l_.str.6:                               ; @.str.6
	.asciz	"skipping block with bad checksum\n"

	.comm	_MSTATE,4,2                     ; @MSTATE
	.no_dead_strip	_ar9300_eeprom_restore_internal
.subsections_via_symbols
