	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iwl_pcie_tx_init               ## -- Begin function iwl_pcie_tx_init
	.p2align	4, 0x90
_iwl_pcie_tx_init:                      ## @iwl_pcie_tx_init
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_IWL_TRANS_GET_PCIE_TRANS
	movq	%rax, %r14
	movl	24(%rax), %ebx
	testl	%ebx, %ebx
	je	LBB0_1
LBB0_2:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, %rbx
	addq	$16, %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	movq	%r15, %rdi
	callq	_iwl_scd_deactivate_fifos
	movq	_FH_KW_MEM_ADDR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	20(%r14), %edx
	sarl	$4, %edx
	movq	%r15, %rdi
	callq	_iwl_write_direct32
	movq	%rbx, %rdi
	callq	_spin_unlock
	movq	(%r15), %rax
	movq	(%rax), %rax
	cmpl	$0, (%rax)
	jle	LBB0_8
## %bb.3:
	xorl	%ebx, %ebx
	movq	_IWL_DEFAULT_QUEUE_SIZE@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %ecx
	xorl	%r12d, %r12d
	movq	%r13, %rax
	cmpq	%rcx, %rbx
	sete	%cl
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_IWL_CMD_QUEUE_SIZE@GOTPCREL(%rip), %rax
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movb	%cl, %r12b
	movq	_u32@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	8(%r15), %rcx
	movl	(%rax), %esi
	movl	(%rcx,%r12,4), %edx
	callq	_max_t
	movq	8(%r14), %rcx
	movq	(%rcx,%rbx,8), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	movl	%r12d, %ecx
	callq	_iwl_pcie_txq_init
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_FH_MEM_CBBC_QUEUE
	movq	8(%r14), %rcx
	movq	(%rcx,%rbx,8), %rcx
	movl	(%rcx), %edx
	sarl	$8, %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_iwl_write_direct32
	incq	%rbx
	movq	(%r15), %rax
	movq	(%rax), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jl	LBB0_4
LBB0_8:
	movq	_SCD_GP_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_SCD_GP_CTRL_AUTO_ACTIVE_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_iwl_set_bits_prph
	movq	(%r15), %rax
	movq	(%rax), %rax
	xorl	%r12d, %r12d
	cmpl	$21, (%rax)
	jl	LBB0_12
## %bb.9:
	movl	(%rbx), %esi
	movq	_SCD_GP_CTRL_ENABLE_31_QUEUES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_iwl_set_bits_prph
	jmp	LBB0_12
LBB0_1:
	movq	%r15, %rdi
	callq	_iwl_pcie_tx_alloc
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_12
	jmp	LBB0_2
LBB0_10:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_IWL_ERR
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_12
## %bb.11:
	movq	%r15, %rdi
	callq	_iwl_pcie_tx_free
LBB0_12:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FH_KW_MEM_ADDR_REG,4,2         ## @FH_KW_MEM_ADDR_REG
	.comm	_u32,4,2                        ## @u32
	.comm	_IWL_CMD_QUEUE_SIZE,4,2         ## @IWL_CMD_QUEUE_SIZE
	.comm	_IWL_DEFAULT_QUEUE_SIZE,4,2     ## @IWL_DEFAULT_QUEUE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Tx %d queue init failed\n"

	.comm	_SCD_GP_CTRL,4,2                ## @SCD_GP_CTRL
	.comm	_SCD_GP_CTRL_AUTO_ACTIVE_MODE,4,2 ## @SCD_GP_CTRL_AUTO_ACTIVE_MODE
	.comm	_SCD_GP_CTRL_ENABLE_31_QUEUES,4,2 ## @SCD_GP_CTRL_ENABLE_31_QUEUES
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iwl_pcie_tx_init               ; -- Begin function iwl_pcie_tx_init
	.p2align	2
