	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath6kl_htc_tx_bundle
_ath6kl_htc_tx_bundle:                  ## @ath6kl_htc_tx_bundle
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	(%rdi), %rcx
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	16(%rdi), %r12
	movq	_HTC_CTRL_RSVD_SVC@GOTPCREL(%rip), %rdx
	movq	_WMM_NUM_AC@GOTPCREL(%rip), %rax
	cmpq	%rcx, (%rdx)
	je	LBB0_3
## %bb.1:
	movq	_WMI_CONTROL_SVC@GOTPCREL(%rip), %rdx
	movq	_WMM_NUM_AC@GOTPCREL(%rip), %rax
	cmpq	%rcx, (%rdx)
	je	LBB0_3
## %bb.2:
	movq	8(%r12), %rax
	movq	(%rax), %rcx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	shlq	$2, %rax
	addq	(%rcx), %rax
LBB0_3:
	movl	(%rax), %ecx
	movl	$-1, %eax
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	notl	%eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_ATH6KL_DBG_HTC@GOTPCREL(%rip), %r15
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	xorl	%r14d, %r14d
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	incl	-52(%rbp)                       ## 4-byte Folded Spill
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	addl	%ebx, %r14d
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r15), %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ath6kl_hif_submit_scat_req
	testl	%r13d, %r13d
	movq	%r15, %r12
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	_ATH6KL_DBG_HTC@GOTPCREL(%rip), %r15
	jne	LBB0_21
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_get_queue_depth
	movl	16(%r12), %esi
	movl	%eax, %edi
	callq	_min
	movl	%eax, %r13d
	movq	_HTC_MIN_HTC_MSGS_TO_BUNDLE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jl	LBB0_20
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %r14
	movq	%r12, %rbx
	movq	8(%r12), %rax
	movq	(%rax), %rdi
	callq	_hif_scatter_req_get
	testq	%rax, %rax
	je	LBB0_18
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rax, %r12
	movq	_WMM_NUM_AC@GOTPCREL(%rip), %rax
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpl	(%rax), %ecx
	jge	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_WMM_AC_BK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	%ecx, -48(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$1, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movq	_WMM_AC_BE@GOTPCREL(%rip), %rdx
	cmpl	%ecx, (%rdx)
	cmovnel	-56(%rbp), %eax                 ## 4-byte Folded Reload
	movq	(%r12), %rcx
	movq	_ATH6KL_SCATTER_REQS@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jge	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	notl	%eax
	andl	(%rbx), %eax
	jmp	LBB0_12
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	orl	(%rbx), %eax
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, (%rbx)
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_ath6kl_dbg
	movl	$0, 24(%r12)
	movl	$0, 8(%r12)
	movq	%rbx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	movl	%r13d, %ecx
	movq	%r14, %r8
	callq	_ath6kl_htc_tx_setup_scat_list
	movl	%eax, %r13d
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r13d, %eax
	je	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_htc_async_tx_scat_complete@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r12)
	movl	8(%r12), %ebx
	movl	24(%r12), %edx
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_ath6kl_dbg
	cmpl	$0, 8(%r12)
	jle	LBB0_4
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	16(%r12), %rax
	movq	(%rax,%r14,8), %rax
	movl	12(%rax), %edi
	movl	8(%rax), %esi
	movl	(%rax), %ecx
	movl	4(%rax), %edx
	callq	_trace_ath6kl_htc_tx
	incq	%r14
	movslq	8(%r12), %rax
	cmpq	%rax, %r14
	jl	LBB0_16
	jmp	LBB0_4
LBB0_18:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_ath6kl_dbg
	jmp	LBB0_20
LBB0_19:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	(%rax), %rdi
	movq	%r12, %rsi
	callq	_hif_scatter_req_add
