	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_en_build_dma_wqe
_mlx4_en_build_dma_wqe:                 ## @mlx4_en_build_dma_wqe
	.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
	movq	%r9, -88(%rbp)                  ## 8-byte Spill
	movq	%rdx, %r14
	movq	(%rdi), %r12
	movl	(%rsi), %eax
	leal	-1(%rax), %edx
	testl	%eax, %eax
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movl	%r8d, -68(%rbp)                 ## 4-byte Spill
	jle	LBB0_1
## %bb.2:
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movl	%edx, %edx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	leaq	(,%rdx,4), %r12
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rsi), %rbx
	addq	%r12, %rbx
	movq	%rbx, %rdi
	callq	_skb_frag_size
	movq	%rax, %r15
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r13, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	movq	%r15, %rcx
	callq	_skb_frag_dma_map
	movl	%eax, %ebx
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, %edi
	callq	_cpu_to_be64
	movq	%rax, 8(%r14)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%r14)
	xorl	%eax, %eax
	callq	_dma_wmb
	movq	%r15, %rdi
	callq	_cpu_to_be32
	movq	%rax, (%r14)
	addq	$-24, %r14
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leaq	-1(%rcx), %rax
	addq	$-4, %r12
	testq	%rcx, %rcx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	jg	LBB0_3
## %bb.5:
	movq	%r15, %r13
	movl	$-1, %edx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_6
LBB0_1:
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
LBB0_6:
	movq	16(%rbp), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_10
## %bb.7:
	movq	%rdx, %r13
	movq	%rcx, %rdi
	movq	%rcx, %rbx
	callq	_skb_headlen
	movq	%rax, %r15
	movslq	-68(%rbp), %rsi                 ## 4-byte Folded Reload
	subq	%rsi, %r15
	addq	(%rbx), %rsi
	movq	_PCI_DMA_TODEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_dma_map_single
	movl	%eax, %ebx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rbx
	jmp	LBB0_12
LBB0_11:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_12:
	leaq	L_.str(%rip), %rsi
	callq	_en_err
	incl	%ebx
	xorl	%ecx, %ecx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %ebx
	jge	LBB0_16
## %bb.13:
	addq	$32, %r14
	movq	_PCI_DMA_TODEVICE@GOTPCREL(%rip), %r13
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	callq	_be64_to_cpu
	movq	%rax, %r15
	movq	-8(%r14), %rdi
	callq	_be32_to_cpu
	movl	(%r13), %ecx
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_dma_unmap_page
	incl	%ebx
	addq	$24, %r14
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %ebx
	jl	LBB0_14
## %bb.15:
	xorl	%ecx, %ecx
	jmp	LBB0_16
LBB0_9:
	movl	%ebx, %edi
	callq	_cpu_to_be64
	movq	%rax, 8(%r14)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%r14)
	xorl	%eax, %eax
	callq	_dma_wmb
	movq	%r15, %r13
	movq	%r15, %rdi
	callq	_cpu_to_be32
	movq	%rax, (%r14)
	movq	16(%rbp), %rax
LBB0_10:
	movl	%ebx, 8(%rax)
	movq	%r13, (%rax)
	movl	$1, %ecx
LBB0_16:
	movl	%ecx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_PCI_DMA_TODEVICE,4,2           ## @PCI_DMA_TODEVICE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA mapping error\n"

	.no_dead_strip	_mlx4_en_build_dma_wqe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_en_build_dma_wqe
_mlx4_en_build_dma_wqe:                 ; @mlx4_en_build_dma_wqe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x22, x6
	mov	x23, x5
                                        ; kill: def $w4 killed $w4 def $x4
	mov	x26, x3
	mov	x21, x2
	mov	x19, x1
	mov	x24, x0
	ldr	x20, [x0]
	ldr	w8, [x1]
	subs	w27, w8, #1
	str	x4, [sp, #24]                   ; 8-byte Folded Spill
	b.lt	LBB0_5
; %bb.1:
	stp	x26, x22, [sp, #8]              ; 16-byte Folded Spill
	lsl	x26, x27, #2
Lloh0:
	adrp	x22, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _DMA_TO_DEVICE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x28, x8, x26
	mov	x0, x28
	bl	_skb_frag_size
	mov	x25, x0
	ldr	w4, [x22]
	mov	x0, x20
	mov	x1, x28
	mov	w2, #0
	mov	x3, x25
	bl	_skb_frag_dma_map
	mov	x28, x0
	mov	x0, x20
	mov	x1, x28
	bl	_dma_mapping_error
	cbnz	x0, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x28
	bl	_cpu_to_be64
	stp	x0, x23, [x21, #8]
	bl	_dma_wmb
	mov	x0, x25
	bl	_cpu_to_be32
	str	x0, [x21], #-24
	sub	x8, x27, #1
	sub	x26, x26, #4
	cmp	x27, #0
	mov	x27, x8
	b.gt	LBB0_2
; %bb.4:
	mov	w27, #-1
	ldp	x26, x22, [sp, #8]              ; 16-byte Folded Reload
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_6
	b	LBB0_12
LBB0_5:
	mov	w28, #0
	mov	x25, #0
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_12
LBB0_6:
	mov	x0, x26
	bl	_skb_headlen
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	sxtw	x8, w8
	sub	x25, x0, x8
	ldr	x9, [x26]
	add	x1, x9, x8
Lloh2:
	adrp	x8, _PCI_DMA_TODEVICE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_DMA_TODEVICE@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x2, x25
	bl	_dma_map_single
	mov	x28, x0
	mov	x0, x20
	mov	x1, x28
	bl	_dma_mapping_error
	cbz	x0, LBB0_11
LBB0_7:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	bl	_en_err
	add	w22, w27, #1
	ldr	w8, [x19]
	cmp	w22, w8
	b.ge	LBB0_10
; %bb.8:
	add	x23, x21, #32
Lloh7:
	adrp	x24, _PCI_DMA_TODEVICE@GOTPAGE
Lloh8:
	ldr	x24, [x24, _PCI_DMA_TODEVICE@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x23]
	bl	_be64_to_cpu
	mov	x21, x0
	ldur	x0, [x23, #-8]
	bl	_be32_to_cpu
	mov	x2, x0
	ldr	w3, [x24]
	mov	x0, x20
	mov	x1, x21
	bl	_dma_unmap_page
	add	w22, w22, #1
	ldr	w8, [x19]
	add	x23, x23, #24
	cmp	w22, w8
	b.lt	LBB0_9
LBB0_10:
	mov	w0, #0
	b	LBB0_13
LBB0_11:
	mov	x0, x28
	bl	_cpu_to_be64
	stp	x0, x23, [x21, #8]
	bl	_dma_wmb
	mov	x0, x25
	bl	_cpu_to_be32
	str	x0, [x21]
LBB0_12:
	str	w28, [x22, #8]
	str	x25, [x22]
	mov	w0, #1
LBB0_13:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_PCI_DMA_TODEVICE,4,2           ; @PCI_DMA_TODEVICE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA mapping error\n"

	.no_dead_strip	_mlx4_en_build_dma_wqe
.subsections_via_symbols
