	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pasemi_mac_free_tx_resources
_pasemi_mac_free_tx_resources:          ## @pasemi_mac_free_tx_resources
	.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	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_tx_ring
	movq	%rax, %rbx
	movq	_MAX_SKB_FRAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	incl	%eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	(%rbx), %r12d
	movl	4(%rbx), %eax
	xorl	%ecx, %ecx
	cmpl	%eax, %r12d
	movq	_TX_RING_SIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r14d
	cmovgl	%r14d, %ecx
	addl	%eax, %ecx
	cmpl	%ecx, %r12d
	jae	LBB0_13
## %bb.1:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	16(%rbx), %r13
	leal	1(%r12), %edx
	decl	%r14d
	andl	%edx, %r14d
	shlq	$4, %r14
	movl	$2, %eax
	cmpq	$0, 8(%r13,%r14)
	je	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13,%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	callq	_skb_shinfo
	movl	(%rax), %esi
	movq	_TX_RING_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	leaq	1(%rsi), %r8
	movq	16(%rbx), %rcx
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r8d, %r9d
	andl	$-2, %r9d
	leal	2(%r12), %ebx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	-1(%rbx), %edx
	andl	%eax, %edx
	shlq	$4, %rdx
	movq	8(%rcx,%rdx), %rdx
	movq	%rdx, (%r15,%rdi,8)
	movl	%eax, %edx
	andl	%ebx, %edx
	shlq	$4, %rdx
	movq	8(%rcx,%rdx), %rdx
	movq	%rdx, 8(%r15,%rdi,8)
	addq	$2, %rdi
	addl	$2, %ebx
	cmpq	%rdi, %r9
	jne	LBB0_7
	jmp	LBB0_8
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edi, %edi
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	addq	%r14, %r13
	testb	$1, %r8b
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	addl	%edi, %edx
	andl	%edx, %eax
	shlq	$4, %rax
	movq	8(%rcx,%rax), %rax
	movq	%rax, (%r15,%rdi,8)
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rdx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movq	%r15, %rcx
	callq	_pasemi_mac_unmap_tx_skb
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	addl	%eax, %r12d
	cmpl	%ecx, %r12d
	jae	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_TX_RING_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_2
LBB0_13:
	movq	16(%rbx), %rdi
	callq	_kfree
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_pasemi_dma_free_chan
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_SKB_FRAGS,4,2              ## @MAX_SKB_FRAGS
	.comm	_TX_RING_SIZE,4,2               ## @TX_RING_SIZE
	.no_dead_strip	_pasemi_mac_free_tx_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pasemi_mac_free_tx_resources
_pasemi_mac_free_tx_resources:          ; @pasemi_mac_free_tx_resources
	.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
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	bl	_tx_ring
	mov	x20, x0
Lloh3:
	adrp	x8, _MAX_SKB_FRAGS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_SKB_FRAGS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w8, w8, #1
	lsl	x8, x8, #3
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x21, x9, x8
	mov	sp, x21
Lloh8:
	adrp	x22, _TX_RING_SIZE@GOTPAGE
Lloh9:
	ldr	x22, [x22, _TX_RING_SIZE@GOTPAGEOFF]
	ldp	w23, w9, [x0]
	ldr	w8, [x22]
	cmp	w23, w9
	csel	w10, w8, wzr, gt
	add	w24, w10, w9
	cmp	w23, w24
	b.hs	LBB0_9
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	ldr	x9, [x20, #16]
	add	w10, w23, #1
	sub	w8, w8, #1
	and	w8, w8, w10
	add	x10, x9, w8, uxtw #4
	ldr	x10, [x10, #8]
	cbz	x10, LBB0_6
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	add	x25, x9, x8, lsl #4
	ldr	x0, [x25]
	cbz	x0, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_skb_shinfo
	mov	x8, #0
	ldr	w1, [x0]
	ldr	x9, [x20, #16]
	ldr	w10, [x22]
	sub	w10, w10, #1
	add	x11, x1, #1
	mov	w12, w23
	add	x12, x12, #1
LBB0_4:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w13, w12, w8
	and	w13, w10, w13
	add	x13, x9, w13, uxtw #4
	ldr	x13, [x13, #8]
	str	x13, [x21, x8, lsl #3]
	add	x8, x8, #1
	cmp	x11, x8
	b.ne	LBB0_4
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x2, [x25]
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x3, x21
	bl	_pasemi_mac_unmap_tx_skb
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #2
LBB0_7:                                 ;   in Loop: Header=BB0_1 Depth=1
	add	w23, w0, w23
	cmp	w23, w24
	b.hs	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x22]
	b	LBB0_1
LBB0_9:
	ldr	x0, [x20, #16]
	bl	_kfree
	add	x0, x20, #8
	bl	_pasemi_dma_free_chan
	ldur	x8, [x29, #-72]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	sub	sp, x29, #64
	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
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_SKB_FRAGS,4,2              ; @MAX_SKB_FRAGS
	.comm	_TX_RING_SIZE,4,2               ; @TX_RING_SIZE
	.no_dead_strip	_pasemi_mac_free_tx_resources
.subsections_via_symbols