LBB0_20:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_21:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, (%rax)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	%r14d, (%rax)
	movl	(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ath6kl_dbg                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_WMM_NUM_AC,4,2                 ## @WMM_NUM_AC
	.comm	_HTC_CTRL_RSVD_SVC,8,3          ## @HTC_CTRL_RSVD_SVC
	.comm	_WMI_CONTROL_SVC,8,3            ## @WMI_CONTROL_SVC
	.comm	_HTC_MIN_HTC_MSGS_TO_BUNDLE,4,2 ## @HTC_MIN_HTC_MSGS_TO_BUNDLE
	.comm	_ATH6KL_DBG_HTC,4,2             ## @ATH6KL_DBG_HTC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"htc tx no more scatter resources\n"

	.comm	_WMM_AC_BK,4,2                  ## @WMM_AC_BK
	.comm	_WMM_AC_BE,4,2                  ## @WMM_AC_BE
	.comm	_ATH6KL_SCATTER_REQS,8,3        ## @ATH6KL_SCATTER_REQS
L_.str.1:                               ## @.str.1
	.asciz	"htc tx pkts to scatter: %d\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_htc_async_tx_scat_complete,4,2 ## @htc_async_tx_scat_complete
L_.str.2:                               ## @.str.2
	.asciz	"htc tx scatter bytes %d entries %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"htc tx bundle sent %d pkts\n"

	.no_dead_strip	_ath6kl_htc_tx_bundle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath6kl_htc_tx_bundle
_ath6kl_htc_tx_bundle:                  ; @ath6kl_htc_tx_bundle
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	stp	x2, x3, [sp, #16]               ; 16-byte Folded Spill
	mov	x21, x1
	ldr	x22, [x0, #16]
Lloh0:
	adrp	x8, _HTC_CTRL_RSVD_SVC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HTC_CTRL_RSVD_SVC@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x0, [sp, #40]                   ; 8-byte Folded Spill
	ldr	x9, [x0]
Lloh3:
	adrp	x10, _WMI_CONTROL_SVC@GOTPAGE
Lloh4:
	ldr	x10, [x10, _WMI_CONTROL_SVC@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
Lloh6:
	adrp	x11, _WMM_NUM_AC@GOTPAGE
Lloh7:
	ldr	x11, [x11, _WMM_NUM_AC@GOTPAGEOFF]
	cmp	x8, x9
	ccmp	x10, x9, #4, ne
	mov	x8, x11
	b.eq	LBB0_2
; %bb.1:
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x9, [x9, #8]
	add	x8, x8, x9, lsl #2
LBB0_2:
	mov	w28, #0
	mov	w19, #0
	ldr	w25, [x8]
	mov	w8, #-1
	lsl	w8, w8, w25
	mvn	w8, w8
	str	w8, [sp, #36]                   ; 4-byte Folded Spill
Lloh8:
	adrp	x20, _ATH6KL_DBG_HTC@GOTPAGE
Lloh9:
	ldr	x20, [x20, _ATH6KL_DBG_HTC@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w28, w28, #1
	add	w19, w24, w19
	ldr	x0, [x22, #8]
	mov	x1, x26
	mov	w2, #0
	bl	_ath6kl_hif_submit_scat_req
	mov	x20, x23
	cbnz	w27, LBB0_18
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
	mov	x0, x21
	bl	_get_queue_depth
	ldr	w1, [x22, #16]
	bl	_min
Lloh10:
	adrp	x8, _HTC_MIN_HTC_MSGS_TO_BUNDLE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HTC_MIN_HTC_MSGS_TO_BUNDLE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w0, w8
	b.lt	LBB0_18
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x27, x0
	ldr	x8, [x22, #8]
	ldr	x0, [x8]
	bl	_hif_scatter_req_get
	cbz	x0, LBB0_16
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x26, x0
Lloh13:
	adrp	x8, _WMM_NUM_AC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _WMM_NUM_AC@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w25, w8
	b.ge	LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh16:
	adrp	x8, _WMM_AC_BK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _WMM_AC_BK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w25, w8
	b.eq	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh19:
	adrp	x9, _WMM_AC_BE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _WMM_AC_BE@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	mov	w10, #1
	lsl	w8, w10, w8
	cmp	w9, w25
	ldr	w9, [sp, #36]                   ; 4-byte Folded Reload
	csel	w8, w8, w9, eq
	ldr	x9, [x26]
Lloh22:
	adrp	x10, _ATH6KL_SCATTER_REQS@GOTPAGE
Lloh23:
	ldr	x10, [x10, _ATH6KL_SCATTER_REQS@GOTPAGEOFF]
Lloh24:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x22]
	bic	w8, w9, w8
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x22]
	orr	w8, w9, w8
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w8, [x22]
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x20]
	str	x27, [sp]
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_ath6kl_dbg
	str	wzr, [x26, #24]
	str	wzr, [x26, #8]
	mov	x0, x22
	ldr	x1, [sp, #40]                   ; 8-byte Folded Reload
	mov	x2, x26
	mov	x3, x27
	mov	x4, x21
	bl	_ath6kl_htc_tx_setup_scat_list
Lloh27:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_17
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x27, x0
Lloh30:
	adrp	x8, _htc_async_tx_scat_complete@GOTPAGE
Lloh31:
	ldr	x8, [x8, _htc_async_tx_scat_complete@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	str	w8, [x26, #28]
	ldr	w24, [x26, #8]
	mov	x23, x20
	ldr	w0, [x20]
	ldr	w8, [x26, #24]
	stp	x8, x24, [sp]
Lloh33:
	adrp	x1, l_.str.2@PAGE
Lloh34:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_ath6kl_dbg
	ldr	w8, [x26, #8]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x20, #0
LBB0_15:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x26, #16]
	ldr	x8, [x8, x20, lsl #3]
	ldp	w1, w0, [x8, #8]
	ldp	w3, w2, [x8]
	bl	_trace_ath6kl_htc_tx
	add	x20, x20, #1
	ldrsw	x8, [x26, #8]
	cmp	x20, x8
	b.lt	LBB0_15
	b	LBB0_3
LBB0_16:
	ldr	w0, [x20]
Lloh35:
	adrp	x1, l_.str@PAGE
Lloh36:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ath6kl_dbg
	b	LBB0_18
LBB0_17:
	ldr	x8, [x22, #8]
	ldr	x0, [x8]
	mov	x1, x26
	bl	_hif_scatter_req_add
LBB0_18:
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	str	w28, [x8]
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	str	w19, [x8]
	ldr	w0, [x20]
	str	x28, [sp]
Lloh37:
	adrp	x1, l_.str.3@PAGE
Lloh38:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_ath6kl_dbg
	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
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_WMM_NUM_AC,4,2                 ; @WMM_NUM_AC
	.comm	_HTC_CTRL_RSVD_SVC,8,3          ; @HTC_CTRL_RSVD_SVC
	.comm	_WMI_CONTROL_SVC,8,3            ; @WMI_CONTROL_SVC
	.comm	_HTC_MIN_HTC_MSGS_TO_BUNDLE,4,2 ; @HTC_MIN_HTC_MSGS_TO_BUNDLE
	.comm	_ATH6KL_DBG_HTC,4,2             ; @ATH6KL_DBG_HTC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"htc tx no more scatter resources\n"

	.comm	_WMM_AC_BK,4,2                  ; @WMM_AC_BK
	.comm	_WMM_AC_BE,4,2                  ; @WMM_AC_BE
	.comm	_ATH6KL_SCATTER_REQS,8,3        ; @ATH6KL_SCATTER_REQS
l_.str.1:                               ; @.str.1
	.asciz	"htc tx pkts to scatter: %d\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_htc_async_tx_scat_complete,4,2 ; @htc_async_tx_scat_complete
l_.str.2:                               ; @.str.2
	.asciz	"htc tx scatter bytes %d entries %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"htc tx bundle sent %d pkts\n"

	.no_dead_strip	_ath6kl_htc_tx_bundle
.subsections_via_symbols
