	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function falcon_read_nvram
_falcon_read_nvram:                     ## @falcon_read_nvram
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movq	%r12, %rdi
	callq	_falcon_spi_present
	movq	%r12, %r13
	testq	%rax, %rax
	jne	LBB0_4
## %bb.1:
	leaq	8(%r12), %r13
	movq	%r13, %rdi
	callq	_falcon_spi_present
	testq	%rax, %rax
	je	LBB0_2
LBB0_4:
	movq	_FALCON_NVCONFIG_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %rbx
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	_FALCON_NVCONFIG_OFFSET@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	4(%r12), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_FALCON_NVCONFIG_END@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	movq	%rbx, %r9
	callq	_falcon_spi_read
	movq	%rbx, %r13
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.7:
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	(%r15), %r14d
	movq	%r12, %rdi
	callq	_falcon_spi_present
	testq	%rax, %rax
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %r8
	cmoveq	%rax, %r8
	leaq	L_.str(%rip), %rcx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_netif_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_8:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	addq	%r13, %r14
	movl	(%r14), %edi
	callq	_le16_to_cpu
	movl	%eax, %r12d
	movl	4(%r14), %edi
	callq	_le16_to_cpu
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	subl	(%rcx), %ebx
	movq	_FALCON_NVCONFIG_BOARD_MAGIC_NUM@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r12d
	jne	LBB0_9
## %bb.11:
	cmpl	$1, %eax
	jg	LBB0_13
## %bb.12:
	movq	_hw@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%r15), %edx
	leaq	L_.str.4(%rip), %rcx
	movq	%r15, %rdi
	movl	%eax, %r8d
	jmp	LBB0_10
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_22
LBB0_9:
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	leaq	L_.str.3(%rip), %rcx
	movq	%r15, %rdi
	movl	%r12d, %r8d
LBB0_10:
	xorl	%eax, %eax
	callq	_netif_err
	jmp	LBB0_21
LBB0_13:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rcx
	movq	_FALCON_NVCONFIG_END@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %r14
	addq	%r13, %r14
	cmpl	$4, %eax
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rbx
	cmovbq	%rcx, %rbx
	leaq	8(%rcx), %rax
	cmovbq	%rax, %r14
	cmpq	%r14, %rbx
	jae	LBB0_17
## %bb.14:
	movq	%rcx, %r13
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edi
	callq	_le16_to_cpu
	addl	%eax, %r12d
	addq	$4, %rbx
	cmpq	%r14, %rbx
	jb	LBB0_15
## %bb.16:
	cmpw	$-1, %r12w
	jne	LBB0_17
## %bb.18:
	xorl	%ebx, %ebx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.19:
	movq	%r13, %rsi
	movl	$8, %edx
	callq	_memcpy
LBB0_20:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_21
LBB0_17:
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	leaq	L_.str.5(%rip), %rcx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_netif_err
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_21:
	movq	%r13, %rdi
	callq	_kfree
LBB0_22:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FALCON_NVCONFIG_END,4,2        ## @FALCON_NVCONFIG_END
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_FALCON_NVCONFIG_OFFSET,4,2     ## @FALCON_NVCONFIG_OFFSET
	.comm	_hw,4,2                         ## @hw
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"flash"

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

	.comm	_EIO,4,2                        ## @EIO
	.comm	_FALCON_NVCONFIG_BOARD_MAGIC_NUM,4,2 ## @FALCON_NVCONFIG_BOARD_MAGIC_NUM
L_.str.3:                               ## @.str.3
	.asciz	"NVRAM bad magic 0x%x\n"

L_.str.4:                               ## @.str.4
	.asciz	"NVRAM has ancient version 0x%x\n"

L_.str.5:                               ## @.str.5
	.asciz	"NVRAM has incorrect checksum\n"

	.no_dead_strip	_falcon_read_nvram
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function falcon_read_nvram
_falcon_read_nvram:                     ; @falcon_read_nvram
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x21, x1
	mov	x20, x0
	ldr	x22, [x0, #8]
	mov	x0, x22
	bl	_falcon_spi_present
	mov	x23, x22
	cbnz	x0, LBB0_2
; %bb.1:
	add	x23, x22, #8
	mov	x0, x23
	bl	_falcon_spi_present
	cbz	x0, LBB0_9
LBB0_2:
Lloh0:
	adrp	x25, _FALCON_NVCONFIG_END@GOTPAGE
Lloh1:
	ldr	x25, [x25, _FALCON_NVCONFIG_END@GOTPAGEOFF]
	ldr	w0, [x25]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_5
; %bb.3:
	mov	x19, x0
Lloh5:
	adrp	x8, _FALCON_NVCONFIG_OFFSET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FALCON_NVCONFIG_OFFSET@GOTPAGEOFF]
