	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cw1200_bh_tx_helper
_cw1200_bh_tx_helper:                   ## @cw1200_bh_tx_helper
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rdi, %r15
	cmpl	$0, (%rdi)
	je	LBB0_5
## %bb.1:
	movq	%rsi, %r12
	movq	%r15, %rdi
	callq	_cw1200_device_wakeup
	movl	%eax, %ebx
	movl	%eax, %edi
	shrl	$31, %edi
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_3
LBB0_2:
	movl	$1, (%r12)
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_3:
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.4:
	movl	$0, (%r15)
LBB0_5:
	movq	%r15, %rdi
	callq	_wsm_alloc_tx_buffer
	leaq	-56(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r14, %rcx
	callq	_wsm_get_tx
	testl	%eax, %eax
	jle	LBB0_6
## %bb.7:
	movq	-56(%rbp), %r12
	xorl	%edi, %edi
	cmpq	$8, -48(%rbp)
	setb	%dil
	callq	_BUG_ON
	movl	(%r12), %edi
	callq	___le16_to_cpu
	xorl	%edi, %edi
	cmpq	-48(%rbp), %rax
	setne	%dil
	callq	_BUG_ON
	leaq	32(%r15), %rsi
	movl	$1, %edi
	callq	_atomic_add
	movq	24(%r15), %rax
	movl	16(%r15), %edi
	movq	-48(%rbp), %rsi
	callq	*(%rax)
	movq	%rax, -48(%rbp)
	movq	_EFFECTIVE_BUF_SIZE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	seta	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	-48(%rbp), %rsi
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
LBB0_9:
	movq	_WSM_TX_SEQ_MAX@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_WSM_TX_SEQ
	xorl	$65535, %eax                    ## imm = 0xFFFF
	movl	%eax, %edi
	callq	___cpu_to_le16
	andl	%eax, 4(%r12)
	movl	4(%r15), %edi
	callq	_WSM_TX_SEQ
	movl	%eax, %edi
	callq	___cpu_to_le16
	orl	%eax, 4(%r12)
	movq	-56(%rbp), %rsi
	movq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_cw1200_data_write
	movl	%eax, %edi
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	-48(%rbp), %rsi
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_wsm_release_tx_buffer
	movl	$-1, %eax
	jmp	LBB0_15
LBB0_6:
	movl	%eax, %ebx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_wsm_release_tx_buffer
	xorl	%edi, %edi
	testl	%ebx, %ebx
	setne	%dil
	callq	_WARN_ON
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	cmovnel	%ebx, %eax
	jmp	LBB0_15
LBB0_11:
	cmpq	$0, 8(%r15)
	je	LBB0_13
## %bb.12:
	movq	_DUMP_PREFIX_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	-56(%rbp), %rbx
	movl	(%r12), %edi
	callq	___le16_to_cpu
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %esi
	movq	%rbx, %rdx
	movq	_WSM_TX_SEQ_MAX@GOTPCREL(%rip), %rbx
	movq	%rax, %rcx
	callq	_print_hex_dump_bytes
LBB0_13:
	movq	-56(%rbp), %rsi
	movq	%r15, %rdi
	callq	_wsm_txed
	movl	4(%r15), %eax
	incl	%eax
	andl	(%rbx), %eax
	movl	%eax, 4(%r15)
	xorl	%eax, %eax
	cmpl	$2, (%r14)
	jl	LBB0_15
## %bb.14:
	movq	%r15, %rdi
	callq	_cw1200_debug_tx_burst
	movl	$1, %eax
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EFFECTIVE_BUF_SIZE,8,3         ## @EFFECTIVE_BUF_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Write aligned len: %zu\n"

	.comm	_WSM_TX_SEQ_MAX,4,2             ## @WSM_TX_SEQ_MAX
L_.str.1:                               ## @.str.1
	.asciz	"tx blew up, len %zu\n"

L_.str.2:                               ## @.str.2
	.asciz	"--> "

	.comm	_DUMP_PREFIX_NONE,4,2           ## @DUMP_PREFIX_NONE
	.no_dead_strip	_cw1200_bh_tx_helper
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cw1200_bh_tx_helper
_cw1200_bh_tx_helper:                   ; @cw1200_bh_tx_helper
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x2
	mov	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x21, x1
	mov	x0, x19
	bl	_cw1200_device_wakeup
	mov	x22, x0
	lsr	w0, w0, #31
	bl	_WARN_ON
	cbz	x0, LBB0_3
LBB0_2:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x21]
	b	LBB0_16
