	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ql_get_8000_flash_params
_ql_get_8000_flash_params:              ## @ql_get_8000_flash_params
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	32(%rdi), %r12d
	movq	_FUNC0_FLASH_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_FUNC1_FLASH_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_SEM_FLASH_MASK@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_ql_sem_spinlock
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_2:
	leaq	8(%r14), %rdx
	testl	%r12d, %r12d
	cmovel	%r13d, %ebx
	sarl	$2, %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_ql_read_flash_word
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	movq	_ifup@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r14), %rdx
	leaq	L_.str(%rip), %rcx
	movq	%r14, %rdi
	callq	_netif_err
	jmp	LBB0_10
LBB0_4:
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_ql_validate_flash
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movq	_ifup@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r14), %rdx
	leaq	L_.str.2(%rip), %rcx
LBB0_6:
	movq	%r14, %rdi
	callq	_netif_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_7:
	xorl	%eax, %eax
	cmpl	$2, 8(%r14)
	sete	%al
	movq	16(%r14,%rax,8), %rsi
	movq	(%r14), %rax
	movl	(%rax), %edx
	leaq	-80(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_memcpy
	movq	%rbx, %rdi
	callq	_is_valid_ether_addr
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movq	(%r14), %rax
	movq	8(%rax), %rdi
	movl	(%rax), %edx
	leaq	-80(%rbp), %rsi
	callq	_memcpy
	xorl	%ebx, %ebx
LBB0_10:
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_ql_sem_unlock
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_ifup@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r14), %rdx
	leaq	L_.str.3(%rip), %rcx
	jmp	LBB0_6
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FUNC0_FLASH_OFFSET,4,2         ## @FUNC0_FLASH_OFFSET
	.comm	_FUNC1_FLASH_OFFSET,4,2         ## @FUNC1_FLASH_OFFSET
	.comm	_SEM_FLASH_MASK,4,2             ## @SEM_FLASH_MASK
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_ifup,4,2                       ## @ifup
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading flash.\n"

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

L_.str.2:                               ## @.str.2
	.asciz	"Invalid flash.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"Invalid MAC address.\n"

	.no_dead_strip	_ql_get_8000_flash_params
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ql_get_8000_flash_params
_ql_get_8000_flash_params:              ; @ql_get_8000_flash_params
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	w20, [x0, #32]
Lloh3:
	adrp	x8, _FUNC0_FLASH_OFFSET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FUNC0_FLASH_OFFSET@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
Lloh6:
	adrp	x8, _FUNC1_FLASH_OFFSET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FUNC1_FLASH_OFFSET@GOTPAGEOFF]
Lloh8:
	ldr	w23, [x8]
Lloh9:
	adrp	x21, _SEM_FLASH_MASK@GOTPAGE
Lloh10:
	ldr	x21, [x21, _SEM_FLASH_MASK@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_ql_sem_spinlock
	cbz	x0, LBB0_2
; %bb.1:
Lloh11:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_2:
	add	x2, x19, #8
	cmp	w20, #0
	csel	w8, w22, w23, eq
	asr	w1, w8, #2
	mov	x0, x19
	bl	_ql_read_flash_word
	cbz	w0, LBB0_4
; %bb.3:
	mov	x20, x0
Lloh14:
	adrp	x8, _ifup@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ifup@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	ldr	x2, [x19]
Lloh17:
	adrp	x3, l_.str@PAGE
Lloh18:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netif_err
	b	LBB0_9
LBB0_4:
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w1, #1
	bl	_ql_validate_flash
	cbz	w0, LBB0_7
; %bb.5:
Lloh21:
	adrp	x8, _ifup@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ifup@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	ldr	x2, [x19]
Lloh24:
	adrp	x3, l_.str.2@PAGE
Lloh25:
	add	x3, x3, l_.str.2@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_netif_err
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_9
LBB0_7:
	ldr	w8, [x19, #8]
	cmp	w8, #2
	mov	w8, #16
	mov	w9, #24
	csel	x8, x9, x8, eq
	ldr	x1, [x19, x8]
	ldr	x8, [x19]
	ldr	w2, [x8]
	mov	x0, sp
	bl	_memcpy
	mov	x0, sp
	bl	_is_valid_ether_addr
	cbz	w0, LBB0_12
; %bb.8:
	ldr	x8, [x19]
	ldr	x0, [x8, #8]
	ldr	w2, [x8]
	mov	x1, sp
	bl	_memcpy
	mov	w20, #0
LBB0_9:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_ql_sem_unlock
LBB0_10:
	ldr	x8, [sp, #24]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.11:
	mov	x0, x20
	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
	add	sp, sp, #96
	ret
LBB0_12:
Lloh32:
	adrp	x8, _ifup@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ifup@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	ldr	x2, [x19]
Lloh35:
	adrp	x3, l_.str.3@PAGE
Lloh36:
	add	x3, x3, l_.str.3@PAGEOFF
	b	LBB0_6
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_FUNC0_FLASH_OFFSET,4,2         ; @FUNC0_FLASH_OFFSET
	.comm	_FUNC1_FLASH_OFFSET,4,2         ; @FUNC1_FLASH_OFFSET
	.comm	_SEM_FLASH_MASK,4,2             ; @SEM_FLASH_MASK
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_ifup,4,2                       ; @ifup
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading flash.\n"

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

l_.str.2:                               ; @.str.2
	.asciz	"Invalid flash.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"Invalid MAC address.\n"

	.no_dead_strip	_ql_get_8000_flash_params
.subsections_via_symbols
