	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iwl_pcie_tx_alloc
_iwl_pcie_tx_alloc:                     ## @iwl_pcie_tx_alloc
	.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, %r14
	callq	_IWL_TRANS_GET_PCIE_TRANS
	movq	%rax, %r15
	movq	8(%r14), %rax
	movq	8(%rax), %rax
	movl	(%rax), %ebx
	movq	16(%r15), %rdi
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_17:
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_2:
	shll	$2, %ebx
	leaq	28(%r15), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_iwl_pcie_alloc_dma_ptr
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_4
LBB0_5:
	leaq	24(%r15), %rsi
	movq	_IWL_KW_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_iwl_pcie_alloc_dma_ptr
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
LBB0_4:
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_IWL_ERR
LBB0_18:
	movq	%r14, %rdi
	callq	_iwl_pcie_tx_free
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	8(%r14), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_16
## %bb.8:
	movq	8(%r14), %rax
	movq	8(%rax), %rax
	cmpl	$0, (%rax)
	jle	LBB0_9
## %bb.10:
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %ecx
	xorl	%ebx, %ebx
	movq	_IWL_DEFAULT_QUEUE_SIZE@GOTPCREL(%rip), %rax
	cmpq	%rcx, %r12
	sete	%cl
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_IWL_CMD_QUEUE_SIZE@GOTPCREL(%rip), %rax
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	movb	%cl, %bl
	movq	_u32@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	(%r14), %rcx
	movl	(%rax), %esi
	movl	(%rcx,%rbx,4), %edx
	callq	_max_t
	movq	16(%r15), %rcx
	addq	%r13, %rcx
	movq	8(%r15), %rdx
	movq	%rcx, (%rdx,%r12,8)
	movq	8(%r15), %rcx
	movq	(%rcx,%r12,8), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	movl	%ebx, %ecx
	callq	_iwl_pcie_txq_alloc
	testl	%eax, %eax
	jne	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	8(%r15), %rax
	movq	(%rax,%r12,8), %rax
	movl	%r12d, (%rax)
	incq	%r12
	movq	8(%r14), %rax
	movq	8(%rax), %rax
	movslq	(%rax), %rax
	addq	$4, %r13
	xorl	%ebx, %ebx
	cmpq	%rax, %r12
	jl	LBB0_11
	jmp	LBB0_19
LBB0_16:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_IWL_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_9:
	xorl	%ebx, %ebx
	jmp	LBB0_19
LBB0_14:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_IWL_ERR
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_IWL_DEVICE_FAMILY_22560,8,3    ## @IWL_DEVICE_FAMILY_22560
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Scheduler BC Table allocation failed\n"

	.comm	_IWL_KW_SIZE,4,2                ## @IWL_KW_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Keep Warm allocation failed\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.2:                               ## @.str.2
	.asciz	"Not enough memory for txq\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.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
L_.str.3:                               ## @.str.3
	.asciz	"Tx %d queue alloc failed\n"

	.no_dead_strip	_iwl_pcie_tx_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iwl_pcie_tx_alloc
_iwl_pcie_tx_alloc:                     ; @iwl_pcie_tx_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x8, [x19, #8]
	ldr	x8, [x8, #8]
	ldr	w21, [x8]
	ldr	x0, [x0, #16]
	bl	_WARN_ON
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_3:
	lsl	w2, w21, #2
	add	x1, x20, #28
	mov	x0, x19
	bl	_iwl_pcie_alloc_dma_ptr
	cbz	w0, LBB0_5
; %bb.4:
	mov	x21, x0
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_5:
	add	x1, x20, #24
Lloh4:
	adrp	x8, _IWL_KW_SIZE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IWL_KW_SIZE@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_iwl_pcie_alloc_dma_ptr
	cbz	w0, LBB0_10
; %bb.6:
	mov	x21, x0
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	x0, x19
	bl	_IWL_ERR
LBB0_8:
	mov	x0, x19
	bl	_iwl_pcie_tx_free
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_10:
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	ldr	w0, [x8]
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x20, #16]
	cbz	x0, LBB0_15
; %bb.11:
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.12:
	mov	x23, #0
	mov	x22, #0
Lloh12:
	adrp	x24, _u32@GOTPAGE
Lloh13:
	ldr	x24, [x24, _u32@GOTPAGEOFF]
Lloh14:
	adrp	x25, _IWL_CMD_QUEUE_SIZE@GOTPAGE
Lloh15:
	ldr	x25, [x25, _IWL_CMD_QUEUE_SIZE@GOTPAGEOFF]
Lloh16:
	adrp	x26, _IWL_DEFAULT_QUEUE_SIZE@GOTPAGE
Lloh17:
	ldr	x26, [x26, _IWL_DEFAULT_QUEUE_SIZE@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	cmp	x22, x8
	csel	x8, x25, x26, eq
	cset	w21, eq
	ldr	w0, [x24]
	ldr	x9, [x19]
	ldr	w1, [x8]
	ldr	w2, [x9, w21, uxtw #2]
	bl	_max_t
	mov	x2, x0
	ldp	x9, x8, [x20, #8]
	add	x8, x8, x23
	lsl	x10, x22, #3
	str	x8, [x9, x10]
	ldr	x8, [x20, #8]
	ldr	x1, [x8, x10]
	mov	x0, x19
	mov	x3, x21
	bl	_iwl_pcie_txq_alloc
	mov	x21, x0
	cbnz	w0, LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x20, #8]
	ldr	x8, [x8, x22, lsl #3]
	str	w22, [x8]
	add	x22, x22, #1
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	ldrsw	x8, [x8]
	add	x23, x23, #4
	cmp	x22, x8
	b.lt	LBB0_13
	b	LBB0_9
LBB0_15:
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_IWL_ERR
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
LBB0_16:
	mov	w21, #0
	b	LBB0_9
LBB0_17:
	str	x22, [sp]
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_IWL_DEVICE_FAMILY_22560,8,3    ; @IWL_DEVICE_FAMILY_22560
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Scheduler BC Table allocation failed\n"

	.comm	_IWL_KW_SIZE,4,2                ; @IWL_KW_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Keep Warm allocation failed\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.2:                               ; @.str.2
	.asciz	"Not enough memory for txq\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.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
l_.str.3:                               ; @.str.3
	.asciz	"Tx %d queue alloc failed\n"

	.no_dead_strip	_iwl_pcie_tx_alloc
.subsections_via_symbols
