	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath9k_htc_add_monitor_interface
_ath9k_htc_add_monitor_interface:       ## @ath9k_htc_add_monitor_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	32(%rdi), %rdi
	callq	_ath9k_hw_common
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	_ATH9K_HTC_MAX_VIF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_7
## %bb.1:
	movl	8(%rbx), %eax
	movq	_ATH9K_HTC_MAX_STA@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	jge	LBB0_7
## %bb.2:
	movl	12(%rbx), %edi
	callq	_ffz
	movq	%rax, %r12
	testl	%r12d, %r12d
	js	LBB0_7
## %bb.3:
	cmpl	%r12d, (%r15)
	jl	LBB0_7
## %bb.4:
	leaq	-104(%rbp), %r13
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	leaq	-76(%rbp), %rdi
	movl	(%r14), %esi
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	movq	_HTC_M_MONITOR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	movl	16(%rbx), %edi
	callq	_ffz
	movl	%eax, -104(%rbp)
	movq	_WMI_VAP_CREATE_CMDID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	callq	_WMI_CMD_BUF
	movl	-104(%rbp), %ecx
	movl	$1, %eax
	shll	%cl, %eax
	movl	%ecx, 20(%rbx)
	orl	%eax, 16(%rbx)
	movl	$1, %r13d
	movq	(%rbx), %rax
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movq	_NL80211_IFTYPE_MONITOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	32(%rbx), %rdx
	movl	%ecx, 4(%rdx)
LBB0_6:
	incq	%rax
	movq	%rax, (%rbx)
	leaq	-72(%rbp), %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	leaq	-52(%rbp), %rdi
	movl	(%r14), %esi
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	movl	$1, -68(%rbp)
	movl	%r12d, -64(%rbp)
	movl	-104(%rbp), %eax
	movl	%eax, -60(%rbp)
	movl	$65535, %edi                    ## imm = 0xFFFF
	callq	_cpu_to_be16
	movl	%eax, -56(%rbp)
	movq	_WMI_NODE_CREATE_CMDID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-72(%rbp), %rsi
	callq	_WMI_CMD_BUF
	movl	%r12d, %ecx
	shll	%cl, %r13d
	orl	%r13d, 12(%rbx)
	incl	8(%rbx)
	movq	24(%rbx), %rax
	movslq	20(%rbx), %rcx
	movl	%r12d, (%rax,%rcx,4)
	movq	32(%rbx), %rax
	movl	$1, (%rax)
	movq	_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	20(%rbx), %ecx
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	movl	%r12d, %r8d
	xorl	%eax, %eax
	callq	_ath_dbg
	jmp	LBB0_8
LBB0_7:
	movq	_ENOBUFS@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movq	_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ath_dbg
LBB0_8:
	movl	%r15d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH9K_HTC_MAX_VIF,8,3          ## @ATH9K_HTC_MAX_VIF
	.comm	_ATH9K_HTC_MAX_STA,4,2          ## @ATH9K_HTC_MAX_STA
	.comm	_ENOBUFS,4,2                    ## @ENOBUFS
	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.comm	_HTC_M_MONITOR,4,2              ## @HTC_M_MONITOR
	.comm	_WMI_VAP_CREATE_CMDID,4,2       ## @WMI_VAP_CREATE_CMDID
	.comm	_NL80211_IFTYPE_MONITOR,4,2     ## @NL80211_IFTYPE_MONITOR
	.comm	_WMI_NODE_CREATE_CMDID,4,2      ## @WMI_NODE_CREATE_CMDID
	.comm	_CONFIG,4,2                     ## @CONFIG
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"Attached a monitor interface at idx: %d, sta idx: %d\n"

	.comm	_FATAL,4,2                      ## @FATAL
L_.str.2:                               ## @.str.2
	.asciz	"Unable to attach a monitor interface\n"

	.no_dead_strip	_ath9k_htc_add_monitor_interface
