	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function htc_setup_tx_complete
_htc_setup_tx_complete:                 ## @htc_setup_tx_complete
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	$1, %esi
	callq	_htc_get_control_buf
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	(%r14), %rax
	movq	_HTC_VERSION_2P1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_3
## %bb.6:
	movq	8(%r12), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	_HTC_MSG_SETUP_COMPLETE_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, 8(%rbx)
	movq	_ENDPOINT_0@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_HTC_SERVICE_TX_PACKET_TAG@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r12, %rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	jmp	LBB0_7
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_3:
	movl	$0, -36(%rbp)
	movq	8(%r12), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	_HTC_MSG_SETUP_COMPLETE_EX_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, 8(%r15)
	movq	8(%r14), %rax
	testq	%rax, %rax
	jle	LBB0_5
## %bb.4:
	movq	_HTC_SETUP_COMP_FLG_RX_BNDL_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -36(%rbp)
	movq	%rax, (%r15)
LBB0_5:
	leaq	16(%r15), %rdi
	leaq	-36(%rbp), %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	_ENDPOINT_0@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_HTC_SERVICE_TX_PACKET_TAG@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r12, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
LBB0_7:
	movl	$24, %ecx
	callq	_set_htc_pkt_info
	movq	$0, (%r12)
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ath6kl_htc_tx_prep_pkt
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_ath6kl_htc_tx_issue
	movl	%eax, %ebx
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_htc_reclaim_txctrl_buf
LBB0_8:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_HTC_VERSION_2P1,8,3            ## @HTC_VERSION_2P1
	.comm	_HTC_MSG_SETUP_COMPLETE_EX_ID,4,2 ## @HTC_MSG_SETUP_COMPLETE_EX_ID
	.comm	_HTC_SETUP_COMP_FLG_RX_BNDL_EN,4,2 ## @HTC_SETUP_COMP_FLG_RX_BNDL_EN
	.comm	_ENDPOINT_0,4,2                 ## @ENDPOINT_0
	.comm	_HTC_SERVICE_TX_PACKET_TAG,4,2  ## @HTC_SERVICE_TX_PACKET_TAG
	.comm	_HTC_MSG_SETUP_COMPLETE_ID,4,2  ## @HTC_MSG_SETUP_COMPLETE_ID
	.no_dead_strip	_htc_setup_tx_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function htc_setup_tx_complete
_htc_setup_tx_complete:                 ; @htc_setup_tx_complete
	.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
	mov	w1, #1
	bl	_htc_get_control_buf
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _HTC_VERSION_2P1@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HTC_VERSION_2P1@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_4
; %bb.2:
	ldr	x21, [x20, #8]
	mov	x0, x21
	mov	w1, #0
	mov	w2, #24
	bl	_memset
Lloh3:
	adrp	x8, _HTC_MSG_SETUP_COMPLETE_ID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HTC_MSG_SETUP_COMPLETE_ID@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_cpu_to_le16
	str	x0, [x21, #8]
	b	LBB0_7
LBB0_3:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_4:
	str	wzr, [sp, #12]
	ldr	x21, [x20, #8]
	mov	x0, x21
	mov	w1, #0
	mov	w2, #24
	bl	_memset
Lloh9:
	adrp	x8, _HTC_MSG_SETUP_COMPLETE_EX_ID@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HTC_MSG_SETUP_COMPLETE_EX_ID@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_cpu_to_le16
	str	x0, [x21, #8]
	ldr	x8, [x19, #8]
	cmp	x8, #1
	b.lt	LBB0_6
; %bb.5:
Lloh12:
	adrp	x9, _HTC_SETUP_COMP_FLG_RX_BNDL_EN@GOTPAGE
Lloh13:
	ldr	x9, [x9, _HTC_SETUP_COMP_FLG_RX_BNDL_EN@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	str	w9, [sp, #12]
	str	x8, [x21]
LBB0_6:
	add	x0, x21, #16
	add	x1, sp, #12
	mov	w2, #4
	bl	_memcpy
LBB0_7:
Lloh15:
	adrp	x8, _ENDPOINT_0@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENDPOINT_0@GOTPAGEOFF]
Lloh17:
	ldr	w4, [x8]
Lloh18:
	adrp	x8, _HTC_SERVICE_TX_PACKET_TAG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HTC_SERVICE_TX_PACKET_TAG@GOTPAGEOFF]
Lloh20:
	ldr	w5, [x8]
	mov	x0, x20
	mov	x1, #0
	mov	x2, x21
	mov	w3, #24
	bl	_set_htc_pkt_info
	str	xzr, [x20]
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	bl	_ath6kl_htc_tx_prep_pkt
	mov	x0, x19
	mov	x1, x20
	bl	_ath6kl_htc_tx_issue
	mov	x21, x0
	mov	x0, x19
	mov	x1, x20
	bl	_htc_reclaim_txctrl_buf
LBB0_8:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_HTC_VERSION_2P1,8,3            ; @HTC_VERSION_2P1
	.comm	_HTC_MSG_SETUP_COMPLETE_EX_ID,4,2 ; @HTC_MSG_SETUP_COMPLETE_EX_ID
	.comm	_HTC_SETUP_COMP_FLG_RX_BNDL_EN,4,2 ; @HTC_SETUP_COMP_FLG_RX_BNDL_EN
	.comm	_ENDPOINT_0,4,2                 ; @ENDPOINT_0
	.comm	_HTC_SERVICE_TX_PACKET_TAG,4,2  ; @HTC_SERVICE_TX_PACKET_TAG
	.comm	_HTC_MSG_SETUP_COMPLETE_ID,4,2  ; @HTC_MSG_SETUP_COMPLETE_ID
	.no_dead_strip	_htc_setup_tx_complete
.subsections_via_symbols