_iwl_pcie_tx_init:                      ; @iwl_pcie_tx_init
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	bl	_IWL_TRANS_GET_PCIE_TRANS
	mov	x20, x0
	ldr	w23, [x0, #24]
	cbz	w23, LBB0_7
LBB0_1:
	add	x21, x20, #16
	mov	x0, x21
	bl	_spin_lock
	mov	x0, x19
	bl	_iwl_scd_deactivate_fifos
Lloh0:
	adrp	x8, _FH_KW_MEM_ADDR_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FH_KW_MEM_ADDR_REG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w8, [x20, #20]
	asr	w2, w8, #4
	mov	x0, x19
	bl	_iwl_write_direct32
	mov	x0, x21
	bl	_spin_unlock
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.2:
	mov	x21, #0
Lloh3:
	adrp	x24, _u32@GOTPAGE
Lloh4:
	ldr	x24, [x24, _u32@GOTPAGEOFF]
Lloh5:
	adrp	x25, _IWL_CMD_QUEUE_SIZE@GOTPAGE
Lloh6:
	ldr	x25, [x25, _IWL_CMD_QUEUE_SIZE@GOTPAGEOFF]
Lloh7:
	adrp	x26, _IWL_DEFAULT_QUEUE_SIZE@GOTPAGE
Lloh8:
	ldr	x26, [x26, _IWL_DEFAULT_QUEUE_SIZE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	cmp	x21, x8
	csel	x8, x25, x26, eq
	cset	w22, eq
	ldr	w0, [x24]
	ldr	x9, [x19, #8]
	ldr	w1, [x8]
	ldr	w2, [x9, w22, uxtw #2]
	bl	_max_t
	mov	x2, x0
	ldr	x8, [x20, #8]
	ldr	x1, [x8, x21, lsl #3]
	mov	x0, x19
	mov	x3, x22
	bl	_iwl_pcie_txq_init
	cbnz	w0, LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_FH_MEM_CBBC_QUEUE
	mov	x1, x0
	ldr	x8, [x20, #8]
	ldr	x8, [x8, x21, lsl #3]
	ldr	w8, [x8]
	asr	w2, w8, #8
	mov	x0, x19
	bl	_iwl_write_direct32
	add	x21, x21, #1
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldrsw	x8, [x8]
	cmp	x21, x8
	b.lt	LBB0_3
LBB0_5:
Lloh9:
	adrp	x20, _SCD_GP_CTRL@GOTPAGE
Lloh10:
	ldr	x20, [x20, _SCD_GP_CTRL@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh11:
	adrp	x8, _SCD_GP_CTRL_AUTO_ACTIVE_MODE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SCD_GP_CTRL_AUTO_ACTIVE_MODE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_iwl_set_bits_prph
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	w8, [x8]
	cmp	w8, #21
	b.lt	LBB0_8
; %bb.6:
	ldr	w1, [x20]
Lloh14:
	adrp	x8, _SCD_GP_CTRL_ENABLE_31_QUEUES@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SCD_GP_CTRL_ENABLE_31_QUEUES@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_iwl_set_bits_prph
	mov	w22, #0
	b	LBB0_11
LBB0_7:
	mov	x0, x19
	bl	_iwl_pcie_tx_alloc
	mov	x22, x0
	cbnz	w0, LBB0_11
	b	LBB0_1
LBB0_8:
	mov	w22, #0
	b	LBB0_11
LBB0_9:
	mov	x22, x0
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_IWL_ERR
	cbnz	w23, LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_iwl_pcie_tx_free
LBB0_11:
	mov	x0, x22
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_FH_KW_MEM_ADDR_REG,4,2         ; @FH_KW_MEM_ADDR_REG
	.comm	_u32,4,2                        ; @u32
	.comm	_IWL_CMD_QUEUE_SIZE,4,2         ; @IWL_CMD_QUEUE_SIZE
	.comm	_IWL_DEFAULT_QUEUE_SIZE,4,2     ; @IWL_DEFAULT_QUEUE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Tx %d queue init failed\n"

	.comm	_SCD_GP_CTRL,4,2                ; @SCD_GP_CTRL
	.comm	_SCD_GP_CTRL_AUTO_ACTIVE_MODE,4,2 ; @SCD_GP_CTRL_AUTO_ACTIVE_MODE
	.comm	_SCD_GP_CTRL_ENABLE_31_QUEUES,4,2 ; @SCD_GP_CTRL_ENABLE_31_QUEUES
.subsections_via_symbols
