	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qtnf_core_attach               ## -- Begin function qtnf_core_attach
	.p2align	4, 0x90
_qtnf_core_attach:                      ## @qtnf_core_attach
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_qtnf_trans_init
	movq	%r14, %rdi
	callq	_qtnf_bus_data_rx_start
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_alloc_ordered_workqueue
	movl	%eax, 20(%r14)
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	_WQ_HIGHPRI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_alloc_workqueue
	movl	%eax, 16(%r14)
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	leaq	12(%r14), %rdi
	movq	_qtnf_event_work_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_WORK
	movq	%r14, %rdi
	callq	_qtnf_cmd_send_init_fw
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.3(%rip), %rdi
LBB0_2:
	xorl	%eax, %eax
	callq	_pr_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_20:
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_8:
	movq	_QTNF_FW_STATE_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	%r14, %rdi
	callq	_qtnf_cmd_get_hw_info
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str.5(%rip), %rdi
LBB0_7:
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_pr_err
LBB0_21:
	movq	%r14, %rdi
	callq	_qtnf_core_detach
LBB0_22:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	4(%r14), %edx
	movq	_QLINK_PROTO_VER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	%esi, %edx
	jne	LBB0_11
## %bb.12:
	movl	8(%r14), %esi
	movq	_QTNF_MAX_MAC@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jbe	LBB0_13