Lloh7:
	ldrsw	x26, [x8]
	add	x24, x22, #4
	mov	x0, x24
	bl	_mutex_lock
	ldr	w3, [x25]
	mov	x0, x20
	mov	x1, x23
	mov	w2, #0
	mov	x4, #0
	mov	x5, x19
	bl	_falcon_spi_read
	mov	x23, x0
	mov	x0, x24
	bl	_mutex_unlock
	cbz	w23, LBB0_6
; %bb.4:
Lloh8:
	adrp	x8, _hw@GOTPAGE
Lloh9:
	ldr	x8, [x8, _hw@GOTPAGEOFF]
Lloh10:
	ldr	w21, [x8]
	ldr	w23, [x20]
	mov	x0, x22
	bl	_falcon_spi_present
Lloh11:
	adrp	x8, l_.str.1@PAGE
Lloh12:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh13:
	adrp	x9, l_.str.2@PAGE
Lloh14:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	x0, #0
	csel	x8, x9, x8, eq
	str	x8, [sp]
Lloh15:
	adrp	x3, l_.str@PAGE
Lloh16:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x20
	mov	x1, x21
	mov	x2, x23
	bl	_netif_err
Lloh17:
	adrp	x8, _EIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_21
LBB0_5:
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_10
LBB0_6:
	add	x23, x19, x26
	ldr	w0, [x23]
	bl	_le16_to_cpu
	mov	x24, x0
	ldr	w0, [x23, #4]
	bl	_le16_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w22, w8
Lloh25:
	adrp	x8, _FALCON_NVCONFIG_BOARD_MAGIC_NUM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _FALCON_NVCONFIG_BOARD_MAGIC_NUM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	w24, w8
	b.ne	LBB0_11
; %bb.7:
	cmp	w0, #1
	b.gt	LBB0_12
; %bb.8:
Lloh28:
	adrp	x8, _hw@GOTPAGE
Lloh29:
	ldr	x8, [x8, _hw@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	ldr	w2, [x20]
	str	x0, [sp]
Lloh31:
	adrp	x3, l_.str.4@PAGE
Lloh32:
	add	x3, x3, l_.str.4@PAGEOFF
	b	LBB0_20
LBB0_9:
Lloh33:
	adrp	x8, _EINVAL@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_22
LBB0_11:
Lloh35:
	adrp	x8, _hw@GOTPAGE
Lloh36:
	ldr	x8, [x8, _hw@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	ldr	w2, [x20]
	str	x24, [sp]
Lloh38:
	adrp	x3, l_.str.3@PAGE
Lloh39:
	add	x3, x3, l_.str.3@PAGEOFF
	b	LBB0_20
LBB0_12:
	add	x8, x23, #8
	ldrsw	x9, [x25]
	add	x9, x19, x9
	cmp	w0, #4
	csel	x24, x23, x19, lo
	csel	x25, x8, x9, lo
	cmp	x24, x25
	b.hs	LBB0_19
; %bb.13:
	mov	w26, #0
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24], #4
	bl	_le16_to_cpu
	add	w26, w0, w26
	cmp	x24, x25
	b.lo	LBB0_14
; %bb.15:
	mvn	w8, w26
	tst	w8, #0xffff
	b.ne	LBB0_19
; %bb.16:
	cbz	x21, LBB0_18
; %bb.17:
	mov	x0, x21
	mov	x1, x23
	mov	w2, #8
	bl	_memcpy
LBB0_18:
	mov	w22, #0
	b	LBB0_21
LBB0_19:
Lloh40:
	adrp	x8, _hw@GOTPAGE
Lloh41:
	ldr	x8, [x8, _hw@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	ldr	w2, [x20]
Lloh43:
	adrp	x3, l_.str.5@PAGE
Lloh44:
	add	x3, x3, l_.str.5@PAGEOFF
LBB0_20:
	mov	x0, x20
	bl	_netif_err
LBB0_21:
	mov	x0, x19
	bl	_kfree
LBB0_22:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FALCON_NVCONFIG_END,4,2        ; @FALCON_NVCONFIG_END
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_FALCON_NVCONFIG_OFFSET,4,2     ; @FALCON_NVCONFIG_OFFSET
	.comm	_hw,4,2                         ; @hw
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"flash"

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

	.comm	_EIO,4,2                        ; @EIO
	.comm	_FALCON_NVCONFIG_BOARD_MAGIC_NUM,4,2 ; @FALCON_NVCONFIG_BOARD_MAGIC_NUM
l_.str.3:                               ; @.str.3
	.asciz	"NVRAM bad magic 0x%x\n"

l_.str.4:                               ; @.str.4
	.asciz	"NVRAM has ancient version 0x%x\n"

l_.str.5:                               ; @.str.5
	.asciz	"NVRAM has incorrect checksum\n"

	.no_dead_strip	_falcon_read_nvram
.subsections_via_symbols
