	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_il_eeprom_init                 ## -- Begin function il_eeprom_init
	.p2align	4, 0x90
_il_eeprom_init:                        ## @il_eeprom_init
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	_CSR_EEPROM_GP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	__il_rd
	movl	%eax, %r14d
	movq	16(%r12), %rax
	movl	(%rax), %ebx
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_D_EEPROM
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_kzalloc
	movq	%rax, 8(%r12)
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	(%r12), %rax
	movq	%r12, %rdi
	callq	*16(%rax)
	movq	%r12, %rdi
	callq	_il_eeprom_verify_signature
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	(%r12), %rax
	movq	%r12, %rdi
	callq	*(%rax)
	testl	%eax, %eax
	js	LBB0_9
## %bb.5:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_12
## %bb.6:
	xorl	%r14d, %r14d
	movq	_CSR_EEPROM_REG@GOTPCREL(%rip), %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	_CSR_EEPROM_REG_MSK_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%r14d, %edx
	movq	%r12, %rdi
	callq	__il_wr
	movq	%r15, %r13
	movl	(%r15), %esi
	movq	_CSR_EEPROM_REG_READ_VALID_MSK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_IL_EEPROM_ACCESS_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rdi
	movl	%ecx, %edx
	callq	__il_poll_bit
	testl	%eax, %eax
	js	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %r15
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	__il_rd
	sarl	$16, %eax
	movl	%eax, %edi
	callq	_cpu_to_le16
	movl	%ebx, %ecx
	shrl	$31, %ecx
	addl	%ebx, %ecx
	sarl	%ecx
	movslq	%ecx, %rcx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, (%rdx,%rcx,4)
	addl	$4, %ebx
	addl	$8, %r14d
	cmpl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	jl	LBB0_7
LBB0_12:
	movq	_EEPROM_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_il_eeprom_query16
	leaq	L_.str.4(%rip), %rdi
	leaq	L_.str.5(%rip), %rsi
	xorl	%r15d, %r15d
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_D_EEPROM
	jmp	LBB0_13
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_17
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_IL_ERR
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_IL_ERR
LBB0_10:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	testl	%r15d, %r15d
	je	LBB0_16
LBB0_15:
	movq	%r12, %rdi
	callq	_il_eeprom_free
LBB0_16:
	movq	%r12, %rdi
	callq	_il_apm_stop
LBB0_17:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%eax, %r15d
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_IL_ERR
LBB0_13:
	movq	(%r12), %rax
	movq	%r12, %rdi
	callq	*8(%rax)
	testl	%r15d, %r15d
	jne	LBB0_15
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_CSR_EEPROM_GP,4,2              ## @CSR_EEPROM_GP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"NVM size = %d\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"EEPROM not found, EEPROM_GP=0x%08x\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
L_.str.2:                               ## @.str.2
	.asciz	"Failed to acquire EEPROM semaphore.\n"

	.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	_IL_EEPROM_ACCESS_TIMEOUT,4,2   ## @IL_EEPROM_ACCESS_TIMEOUT
L_.str.3:                               ## @.str.3
	.asciz	"Time out reading EEPROM[%d]\n"

L_.str.4:                               ## @.str.4
	.asciz	"NVM Type: %s, version: 0x%x\n"

L_.str.5:                               ## @.str.5
	.asciz	"EEPROM"

	.comm	_EEPROM_VERSION,4,2             ## @EEPROM_VERSION
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_il_eeprom_init                 ; -- Begin function il_eeprom_init
	.p2align	2
