	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath9k_htc_add_interface
_ath9k_htc_add_interface:               ## @ath9k_htc_add_interface
	.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	%rsi, %r15
	movq	(%rdi), %r13
	movq	8(%rsi), %r14
	movq	8(%r13), %rdi
	callq	_ath9k_hw_common
	movq	%rax, %r12
	leaq	4(%r13), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	%r13, %rdi
	callq	_ath9k_htc_ps_wakeup
	leaq	-64(%rbp), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	leaq	-52(%rbp), %rdi
	movl	4(%r15), %esi
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	movl	(%r15), %edx
	leal	-128(%rdx), %eax
	cmpl	$4, %eax
	jae	LBB0_1
## %bb.2:
	cltq
	leaq	l_switch.table.ath9k_htc_add_interface(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movl	(%r13), %edi
	callq	_ffz
	movl	%eax, -64(%rbp)
	movl	%eax, (%r14)
	movl	$2304, %edi                     ## imm = 0x900
	callq	_cpu_to_be16
	movl	%eax, -60(%rbp)
	movq	_WMI_VAP_CREATE_CMDID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-64(%rbp), %rsi
	callq	_WMI_CMD_BUF
	movq	%r13, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_ath9k_htc_add_station
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	movq	_WMI_VAP_REMOVE_CMDID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-64(%rbp), %rsi
	callq	_WMI_CMD_BUF
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_ath_err
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_10
LBB0_4:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_ath9k_htc_set_mac_bssid_mask
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movb	(%r14), %cl
	movl	$1, %eax
	shll	%cl, %eax
	orl	%eax, (%r13)
	incl	16(%r13)
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_INC_VIF
	movl	$-129, %eax
	addl	(%r15), %eax
	cmpl	$2, %eax
	ja	LBB0_6
## %bb.5:
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_ath9k_htc_assign_bslot
LBB0_6:
	movq	%r13, %rdi
	callq	_ath9k_htc_set_opmode
	movq	8(%r13), %rax
	cmpl	$130, (%rax)
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_9
## %bb.7:
	movq	_ATH_OP_ANI_RUN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_test_bit
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movq	8(%r13), %rdi
	movl	$1, %esi
	callq	_ath9k_hw_set_tsfadjust
	movq	%r13, %rdi
	callq	_ath9k_htc_start_ani
LBB0_9:
	movq	_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %ecx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r8d
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	callq	_ath_dbg
	xorl	%ebx, %ebx
LBB0_10:
	movq	%r13, %rdi
	callq	_ath9k_htc_ps_restore
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.comm	_HTC_M_STA,4,2                  ## @HTC_M_STA
	.comm	_HTC_M_IBSS,4,2                 ## @HTC_M_IBSS
	.comm	_HTC_M_HOSTAP,4,2               ## @HTC_M_HOSTAP
	.comm	_HTC_M_WDS,4,2                  ## @HTC_M_WDS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Interface type %d not yet supported\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_WMI_VAP_CREATE_CMDID,4,2       ## @WMI_VAP_CREATE_CMDID
	.comm	_WMI_VAP_REMOVE_CMDID,4,2       ## @WMI_VAP_REMOVE_CMDID
	.comm	_ATH_OP_ANI_RUN,4,2             ## @ATH_OP_ANI_RUN
	.comm	_CONFIG,4,2                     ## @CONFIG
L_.str.1:                               ## @.str.1
	.asciz	"Attach a VIF of type: %d at idx: %d\n"

	.no_dead_strip	_ath9k_htc_add_interface
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.ath9k_htc_add_interface
l_switch.table.ath9k_htc_add_interface:
	.quad	_HTC_M_STA
	.quad	_HTC_M_WDS
	.quad	_HTC_M_HOSTAP
	.quad	_HTC_M_IBSS

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath9k_htc_add_interface
_ath9k_htc_add_interface:               ; @ath9k_htc_add_interface
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x1
	ldr	x19, [x0]
	ldr	x24, [x1, #8]
	ldr	x0, [x19, #8]
	bl	_ath9k_hw_common
	mov	x22, x0
	add	x20, x19, #4
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x19
	bl	_ath9k_htc_ps_wakeup
	mov	x23, sp
	mov	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	add	x0, x23, #12
	ldr	w1, [x21, #4]
Lloh0:
	adrp	x8, _ETH_ALEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ETH_ALEN@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	bl	_memcpy
	ldr	w2, [x21]
	sub	w8, w2, #128
	cmp	w8, #4
	b.hs	LBB0_3
; %bb.1:
Lloh3:
	adrp	x9, l_switch.table.ath9k_htc_add_interface@PAGE
Lloh4:
	add	x9, x9, l_switch.table.ath9k_htc_add_interface@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w8, [x8]
	str	w8, [sp, #8]
	ldr	w0, [x19]
	bl	_ffz
	str	w0, [sp]
	str	w0, [x24]
	mov	w0, #2304
	bl	_cpu_to_be16
	str	w0, [sp, #4]
Lloh5:
	adrp	x8, _WMI_VAP_CREATE_CMDID@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WMI_VAP_CREATE_CMDID@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, sp
	bl	_WMI_CMD_BUF
	mov	x0, x19
	mov	x1, x21
	mov	x2, #0
	bl	_ath9k_htc_add_station
	cbz	w0, LBB0_4
; %bb.2:
	mov	x23, x0
Lloh8:
	adrp	x8, _WMI_VAP_REMOVE_CMDID@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WMI_VAP_REMOVE_CMDID@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, sp
	bl	_WMI_CMD_BUF
	b	LBB0_10
LBB0_3:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_ath_err
Lloh13:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_10
LBB0_4:
	mov	x0, x19
	mov	x1, x21
	bl	_ath9k_htc_set_mac_bssid_mask
	ldr	w8, [x24]
	mov	w9, #1
	lsl	w8, w9, w8
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	ldr	w8, [x19, #16]
	add	w8, w8, #1
	str	w8, [x19, #16]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_INC_VIF
	ldr	w8, [x21]
	sub	w8, w8, #129
	cmp	w8, #2
	b.hi	LBB0_6
; %bb.5:
	mov	x0, x19
	mov	x1, x21
	bl	_ath9k_htc_assign_bslot
LBB0_6:
	mov	x0, x19
	bl	_ath9k_htc_set_opmode
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	cmp	w8, #130
	b.ne	LBB0_9
; %bb.7:
Lloh16:
	adrp	x8, _ATH_OP_ANI_RUN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ATH_OP_ANI_RUN@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_test_bit
	cbnz	w0, LBB0_9
; %bb.8:
	ldr	x0, [x19, #8]
	mov	w1, #1
	bl	_ath9k_hw_set_tsfadjust
	mov	x0, x19
	bl	_ath9k_htc_start_ani
LBB0_9:
Lloh19:
	adrp	x8, _CONFIG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CONFIG@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	ldr	w3, [x21]
	ldr	w4, [x24]
Lloh22:
	adrp	x2, l_.str.1@PAGE
Lloh23:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_ath_dbg
	mov	w23, #0
LBB0_10:
	mov	x0, x19
	bl	_ath9k_htc_ps_restore
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.comm	_HTC_M_STA,4,2                  ; @HTC_M_STA
	.comm	_HTC_M_IBSS,4,2                 ; @HTC_M_IBSS
	.comm	_HTC_M_HOSTAP,4,2               ; @HTC_M_HOSTAP
	.comm	_HTC_M_WDS,4,2                  ; @HTC_M_WDS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Interface type %d not yet supported\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_WMI_VAP_CREATE_CMDID,4,2       ; @WMI_VAP_CREATE_CMDID
	.comm	_WMI_VAP_REMOVE_CMDID,4,2       ; @WMI_VAP_REMOVE_CMDID
	.comm	_ATH_OP_ANI_RUN,4,2             ; @ATH_OP_ANI_RUN
	.comm	_CONFIG,4,2                     ; @CONFIG
l_.str.1:                               ; @.str.1
	.asciz	"Attach a VIF of type: %d at idx: %d\n"

	.no_dead_strip	_ath9k_htc_add_interface
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.ath9k_htc_add_interface
l_switch.table.ath9k_htc_add_interface:
	.quad	_HTC_M_STA
	.quad	_HTC_M_WDS
	.quad	_HTC_M_HOSTAP
	.quad	_HTC_M_IBSS

.subsections_via_symbols
