	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function htc_setup_msg_bndl
_htc_setup_msg_bndl:                    ## @htc_setup_msg_bndl
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_HTC_HOST_MAX_MSG_PER_BUNDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	40(%rbx), %rsi
	callq	_min
	movq	%rax, 40(%rbx)
	movq	56(%rbx), %rax
	movl	(%rax), %edi
	callq	_ath6kl_hif_enable_scatter
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	$0, 40(%rbx)
	jmp	LBB0_8
LBB0_2:
	movl	48(%rbx), %edi
	movq	40(%rbx), %rsi
	callq	_min
	movq	%rax, 40(%rbx)
	movq	_ATH6KL_DBG_BOOT@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_ath6kl_dbg
	movq	32(%rbx), %rsi
	movq	%rsi, 16(%rbx)
	movq	_HIF_MBOX0_EXT_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_min
	movq	%rax, 24(%rbx)
	movl	(%r14), %edi
	movq	16(%rbx), %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_ath6kl_dbg
	cmpq	$0, 24(%rbx)
	je	LBB0_4
## %bb.3:
	movq	_WMM_NUM_AC@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$-1, %eax
	shll	%cl, %eax
	notl	%eax
	movl	%eax, (%rbx)
LBB0_4:
	cmpq	$0, 16(%rbx)
	je	LBB0_6
## %bb.5:
	movl	$1, 4(%rbx)
LBB0_6:
	movl	8(%rbx), %esi
	movl	%esi, %eax
	cltd
	idivl	12(%rbx)
	testl	%edx, %edx
	je	LBB0_8
## %bb.7:
	leaq	L_.str.2(%rip), %rdi
	callq	_ath6kl_warn
	movl	$0, (%rbx)
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HTC_HOST_MAX_MSG_PER_BUNDLE,4,2 ## @HTC_HOST_MAX_MSG_PER_BUNDLE
	.comm	_ATH6KL_DBG_BOOT,4,2            ## @ATH6KL_DBG_BOOT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"htc bundling allowed msg_per_bndl_max %d\n"

	.comm	_HIF_MBOX0_EXT_WIDTH,4,2        ## @HIF_MBOX0_EXT_WIDTH
L_.str.1:                               ## @.str.1
	.asciz	"htc max_rx_bndl_sz %d max_tx_bndl_sz %d\n"

	.comm	_WMM_NUM_AC,4,2                 ## @WMM_NUM_AC
L_.str.2:                               ## @.str.2
	.asciz	"credit size: %d is not block aligned! Disabling send bundling\n"

	.no_dead_strip	_htc_setup_msg_bndl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function htc_setup_msg_bndl
_htc_setup_msg_bndl:                    ; @htc_setup_msg_bndl
	.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
Lloh0:
	adrp	x8, _HTC_HOST_MAX_MSG_PER_BUNDLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HTC_HOST_MAX_MSG_PER_BUNDLE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	x1, [x19, #40]
	bl	_min
	str	x0, [x19, #40]
	ldr	x8, [x19, #56]
	ldr	w0, [x8]
	bl	_ath6kl_hif_enable_scatter
	cbz	x0, LBB0_2
; %bb.1:
	str	xzr, [x19, #40]
	b	LBB0_8
LBB0_2:
	ldr	w0, [x19, #48]
	ldr	x1, [x19, #40]
	bl	_min
	mov	x2, x0
	str	x0, [x19, #40]
Lloh3:
	adrp	x20, _ATH6KL_DBG_BOOT@GOTPAGE
Lloh4:
	ldr	x20, [x20, _ATH6KL_DBG_BOOT@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ath6kl_dbg
	ldr	x1, [x19, #32]
	str	x1, [x19, #16]
Lloh7:
	adrp	x8, _HIF_MBOX0_EXT_WIDTH@GOTPAGE
Lloh8:
	ldr	x8, [x8, _HIF_MBOX0_EXT_WIDTH@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_min
	str	x0, [x19, #24]
	ldr	w8, [x20]
	ldr	x2, [x19, #16]
	str	x0, [sp]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x8
	bl	_ath6kl_dbg
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_4
; %bb.3:
Lloh12:
	adrp	x8, _WMM_NUM_AC@GOTPAGE
Lloh13:
	ldr	x8, [x8, _WMM_NUM_AC@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	mov	w9, #-1
	lsl	w8, w9, w8
	mvn	w8, w8
	str	w8, [x19]
LBB0_4:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_6
; %bb.5:
	mov	w8, #1
	str	w8, [x19, #4]
LBB0_6:
	ldp	w1, w8, [x19, #8]
	sdiv	w9, w1, w8
	msub	w8, w9, w8, w1
	cbz	w8, LBB0_8
; %bb.7:
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_ath6kl_warn
	str	wzr, [x19]
LBB0_8:
	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 AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_HTC_HOST_MAX_MSG_PER_BUNDLE,4,2 ; @HTC_HOST_MAX_MSG_PER_BUNDLE
	.comm	_ATH6KL_DBG_BOOT,4,2            ; @ATH6KL_DBG_BOOT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"htc bundling allowed msg_per_bndl_max %d\n"

	.comm	_HIF_MBOX0_EXT_WIDTH,4,2        ; @HIF_MBOX0_EXT_WIDTH
l_.str.1:                               ; @.str.1
	.asciz	"htc max_rx_bndl_sz %d max_tx_bndl_sz %d\n"

	.comm	_WMM_NUM_AC,4,2                 ; @WMM_NUM_AC
l_.str.2:                               ; @.str.2
	.asciz	"credit size: %d is not block aligned! Disabling send bundling\n"

	.no_dead_strip	_htc_setup_msg_bndl
.subsections_via_symbols