## %bb.19:
	leaq	L_.str.7(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_err
	movq	_ERANGE@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_11:
	leaq	L_.str.6(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_err
	movq	_EPROTONOSUPPORT@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_13:
	testl	%esi, %esi
	je	LBB0_18
## %bb.14:
	xorl	%r15d, %r15d
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_qtnf_core_mac_attach
	testl	%eax, %eax
	jne	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=1
	incl	%r15d
	cmpl	8(%r14), %r15d
	jb	LBB0_15
LBB0_18:
	movq	_QTNF_FW_STATE_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_22
LBB0_16:
	movl	%eax, %ebx
	leaq	L_.str.8(%rip), %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"QTNF_BUS"

L_.str.1:                               ## @.str.1
	.asciz	"failed to alloc main workqueue\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"QTNF_HPRI"

	.comm	_WQ_HIGHPRI,4,2                 ## @WQ_HIGHPRI
L_.str.3:                               ## @.str.3
	.asciz	"failed to alloc high prio workqueue\n"

	.comm	_qtnf_event_work_handler,4,2    ## @qtnf_event_work_handler
L_.str.4:                               ## @.str.4
	.asciz	"failed to init FW: %d\n"

	.comm	_QTNF_FW_STATE_ACTIVE,4,2       ## @QTNF_FW_STATE_ACTIVE
L_.str.5:                               ## @.str.5
	.asciz	"failed to get HW info: %d\n"

	.comm	_QLINK_PROTO_VER,4,2            ## @QLINK_PROTO_VER
L_.str.6:                               ## @.str.6
	.asciz	"qlink version mismatch %u != %u\n"

	.comm	_EPROTONOSUPPORT,4,2            ## @EPROTONOSUPPORT
	.comm	_QTNF_MAX_MAC,4,2               ## @QTNF_MAX_MAC
L_.str.7:                               ## @.str.7
	.asciz	"no support for number of MACs=%u\n"

	.comm	_ERANGE,4,2                     ## @ERANGE
L_.str.8:                               ## @.str.8
	.asciz	"MAC%u: attach failed: %d\n"

	.comm	_QTNF_FW_STATE_RUNNING,4,2      ## @QTNF_FW_STATE_RUNNING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qtnf_core_attach               ; -- Begin function qtnf_core_attach
	.p2align	2
_qtnf_core_attach:                      ; @qtnf_core_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	bl	_qtnf_trans_init
	mov	x0, x19
	bl	_qtnf_bus_data_rx_start
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #0
	bl	_alloc_ordered_workqueue
	str	w0, [x19, #20]
	cbz	w0, LBB0_4
; %bb.1:
Lloh2:
	adrp	x8, _WQ_HIGHPRI@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WQ_HIGHPRI@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	w2, #0
	bl	_alloc_workqueue
	str	w0, [x19, #16]
	cbz	w0, LBB0_5
; %bb.2:
	add	x0, x19, #12
Lloh7:
	adrp	x8, _qtnf_event_work_handler@GOTPAGE
Lloh8:
	ldr	x8, [x8, _qtnf_event_work_handler@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_INIT_WORK
	mov	x0, x19
	bl	_qtnf_cmd_send_init_fw
	cbz	w0, LBB0_10
; %bb.3:
	mov	x20, x0
	str	x20, [sp]
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_err
	b	LBB0_8
LBB0_4:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_6:
	bl	_pr_err
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_8:
	mov	x0, x19
	bl	_qtnf_core_detach
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_10:
Lloh18:
	adrp	x8, _QTNF_FW_STATE_ACTIVE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _QTNF_FW_STATE_ACTIVE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x19]
	mov	x0, x19
	bl	_qtnf_cmd_get_hw_info
	cbz	w0, LBB0_12
; %bb.11:
	mov	x20, x0
	str	x20, [sp]
Lloh21:
	adrp	x0, l_.str.5@PAGE
Lloh22:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pr_err
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	b	LBB0_8
LBB0_12:
	ldr	w8, [x19, #4]
Lloh23:
	adrp	x9, _QLINK_PROTO_VER@GOTPAGE
Lloh24:
	ldr	x9, [x9, _QLINK_PROTO_VER@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_15
; %bb.13:
	ldr	w8, [x19, #8]
Lloh26:
	adrp	x9, _QTNF_MAX_MAC@GOTPAGE
Lloh27:
	ldr	x9, [x9, _QTNF_MAX_MAC@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ls	LBB0_16
; %bb.14:
	str	x8, [sp]
Lloh29:
	adrp	x0, l_.str.7@PAGE
Lloh30:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_pr_err
Lloh31:
	adrp	x8, _ERANGE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
	b	LBB0_7
LBB0_15:
	stp	x9, x8, [sp]
Lloh33:
	adrp	x0, l_.str.6@PAGE
Lloh34:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_pr_err
Lloh35:
	adrp	x8, _EPROTONOSUPPORT@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EPROTONOSUPPORT@GOTPAGEOFF]
	b	LBB0_7
LBB0_16:
	cbz	w8, LBB0_20
; %bb.17:
	mov	w20, #0
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_qtnf_core_mac_attach
	cbnz	w0, LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	add	w20, w20, #1
	ldr	w8, [x19, #8]
	cmp	w20, w8
	b.lo	LBB0_18
LBB0_20:
	mov	w20, #0
Lloh37:
	adrp	x8, _QTNF_FW_STATE_RUNNING@GOTPAGE
Lloh38:
	ldr	x8, [x8, _QTNF_FW_STATE_RUNNING@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_9
LBB0_21:
	mov	x21, x0
	stp	x20, x21, [sp]
Lloh40:
	adrp	x0, l_.str.8@PAGE
Lloh41:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_pr_err
	mov	x20, x21
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"QTNF_BUS"

l_.str.1:                               ; @.str.1
	.asciz	"failed to alloc main workqueue\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"QTNF_HPRI"

	.comm	_WQ_HIGHPRI,4,2                 ; @WQ_HIGHPRI
l_.str.3:                               ; @.str.3
	.asciz	"failed to alloc high prio workqueue\n"

	.comm	_qtnf_event_work_handler,4,2    ; @qtnf_event_work_handler
l_.str.4:                               ; @.str.4
	.asciz	"failed to init FW: %d\n"

	.comm	_QTNF_FW_STATE_ACTIVE,4,2       ; @QTNF_FW_STATE_ACTIVE
l_.str.5:                               ; @.str.5
	.asciz	"failed to get HW info: %d\n"

	.comm	_QLINK_PROTO_VER,4,2            ; @QLINK_PROTO_VER
l_.str.6:                               ; @.str.6
	.asciz	"qlink version mismatch %u != %u\n"

	.comm	_EPROTONOSUPPORT,4,2            ; @EPROTONOSUPPORT
	.comm	_QTNF_MAX_MAC,4,2               ; @QTNF_MAX_MAC
l_.str.7:                               ; @.str.7
	.asciz	"no support for number of MACs=%u\n"

	.comm	_ERANGE,4,2                     ; @ERANGE
l_.str.8:                               ; @.str.8
	.asciz	"MAC%u: attach failed: %d\n"

	.comm	_QTNF_FW_STATE_RUNNING,4,2      ; @QTNF_FW_STATE_RUNNING
.subsections_via_symbols