_il_eeprom_init:                        ; @il_eeprom_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x0
Lloh0:
	adrp	x8, _CSR_EEPROM_GP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CSR_EEPROM_GP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	__il_rd
	mov	x22, x0
	ldr	x8, [x19, #16]
	ldr	w20, [x8]
	str	x20, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_D_EEPROM
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_kzalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_8
; %bb.1:
	mov	x21, x0
	ldr	x8, [x19]
	ldr	x8, [x8, #16]
	mov	x0, x19
	blr	x8
	mov	x0, x19
	bl	_il_eeprom_verify_signature
	tbnz	w0, #31, LBB0_9
; %bb.2:
	ldr	x8, [x19]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	tbnz	w0, #31, LBB0_10
; %bb.3:
	cmp	w20, #1
	b.lt	LBB0_7
; %bb.4:
	mov	w24, #0
	mov	w23, #0
Lloh8:
	adrp	x25, _CSR_EEPROM_REG@GOTPAGE
Lloh9:
	ldr	x25, [x25, _CSR_EEPROM_REG@GOTPAGEOFF]
Lloh10:
	adrp	x26, _CSR_EEPROM_REG_MSK_ADDR@GOTPAGE
Lloh11:
	ldr	x26, [x26, _CSR_EEPROM_REG_MSK_ADDR@GOTPAGEOFF]
Lloh12:
	adrp	x27, _CSR_EEPROM_REG_READ_VALID_MSK@GOTPAGE
Lloh13:
	ldr	x27, [x27, _CSR_EEPROM_REG_READ_VALID_MSK@GOTPAGEOFF]
Lloh14:
	adrp	x28, _IL_EEPROM_ACCESS_TIMEOUT@GOTPAGE
Lloh15:
	ldr	x28, [x28, _IL_EEPROM_ACCESS_TIMEOUT@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	ldr	w8, [x26]
	and	w2, w8, w24
	mov	x0, x19
	bl	__il_wr
	ldr	w1, [x25]
	ldr	w2, [x27]
	ldr	w4, [x28]
	mov	x0, x19
	mov	x3, x2
	bl	__il_poll_bit
	tbnz	w0, #31, LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x25]
	mov	x0, x19
	bl	__il_rd
	asr	w0, w0, #16
	bl	_cpu_to_le16
	cmp	w23, #0
	cinc	w8, w23, lt
	asr	w8, w8, #1
	str	w0, [x21, w8, sxtw #2]
	add	w23, w23, #4
	add	w24, w24, #8
	cmp	w23, w20
	b.lt	LBB0_5
LBB0_7:
Lloh16:
	adrp	x8, _EEPROM_VERSION@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EEPROM_VERSION@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_il_eeprom_query16
                                        ; kill: def $w0 killed $w0 def $x0
Lloh19:
	adrp	x8, l_.str.5@PAGE
Lloh20:
	add	x8, x8, l_.str.5@PAGEOFF
	stp	x8, x0, [sp]
Lloh21:
	adrp	x0, l_.str.4@PAGE
Lloh22:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_D_EEPROM
	mov	w22, #0
	b	LBB0_16
LBB0_8:
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_14
LBB0_9:
	str	x22, [sp]
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_11:
	bl	_IL_ERR
Lloh30:
	adrp	x8, _ENOENT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	neg	w22, w8
	cbz	w22, LBB0_13
LBB0_12:
	mov	x0, x19
	bl	_il_eeprom_free
LBB0_13:
	mov	x0, x19
	bl	_il_apm_stop
LBB0_14:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_15:
	mov	x22, x0
	str	x23, [sp]
Lloh33:
	adrp	x0, l_.str.3@PAGE
Lloh34:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_IL_ERR
LBB0_16:
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	mov	x0, x19
	blr	x8
	cbnz	w22, LBB0_12
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_CSR_EEPROM_GP,4,2              ; @CSR_EEPROM_GP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"NVM size = %d\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"EEPROM not found, EEPROM_GP=0x%08x\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
l_.str.2:                               ; @.str.2
	.asciz	"Failed to acquire EEPROM semaphore.\n"

	.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	_IL_EEPROM_ACCESS_TIMEOUT,4,2   ; @IL_EEPROM_ACCESS_TIMEOUT
l_.str.3:                               ; @.str.3
	.asciz	"Time out reading EEPROM[%d]\n"

l_.str.4:                               ; @.str.4
	.asciz	"NVM Type: %s, version: 0x%x\n"

l_.str.5:                               ; @.str.5
	.asciz	"EEPROM"

	.comm	_EEPROM_VERSION,4,2             ; @EEPROM_VERSION
.subsections_via_symbols