.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_monitor_interface
_ath9k_htc_add_monitor_interface:       ; @ath9k_htc_add_monitor_interface
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x20, x0
	ldr	x0, [x0, #32]
	bl	_ath9k_hw_common
	mov	x19, x0
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _ATH9K_HTC_MAX_VIF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATH9K_HTC_MAX_VIF@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_7
; %bb.1:
	ldr	w8, [x20, #8]
Lloh3:
	adrp	x22, _ATH9K_HTC_MAX_STA@GOTPAGE
Lloh4:
	ldr	x22, [x22, _ATH9K_HTC_MAX_STA@GOTPAGEOFF]
	ldr	w9, [x22]
	cmp	w8, w9
	b.ge	LBB0_7
; %bb.2:
	ldr	w0, [x20, #12]
	bl	_ffz
	mov	x21, x0
	tbnz	w21, #31, LBB0_7
; %bb.3:
	ldr	w8, [x22]
	cmp	w8, w21
	b.lt	LBB0_7
; %bb.4:
	add	x22, sp, #48
	add	x0, sp, #48
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	add	x0, x22, #28
	ldr	w1, [x19]
Lloh5:
	adrp	x23, _ETH_ALEN@GOTPAGE
Lloh6:
	ldr	x23, [x23, _ETH_ALEN@GOTPAGEOFF]
	ldr	w2, [x23]
	bl	_memcpy
Lloh7:
	adrp	x8, _HTC_M_MONITOR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _HTC_M_MONITOR@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [sp, #72]
	ldr	w0, [x20, #16]
	bl	_ffz
	str	w0, [sp, #48]
Lloh10:
	adrp	x8, _WMI_VAP_CREATE_CMDID@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WMI_VAP_CREATE_CMDID@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	add	x1, sp, #48
	bl	_WMI_CMD_BUF
	ldr	w8, [sp, #48]
	mov	w22, #1
	lsl	w9, w22, w8
	ldr	w10, [x20, #16]
	orr	w9, w10, w9
	stp	w9, w8, [x20, #16]
	ldr	x8, [x20]
	cbnz	x8, LBB0_6
; %bb.5:
Lloh13:
	adrp	x9, _NL80211_IFTYPE_MONITOR@GOTPAGE
Lloh14:
	ldr	x9, [x9, _NL80211_IFTYPE_MONITOR@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	ldr	x10, [x20, #32]
	str	w9, [x10, #4]
LBB0_6:
	add	x8, x8, #1
	str	x8, [x20]
	add	x24, sp, #16
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	add	x0, x24, #20
	ldr	w1, [x19]
	ldr	w2, [x23]
	bl	_memcpy
	stp	w22, w21, [sp, #20]
	ldr	w8, [sp, #48]
	str	w8, [sp, #28]
	mov	w0, #65535
	bl	_cpu_to_be16
	str	w0, [sp, #32]
Lloh16:
	adrp	x8, _WMI_NODE_CREATE_CMDID@GOTPAGE
Lloh17:
	ldr	x8, [x8, _WMI_NODE_CREATE_CMDID@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	add	x1, sp, #16
	bl	_WMI_CMD_BUF
	lsl	w8, w22, w21
	ldp	w10, w9, [x20, #8]
	orr	w8, w9, w8
	add	w9, w10, #1
	stp	w9, w8, [x20, #8]
	ldr	x8, [x20, #24]
	ldrsw	x9, [x20, #20]
	str	w21, [x8, x9, lsl #2]
	ldr	x8, [x20, #32]
	str	w22, [x8]
Lloh19:
	adrp	x8, _CONFIG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CONFIG@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	ldr	w8, [x20, #20]
	stp	x8, x21, [sp]
Lloh22:
	adrp	x2, l_.str.1@PAGE
Lloh23:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ath_dbg
	mov	w20, #0
	b	LBB0_8
LBB0_7:
Lloh24:
	adrp	x8, _ENOBUFS@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENOBUFS@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w20, w8
Lloh27:
	adrp	x8, _FATAL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _FATAL@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x2, l_.str.2@PAGE
Lloh31:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_ath_dbg
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH9K_HTC_MAX_VIF,8,3          ; @ATH9K_HTC_MAX_VIF
	.comm	_ATH9K_HTC_MAX_STA,4,2          ; @ATH9K_HTC_MAX_STA
	.comm	_ENOBUFS,4,2                    ; @ENOBUFS
	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.comm	_HTC_M_MONITOR,4,2              ; @HTC_M_MONITOR
	.comm	_WMI_VAP_CREATE_CMDID,4,2       ; @WMI_VAP_CREATE_CMDID
	.comm	_NL80211_IFTYPE_MONITOR,4,2     ; @NL80211_IFTYPE_MONITOR
	.comm	_WMI_NODE_CREATE_CMDID,4,2      ; @WMI_NODE_CREATE_CMDID
	.comm	_CONFIG,4,2                     ; @CONFIG
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"Attached a monitor interface at idx: %d, sta idx: %d\n"

	.comm	_FATAL,4,2                      ; @FATAL
l_.str.2:                               ; @.str.2
	.asciz	"Unable to attach a monitor interface\n"

	.no_dead_strip	_ath9k_htc_add_monitor_interface
.subsections_via_symbols