LBB0_3:
	cbz	w22, LBB0_2
; %bb.4:
	str	wzr, [x19]
LBB0_5:
	mov	x0, x19
	bl	_wsm_alloc_tx_buffer
	mov	x1, sp
	add	x2, sp, #8
	mov	x0, x19
	mov	x3, x20
	bl	_wsm_get_tx
	cmp	w0, #0
	b.le	LBB0_10
; %bb.6:
	ldp	x23, x8, [sp]
	cmp	x8, #8
	cset	w0, lo
	bl	_BUG_ON
	ldr	w0, [x23]
	bl	___le16_to_cpu
	ldr	x8, [sp, #8]
	cmp	x0, x8
	cset	w0, ne
	bl	_BUG_ON
	add	x1, x19, #32
	mov	w0, #1
	bl	_atomic_add
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	ldr	w0, [x19, #16]
	ldr	x1, [sp, #8]
	blr	x8
	str	x0, [sp, #8]
Lloh0:
	adrp	x8, _EFFECTIVE_BUF_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EFFECTIVE_BUF_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w0, hi
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_8
; %bb.7:
	ldr	x1, [sp, #8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
LBB0_8:
Lloh5:
	adrp	x24, _WSM_TX_SEQ_MAX@GOTPAGE
Lloh6:
	ldr	x24, [x24, _WSM_TX_SEQ_MAX@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_WSM_TX_SEQ
	eor	w0, w0, #0xffff
	bl	___cpu_to_le16
	ldr	w8, [x23, #4]
	and	w8, w8, w0
	str	w8, [x23, #4]
	ldr	w0, [x19, #4]
	bl	_WSM_TX_SEQ
	bl	___cpu_to_le16
	ldr	w8, [x23, #4]
	orr	w8, w8, w0
	str	w8, [x23, #4]
	ldp	x1, x2, [sp]
	mov	x0, x19
	bl	_cw1200_data_write
	bl	_WARN_ON
	cbz	x0, LBB0_11
; %bb.9:
	ldr	x1, [sp, #8]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	mov	x0, x19
	mov	w1, #1
	bl	_wsm_release_tx_buffer
	mov	w0, #-1
	b	LBB0_16
LBB0_10:
	mov	x21, x0
	mov	x0, x19
	mov	w1, #1
	bl	_wsm_release_tx_buffer
	cmp	w21, #0
	cset	w0, ne
	bl	_WARN_ON
	cmp	x0, #0
	csel	w0, wzr, w21, eq
	b	LBB0_16
LBB0_11:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_13
; %bb.12:
Lloh9:
	adrp	x8, _DUMP_PREFIX_NONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DUMP_PREFIX_NONE@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
	ldr	x22, [sp]
	ldr	w0, [x23]
	bl	___le16_to_cpu
	mov	x3, x0
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	mov	x2, x22
	bl	_print_hex_dump_bytes
LBB0_13:
	ldr	x1, [sp]
	mov	x0, x19
	bl	_wsm_txed
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	ldr	w9, [x24]
	and	w8, w8, w9
	str	w8, [x19, #4]
	ldr	w8, [x20]
	cmp	w8, #2
	b.lt	LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_cw1200_debug_tx_burst
	mov	w0, #1
	b	LBB0_16
LBB0_15:
	mov	w0, #0
LBB0_16:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EFFECTIVE_BUF_SIZE,8,3         ; @EFFECTIVE_BUF_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Write aligned len: %zu\n"

	.comm	_WSM_TX_SEQ_MAX,4,2             ; @WSM_TX_SEQ_MAX
l_.str.1:                               ; @.str.1
	.asciz	"tx blew up, len %zu\n"

l_.str.2:                               ; @.str.2
	.asciz	"--> "

	.comm	_DUMP_PREFIX_NONE,4,2           ; @DUMP_PREFIX_NONE
	.no_dead_strip	_cw1200_bh_tx_helper
.subsections_via_symbols
