	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function htc_wait_for_ctrl_msg
_htc_wait_for_ctrl_msg:                 ## @htc_wait_for_ctrl_msg
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	(%rdi), %edi
	movq	_HTC_TARGET_RESPONSE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-24(%rbp), %rsi
	callq	_ath6kl_hif_poll_mboxmsg_rx
	testq	%rax, %rax
	jne	LBB0_8
## %bb.1:
	movq	_ATH6KL_DBG_HTC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-24(%rbp), %rdx
	leaq	L_.str(%rip), %rsi
	callq	_ath6kl_dbg
	movq	-24(%rbp), %rax
	movq	_ENDPOINT_0@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.2:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_htc_get_control_buf
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	%rax, %rbx
	movq	$0, 48(%rax)
	movq	-24(%rbp), %rax
	movq	%rax, 40(%rbx)
	movl	-16(%rbp), %edi
	callq	_le16_to_cpu
	movq	_HTC_HDR_LENGTH@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	%rax, (%rbx)
	cmpq	8(%rbx), %rax
	jg	LBB0_7
## %bb.4:
	movq	$0, 32(%rbx)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_ath6kl_htc_rx_packet
	testq	%rax, %rax
	jne	LBB0_7
## %bb.5:
	movq	(%rbx), %rcx
	movq	16(%rbx), %rdi
	movl	28(%rbx), %esi
	movl	24(%rbx), %edx
	callq	_trace_ath6kl_htc_rx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ath6kl_htc_rx_process_hdr
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rsi
	callq	_ath6kl_err
LBB0_7:
	movq	%rbx, %rdi
	callq	_htc_rxpkt_reset
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_reclaim_rx_ctrl_buf
LBB0_8:
	xorl	%ebx, %ebx
LBB0_9:
	movq	%rbx, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HTC_TARGET_RESPONSE_TIMEOUT,4,2 ## @HTC_TARGET_RESPONSE_TIMEOUT
	.comm	_ATH6KL_DBG_HTC,4,2             ## @ATH6KL_DBG_HTC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"htc rx wait ctrl look_ahead 0x%X\n"

	.comm	_ENDPOINT_0,8,3                 ## @ENDPOINT_0
	.comm	_HTC_HDR_LENGTH,8,3             ## @HTC_HDR_LENGTH
L_.str.1:                               ## @.str.1
	.asciz	"htc_wait_for_ctrl_msg, ath6kl_htc_rx_process_hdr failed (status = %d)\n"

	.no_dead_strip	_htc_wait_for_ctrl_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function htc_wait_for_ctrl_msg
_htc_wait_for_ctrl_msg:                 ; @htc_wait_for_ctrl_msg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _HTC_TARGET_RESPONSE_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HTC_TARGET_RESPONSE_TIMEOUT@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x1, sp, #8
	bl	_ath6kl_hif_poll_mboxmsg_rx
	cbnz	x0, LBB0_8
; %bb.1:
Lloh3:
	adrp	x8, _ATH6KL_DBG_HTC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATH6KL_DBG_HTC@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldr	x2, [sp, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ath6kl_dbg
	ldr	x8, [sp, #8]
Lloh8:
	adrp	x9, _ENDPOINT_0@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ENDPOINT_0@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.2:
	mov	x0, x19
	mov	w1, #0
	bl	_htc_get_control_buf
	mov	x20, x0
	cbz	x0, LBB0_9
; %bb.3:
	ldr	x8, [sp, #8]
	stp	x8, xzr, [x20, #40]
	ldr	w0, [sp, #16]
	bl	_le16_to_cpu
Lloh11:
	adrp	x8, _HTC_HDR_LENGTH@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HTC_HDR_LENGTH@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	ldr	x9, [x20, #8]
	add	x2, x8, x0
	cmp	x2, x9
	str	x2, [x20]
	b.gt	LBB0_7
; %bb.4:
	str	xzr, [x20, #32]
	mov	x0, x19
	mov	x1, x20
	bl	_ath6kl_htc_rx_packet
	cbnz	x0, LBB0_7
; %bb.5:
	ldr	x0, [x20, #16]
	ldp	w2, w1, [x20, #24]
	ldr	x3, [x20]
	bl	_trace_ath6kl_htc_rx
	mov	x0, x19
	mov	x1, x20
	mov	x2, #0
	mov	x3, #0
	bl	_ath6kl_htc_rx_process_hdr
	str	x0, [x20, #16]
	cbz	x0, LBB0_9
; %bb.6:
	mov	x1, x0
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ath6kl_err
LBB0_7:
	mov	x0, x20
	bl	_htc_rxpkt_reset
	mov	x0, x19
	mov	x1, x20
	bl	_reclaim_rx_ctrl_buf
LBB0_8:
	mov	x20, #0
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_HTC_TARGET_RESPONSE_TIMEOUT,4,2 ; @HTC_TARGET_RESPONSE_TIMEOUT
	.comm	_ATH6KL_DBG_HTC,4,2             ; @ATH6KL_DBG_HTC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"htc rx wait ctrl look_ahead 0x%X\n"

	.comm	_ENDPOINT_0,8,3                 ; @ENDPOINT_0
	.comm	_HTC_HDR_LENGTH,8,3             ; @HTC_HDR_LENGTH
l_.str.1:                               ; @.str.1
	.asciz	"htc_wait_for_ctrl_msg, ath6kl_htc_rx_process_hdr failed (status = %d)\n"

	.no_dead_strip	_htc_wait_for_ctrl_msg
.subsections_via_symbols
