	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_en_alloc_frags
_mlx4_en_alloc_frags:                   ## @mlx4_en_alloc_frags
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -60(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MLX4_EN_MAX_RX_FRAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$5, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movl	(%rbx), %r8d
	testl	%r8d, %r8d
	jle	LBB0_9
## %bb.1:
	movq	%rbx, %rdi
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	leaq	8(%r14), %rax
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movslq	%r8d, %rcx
	addq	$32, %r13
	addq	$8, %r14
	cmpq	%rcx, %rbx
	jge	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rdi), %rdx
	movups	-8(%rax,%r13), %xmm0
	movups	8(%rax,%r13), %xmm1
	movups	%xmm1, 16(%r12,%r13)
	movups	%xmm0, (%r12,%r13)
	movq	(%rdx,%r14), %rcx
	movq	(%r12,%r13), %rsi
	addq	%rcx, %rsi
	movq	%rsi, (%r12,%r13)
	addq	%rcx, %rsi
	cmpq	(%rax,%r13), %rsi
	jle	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rcx
	movq	%rax, %r12
	addq	%r14, %rdx
	leaq	(%rcx,%r13), %rsi
	movq	%rdi, %r15
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	callq	_mlx4_alloc_pages
	testq	%rax, %rax
	jne	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %r8d
	movq	%r15, %rdi
	movq	%r12, %rax
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_5
LBB0_6:
	testl	%r8d, %r8d
	jle	LBB0_9
## %bb.7:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movups	(%r15,%rbx), %xmm0
	movups	16(%r15,%rbx), %xmm1
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movups	%xmm1, 16(%rax,%rbx)
	movups	%xmm0, (%rax,%rbx)
	movq	%rdi, %r13
	movq	(%r15,%rbx), %rdi
	addq	16(%r15,%rbx), %rdi
	movups	(%r12,%rbx), %xmm0
	movups	16(%r12,%rbx), %xmm1
	movups	%xmm0, (%r15,%rbx)
	movups	%xmm1, 16(%r15,%rbx)
	callq	_cpu_to_be64
	movq	%r13, %rdi
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movl	%eax, (%rcx,%r14,4)
	incq	%r14
	movslq	(%r13), %rax
	addq	$32, %rbx
	cmpq	%rax, %r14
	jl	LBB0_8
LBB0_9:
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_10:
	movq	%r15, %r14
	testl	%ebx, %ebx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_15
## %bb.11:
	movq	_PCI_DMA_FROMDEVICE@GOTPCREL(%rip), %r12
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	addq	$-32, %r13
	je	LBB0_15
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	-8(%rbx,%r13), %rax
	cmpq	-8(%r15,%r13), %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	4(%r14), %edi
	movq	-24(%rbx,%r13), %rdx
	movq	-16(%rbx,%r13), %rsi
	movl	(%r12), %ecx
	callq	_dma_unmap_page
	movq	-8(%rbx,%r13), %r15
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_atomic_set
	movq	%r15, %rdi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	callq	_put_page
	jmp	LBB0_14
LBB0_15:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_18
## %bb.17:
                                        ## kill: def $eax killed $eax killed $rax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_EN_MAX_RX_FRAGS,4,2       ## @MLX4_EN_MAX_RX_FRAGS
	.comm	_PCI_DMA_FROMDEVICE,4,2         ## @PCI_DMA_FROMDEVICE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_mlx4_en_alloc_frags
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_en_alloc_frags
_mlx4_en_alloc_frags:                   ; @mlx4_en_alloc_frags
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x23, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	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, #-88]
Lloh3:
	adrp	x8, _MLX4_EN_MAX_RX_FRAGS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MLX4_EN_MAX_RX_FRAGS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #5
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x24, x9, x8
	mov	sp, x24
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x26, #0
	mov	x25, #0
	mov	x27, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x27, x27, #1
	add	x25, x25, #32
	add	x26, x26, #8
	cmp	x27, w8, sxtw
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #8]
	add	x2, x9, x26
	add	x1, x24, x25
	add	x9, x20, x25
	ldp	q1, q0, [x9]
	stp	q1, q0, [x1]
	ldr	x10, [x2]
	ldr	x11, [x1]
	add	x11, x11, x10
	add	x10, x11, x10
	str	x11, [x1]
	ldr	x9, [x9, #8]
	cmp	x10, x9
	b.le	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x3, x23
	bl	_mlx4_alloc_pages
	cbnz	x0, LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x19]
	b	LBB0_2
LBB0_6:
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.7:
	mov	x23, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x20]
	stp	q0, q1, [x21], #32
	ldr	x8, [x20, #16]
	ldr	x9, [x20]
	add	x0, x9, x8
	ldp	q0, q1, [x24], #32
	stp	q0, q1, [x20], #32
	bl	_cpu_to_be64
	ldr	x8, [x22]
	str	w0, [x8, x23, lsl #2]
	add	x23, x23, #1
	ldrsw	x8, [x19]
	cmp	x23, x8
	b.lt	LBB0_8
LBB0_9:
	mov	w0, #0
	b	LBB0_16
LBB0_10:
	cbz	w27, LBB0_15
; %bb.11:
	sub	x21, x20, #8
Lloh8:
	adrp	x22, _PCI_DMA_FROMDEVICE@GOTPAGE
Lloh9:
	ldr	x22, [x22, _PCI_DMA_FROMDEVICE@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	subs	x25, x25, #32
	b.eq	LBB0_15
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	add	x20, x24, x25
	ldur	x8, [x20, #-8]
	ldr	x9, [x21, x25]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w0, [x19, #4]
	ldp	x2, x1, [x20, #-24]
	ldr	w3, [x22]
	bl	_dma_unmap_page
	ldur	x20, [x20, #-8]
	mov	x0, x20
	mov	w1, #1
	bl	_atomic_set
	mov	x0, x20
	bl	_put_page
	b	LBB0_12
LBB0_15:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	ldur	x8, [x29, #-88]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.17:
	sub	sp, x29, #80
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_EN_MAX_RX_FRAGS,4,2       ; @MLX4_EN_MAX_RX_FRAGS
	.comm	_PCI_DMA_FROMDEVICE,4,2         ; @PCI_DMA_FROMDEVICE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_mlx4_en_alloc_frags
.subsections_via_symbols
