	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ql_get_8012_flash_params
_ql_get_8012_flash_params:              ## @ql_get_8012_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	16(%rdi), %rbx
	movq	_SEM_FLASH_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %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_10
LBB0_2:
	leaq	8(%r14), %r15
	xorl	%esi, %esi
	testq	%rbx, %rbx
	setne	%sil
	movq	%r14, %rdi
	movq	%r15, %rdx
	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_9
LBB0_4:
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_ql_validate_flash
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movq	_ifup@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r14), %rdx
	leaq	L_.str.2(%rip), %rcx
	movq	%r14, %rdi
	callq	_netif_err
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_6:
	movl	(%r15), %edi
	callq	_is_valid_ether_addr
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movq	(%r14), %rax
	movl	(%rax), %edx
	movl	4(%rax), %edi
	movl	8(%r14), %esi
	callq	_memcpy
	xorl	%ebx, %ebx
LBB0_9:
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_ql_sem_unlock
LBB0_10:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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	"8012"

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

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ql_get_8012_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_8012_flash_params
_ql_get_8012_flash_params:              ; @ql_get_8012_flash_params
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x20, [x0, #16]
Lloh0:
	adrp	x22, _SEM_FLASH_MASK@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SEM_FLASH_MASK@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_ql_sem_spinlock
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_2:
	add	x21, x19, #8
	cmp	x20, #0
	cset	w1, ne
	mov	x0, x19
	mov	x2, x21
	bl	_ql_read_flash_word
	cbz	w0, LBB0_4
; %bb.3:
	mov	x20, x0
Lloh5:
	adrp	x8, _ifup@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ifup@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ldr	x2, [x19]
Lloh8:
	adrp	x3, l_.str@PAGE
Lloh9:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	bl	_netif_err
	b	LBB0_9
LBB0_4:
Lloh10:
	adrp	x2, l_.str.1@PAGE
Lloh11:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w1, #1
	bl	_ql_validate_flash
	cbz	w0, LBB0_7
; %bb.5:
Lloh12:
	adrp	x8, _ifup@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ifup@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	x2, [x19]
Lloh15:
	adrp	x3, l_.str.2@PAGE
Lloh16:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_netif_err
LBB0_6:
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_9
LBB0_7:
	ldr	w0, [x21]
	bl	_is_valid_ether_addr
	cbz	w0, LBB0_6
; %bb.8:
	ldr	x8, [x19]
	ldr	w1, [x19, #8]
	ldp	w2, w0, [x8]
	bl	_memcpy
	mov	w20, #0
LBB0_9:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_ql_sem_unlock
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.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	"8012"

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

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ql_get_8012_flash_params
.subsections_via_symbols
