	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iwl_trans_pcie_txq_enable      ## -- Begin function iwl_trans_pcie_txq_enable
	.p2align	4, 0x90
_iwl_trans_pcie_txq_enable:             ## @iwl_trans_pcie_txq_enable
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r15d
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %r14
	callq	_IWL_TRANS_GET_PCIE_TRANS
	movq	%rax, %rbx
	movq	32(%rax), %rax
	movslq	%r12d, %rdi
	movq	(%rax,%rdi,8), %r13
	movl	24(%rbx), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_test_and_set_bit
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movl	%r12d, %edx
	callq	_WARN_ONCE
LBB0_2:
	movl	%r15d, %edi
	callq	_msecs_to_jiffies
	movl	%eax, 12(%r13)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_11
## %bb.3:
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	cmpl	%r12d, (%rbx)
	jne	LBB0_6
## %bb.4:
	cmpq	$0, 8(%rbx)
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_iwl_scd_enable_set_active
LBB0_6:
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_iwl_scd_txq_set_inactive
	cmpl	%r12d, (%rbx)
	je	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_iwl_scd_txq_set_chain
LBB0_8:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	cmpq	$0, 16(%r15)
	je	LBB0_10
## %bb.9:
	movl	8(%r15), %esi
	movl	12(%r15), %edi
	callq	_BUILD_RAxTID
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%r12d, %edx
	callq	_iwl_pcie_txq_set_ratid_map
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_iwl_scd_txq_enable_agg
	movl	$1, (%r13)
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_15
LBB0_11:
	movq	(%r14), %rax
	movl	$-1, -60(%rbp)                  ## 4-byte Folded Spill
	cmpl	$0, (%rax)
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_13
## %bb.12:
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_14
LBB0_10:
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_iwl_scd_txq_disable_agg
	movl	4(%r13), %ebx
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_15
LBB0_13:
	movl	%ebx, %eax
	subl	8(%r13), %eax
	setne	%cl
	testb	$63, %al
	sete	%al
	andb	%cl, %al
	movzbl	%al, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	addl	%eax, %ebx
LBB0_14:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
LBB0_15:
	movzbl	%bl, %eax
	movl	%eax, 4(%r13)
	movl	%eax, 8(%r13)
	movl	%eax, %r13d
	movq	_HBUS_TARG_WRPTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edx
	shll	$8, %edx
	orl	%r13d, %edx
	movq	%r14, %rdi
	callq	_iwl_write_direct32
	testq	%r15, %r15
	je	LBB0_20
