	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pciefd_alloc_tx_msg
_pciefd_alloc_tx_msg:                   ## @pciefd_alloc_tx_msg
	.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
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	16(%rdi), %r14
	movslq	(%rdi), %rax
	leaq	(%rax,%rax,2), %rbx
	addq	$8, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	movslq	(%r14,%rbx,8), %r13
	leal	(%r12,%r13), %eax
	cmpl	4(%r14,%rbx,8), %eax
	jle	LBB0_1
## %bb.2:
	movl	4(%r15), %eax
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	decl	%eax
	movl	%eax, 4(%r15)
	movq	16(%r14,%rbx,8), %rbx
	movl	(%r15), %eax
	incl	%eax
	movq	_PCIEFD_TX_PAGE_COUNT@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%edx, (%r15)
	movq	16(%r15), %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movslq	%edx, %rax
	leaq	(%rax,%rax,2), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	(%rcx,%rax,8), %r14
	movl	$32, %edi
	callq	_cpu_to_le16
	shlq	$5, %r13
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, 24(%rbx,%r13)
	movq	_CANFD_MSG_LNK_TX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, 16(%rbx,%r13)
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax,%rbx,8), %edi
	callq	_cpu_to_le32
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 8(%rcx,%r13)
	movq	$0, (%rcx,%r13)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax,%rbx,8)
	jmp	LBB0_5
LBB0_1:
	leaq	(%r14,%rbx,8), %r14
LBB0_5:
	movl	4(%r14), %eax
	imull	4(%r15), %eax
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, (%rbx)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	movslq	(%r14), %rax
	addl	%eax, %r12d
	shlq	$5, %rax
	addq	16(%r14), %rax
	movl	4(%r14), %ecx
	subl	%r12d, %ecx
	addl	%ecx, (%rbx)
	jmp	LBB0_6
LBB0_3:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
LBB0_6:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCIEFD_TX_PAGE_COUNT,4,2       ## @PCIEFD_TX_PAGE_COUNT
	.comm	_CANFD_MSG_LNK_TX,4,2           ## @CANFD_MSG_LNK_TX
	.no_dead_strip	_pciefd_alloc_tx_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pciefd_alloc_tx_msg
_pciefd_alloc_tx_msg:                   ; @pciefd_alloc_tx_msg
	.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, x2
	mov	x20, x1
	mov	x22, x0
	ldr	x25, [x0, #16]
	ldrsw	x26, [x0]
	mov	w8, #24
	madd	x23, x26, x8, x25
	add	x21, x0, #8
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldp	w24, w8, [x23]
                                        ; kill: def $w24 killed $w24 def $x24
	sxtw	x24, w24
	add	w9, w24, w20
	cmp	w9, w8
	b.le	LBB0_3
; %bb.1:
	ldr	w8, [x22, #4]
	cbz	w8, LBB0_4
; %bb.2:
	sub	w8, w8, #1
	mov	w9, #24
	madd	x10, x26, x9, x25
	ldr	x25, [x10, #16]
	ldr	w10, [x22]
	add	w10, w10, #1
Lloh0:
	adrp	x11, _PCIEFD_TX_PAGE_COUNT@GOTPAGE
Lloh1:
	ldr	x11, [x11, _PCIEFD_TX_PAGE_COUNT@GOTPAGEOFF]
Lloh2:
	ldr	w11, [x11]
	sdiv	w12, w10, w11
	msub	w10, w12, w11, w10
	stp	w10, w8, [x22]
	ldr	x8, [x22, #16]
	smaddl	x23, w10, w9, x8
	mov	w0, #32
	bl	_cpu_to_le16
	add	x24, x25, x24, lsl #5
	str	x0, [x24, #24]
Lloh3:
	adrp	x8, _CANFD_MSG_LNK_TX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CANFD_MSG_LNK_TX@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_cpu_to_le16
	str	x0, [x24, #16]
	ldr	w0, [x23, #8]
	bl	_cpu_to_le32
	stp	xzr, x0, [x24]
	str	wzr, [x23]
LBB0_3:
	ldr	w8, [x22, #4]
	ldr	w9, [x23, #4]
	mul	w8, w9, w8
	str	w8, [x19]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	ldr	x8, [x23, #16]
	ldp	w9, w10, [x23]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	add	x0, x8, x9, lsl #5
	add	w8, w9, w20
	sub	w8, w10, w8
	ldr	w9, [x19]
	add	w8, w8, w9
	str	w8, [x19]
	b	LBB0_5
LBB0_4:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	x0, #0
LBB0_5:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PCIEFD_TX_PAGE_COUNT,4,2       ; @PCIEFD_TX_PAGE_COUNT
	.comm	_CANFD_MSG_LNK_TX,4,2           ; @CANFD_MSG_LNK_TX
	.no_dead_strip	_pciefd_alloc_tx_msg
.subsections_via_symbols