## %bb.16:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	4(%r15), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	%r12d, %edi
	callq	_SCD_QUEUE_RDPTR
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_iwl_write_prph
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	16(%rbx), %r13
	movl	%r12d, %edi
	callq	_SCD_CONTEXT_QUEUE_OFFSET
	addq	%rax, %r13
	movq	%r14, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_iwl_trans_write_mem32
	movq	16(%rbx), %r15
	movl	%r12d, %edi
	callq	_SCD_CONTEXT_QUEUE_OFFSET
	addq	%r15, %rax
	addq	$4, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_WIN_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-64(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %esi
	callq	_SCD_QUEUE_CTX_REG2_VAL
	movl	%eax, %r15d
	movq	_FRAME_LIMIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %esi
	callq	_SCD_QUEUE_CTX_REG2_VAL
	orl	%eax, %r15d
	movq	%r14, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_iwl_trans_write_mem32
	movl	%r12d, %edi
	callq	_SCD_QUEUE_STATUS_BITS
	movq	_SCD_QUEUE_STTS_REG_POS_ACTIVE@GOTPCREL(%rip), %rsi
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %edx
	movq	_SCD_QUEUE_STTS_REG_POS_TXF@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	movb	(%rsi), %cl
	btsl	%ecx, %edx
	movq	_SCD_QUEUE_STTS_REG_POS_WSL@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	btsl	%ecx, %edx
	movq	_SCD_QUEUE_STTS_REG_MSK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_iwl_write_prph
	cmpl	%r12d, (%rbx)
	jne	LBB0_19
## %bb.17:
	cmpq	$0, 8(%rbx)
	je	LBB0_19
## %bb.18:
	movl	%r12d, %edi
	callq	_BIT
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_iwl_scd_enable_set_active
LBB0_19:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_IWL_DEBUG_TX_QUEUES
	jmp	LBB0_21
LBB0_20:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_IWL_DEBUG_TX_QUEUES
LBB0_21:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"queue %d already used - expect issues"

	.comm	_HBUS_TARG_WRPTR,4,2            ## @HBUS_TARG_WRPTR
	.comm	_WIN_SIZE,4,2                   ## @WIN_SIZE
	.comm	_FRAME_LIMIT,4,2                ## @FRAME_LIMIT
	.comm	_SCD_QUEUE_STTS_REG_POS_ACTIVE,4,2 ## @SCD_QUEUE_STTS_REG_POS_ACTIVE
	.comm	_SCD_QUEUE_STTS_REG_POS_TXF,4,2 ## @SCD_QUEUE_STTS_REG_POS_TXF
	.comm	_SCD_QUEUE_STTS_REG_POS_WSL,4,2 ## @SCD_QUEUE_STTS_REG_POS_WSL
	.comm	_SCD_QUEUE_STTS_REG_MSK,4,2     ## @SCD_QUEUE_STTS_REG_MSK
L_.str.1:                               ## @.str.1
	.asciz	"Activate queue %d on FIFO %d WrPtr: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Activate queue %d WrPtr: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iwl_trans_pcie_txq_enable      ; -- Begin function iwl_trans_pcie_txq_enable
	.p2align	2
_iwl_trans_pcie_txq_enable:             ; @iwl_trans_pcie_txq_enable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x23, x4
	mov	x22, x3
	mov	x25, x2
	mov	x19, x1
	mov	x20, x0
	bl	_IWL_TRANS_GET_PCIE_TRANS
	mov	x21, x0
	ldr	x8, [x0, #32]
	ldr	x27, [x8, w19, sxtw #3]
	ldr	w1, [x0, #24]
	mov	x0, x19
	bl	_test_and_set_bit
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_WARN_ONCE
LBB0_2:
	mov	x0, x23
	bl	_msecs_to_jiffies
	str	w0, [x27, #12]
	cbz	x22, LBB0_10
; %bb.3:
	ldr	w23, [x22]
	ldr	w8, [x21]
	cmp	w8, w19
	b.ne	LBB0_6
; %bb.4:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x20
	mov	w1, #0
	bl	_iwl_scd_enable_set_active
LBB0_6:
	mov	x0, x20
	mov	x1, x19
	bl	_iwl_scd_txq_set_inactive
	ldr	w8, [x21]
	cmp	w8, w19
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x20
	mov	x1, x19
	bl	_iwl_scd_txq_set_chain
LBB0_8:
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_12
; %bb.9:
	ldp	w1, w0, [x22, #8]
	bl	_BUILD_RAxTID
	mov	x1, x0
	mov	x0, x20
	mov	x2, x19
	bl	_iwl_pcie_txq_set_ratid_map
	mov	x0, x20
	mov	x1, x19
	bl	_iwl_scd_txq_enable_agg
	mov	w24, #0
	mov	w8, #1
	str	w8, [x27]
	b	LBB0_15
LBB0_10:
	ldr	x8, [x20]
	ldr	w8, [x8]
	cbz	w8, LBB0_13
; %bb.11:
	mov	w24, #0
	b	LBB0_14
LBB0_12:
	mov	x0, x20
	mov	x1, x19
	bl	_iwl_scd_txq_disable_agg
	mov	w24, #0
	ldr	w25, [x27, #4]
	b	LBB0_15
LBB0_13:
	ldr	w8, [x27, #8]
	sub	w9, w25, w8
	tst	w9, #0x3f
	ccmp	w25, w8, #4, eq
	cset	w24, ne
	cinc	w25, w25, ne
LBB0_14:
	mov	w23, #-1
LBB0_15:
	and	w26, w25, #0xff
	stp	w26, w26, [x27, #4]
Lloh2:
	adrp	x8, _HBUS_TARG_WRPTR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HBUS_TARG_WRPTR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x2, x25
	bfi	w2, w19, #8, #24
	mov	x0, x20
	bl	_iwl_write_direct32
	cbz	x22, LBB0_20
; %bb.16:
	ldr	w27, [x22, #4]
	mov	x0, x19
	bl	_SCD_QUEUE_RDPTR
	mov	x1, x0
	mov	x0, x20
	mov	x2, x25
	bl	_iwl_write_prph
	ldr	x25, [x21, #16]
	mov	x0, x19
	bl	_SCD_CONTEXT_QUEUE_OFFSET
	add	x1, x0, x25
	mov	x0, x20
	mov	w2, #0
	bl	_iwl_trans_write_mem32
	ldr	x25, [x21, #16]
	mov	x0, x19
	bl	_SCD_CONTEXT_QUEUE_OFFSET
	add	x8, x25, x0
	add	x25, x8, #4
Lloh5:
	adrp	x8, _WIN_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WIN_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x27
	bl	_SCD_QUEUE_CTX_REG2_VAL
	mov	x28, x0
Lloh8:
	adrp	x8, _FRAME_LIMIT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FRAME_LIMIT@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x27
	bl	_SCD_QUEUE_CTX_REG2_VAL
	orr	w2, w0, w28
	mov	x0, x20
	mov	x1, x25
	bl	_iwl_trans_write_mem32
	mov	x0, x19
	bl	_SCD_QUEUE_STATUS_BITS
	mov	x1, x0
Lloh11:
	adrp	x8, _SCD_QUEUE_STTS_REG_POS_ACTIVE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SCD_QUEUE_STTS_REG_POS_ACTIVE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	mov	w9, #1
	lsl	w8, w9, w8
	ldr	w10, [x22]
Lloh14:
	adrp	x11, _SCD_QUEUE_STTS_REG_POS_TXF@GOTPAGE
Lloh15:
	ldr	x11, [x11, _SCD_QUEUE_STTS_REG_POS_TXF@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	lsl	w10, w10, w11
	orr	w8, w10, w8
Lloh17:
	adrp	x10, _SCD_QUEUE_STTS_REG_POS_WSL@GOTPAGE
Lloh18:
	ldr	x10, [x10, _SCD_QUEUE_STTS_REG_POS_WSL@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w8, w9
Lloh20:
	adrp	x9, _SCD_QUEUE_STTS_REG_MSK@GOTPAGE
Lloh21:
	ldr	x9, [x9, _SCD_QUEUE_STTS_REG_MSK@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x20
	bl	_iwl_write_prph
	ldr	w8, [x21]
	cmp	w8, w19
	b.ne	LBB0_19
; %bb.17:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_19
; %bb.18:
	mov	x0, x19
	bl	_BIT
	mov	x1, x0
	mov	x0, x20
	bl	_iwl_scd_enable_set_active
LBB0_19:
	str	x26, [sp]
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	mov	x3, x23
	b	LBB0_21
LBB0_20:
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	mov	x3, x26
LBB0_21:
	bl	_IWL_DEBUG_TX_QUEUES
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"queue %d already used - expect issues"

	.comm	_HBUS_TARG_WRPTR,4,2            ; @HBUS_TARG_WRPTR
	.comm	_WIN_SIZE,4,2                   ; @WIN_SIZE
	.comm	_FRAME_LIMIT,4,2                ; @FRAME_LIMIT
	.comm	_SCD_QUEUE_STTS_REG_POS_ACTIVE,4,2 ; @SCD_QUEUE_STTS_REG_POS_ACTIVE
	.comm	_SCD_QUEUE_STTS_REG_POS_TXF,4,2 ; @SCD_QUEUE_STTS_REG_POS_TXF
	.comm	_SCD_QUEUE_STTS_REG_POS_WSL,4,2 ; @SCD_QUEUE_STTS_REG_POS_WSL
	.comm	_SCD_QUEUE_STTS_REG_MSK,4,2     ; @SCD_QUEUE_STTS_REG_MSK
l_.str.1:                               ; @.str.1
	.asciz	"Activate queue %d on FIFO %d WrPtr: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Activate queue %d WrPtr: %d\n"

.subsections_via_symbols
