	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx4_write_mtt_chunk
_mlx4_write_mtt_chunk:                  ## @mlx4_write_mtt_chunk
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r15
	movl	%ecx, %r13d
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_mlx4_priv
	movslq	%r14d, %rsi
	addq	(%r12), %rsi
	leaq	-44(%rbp), %rdx
	movq	%rax, %rdi
	callq	_mlx4_table_find
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rax
	movq	(%rax), %rdi
	movl	-44(%rbp), %esi
	leal	(,%r13,4), %edx
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	callq	_dma_sync_single_for_cpu
	testl	%r13d, %r13d
	jle	LBB0_5
## %bb.3:
	movl	%r13d, %r13d
	xorl	%ebx, %ebx
	movq	_MLX4_MTT_FLAG_PRESENT@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	orl	(%r15,%rbx,4), %edi
	callq	_cpu_to_be64
	movl	%eax, (%r12,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r13
	jne	LBB0_4
LBB0_5:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax), %rdi
	movl	-44(%rbp), %esi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_dma_sync_single_for_device
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_MLX4_MTT_FLAG_PRESENT,4,2      ## @MLX4_MTT_FLAG_PRESENT
	.no_dead_strip	_mlx4_write_mtt_chunk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx4_write_mtt_chunk
_mlx4_write_mtt_chunk:                  ; @mlx4_write_mtt_chunk
	.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, x4
	mov	x23, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	bl	_mlx4_priv
	ldr	x8, [x22]
	add	x1, x8, w21, sxtw
	add	x2, sp, #12
	bl	_mlx4_table_find
	cbz	x0, LBB0_5
; %bb.1:
	mov	x22, x0
	ldr	x8, [x20]
	ldr	x0, [x8]
	ldr	w1, [sp, #12]
	lsl	w21, w23, #2
Lloh0:
	adrp	x24, _DMA_TO_DEVICE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _DMA_TO_DEVICE@GOTPAGEOFF]
	ldr	w3, [x24]
	mov	x2, x21
	bl	_dma_sync_single_for_cpu
	cmp	w23, #1
	b.lt	LBB0_4
; %bb.2:
	mov	w23, w23
Lloh2:
	adrp	x25, _MLX4_MTT_FLAG_PRESENT@GOTPAGE
Lloh3:
	ldr	x25, [x25, _MLX4_MTT_FLAG_PRESENT@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19], #4
	ldr	w9, [x25]
	orr	w0, w9, w8
	bl	_cpu_to_be64
	str	w0, [x22], #4
	subs	x23, x23, #1
	b.ne	LBB0_3
LBB0_4:
	ldr	x8, [x20]
	ldr	x0, [x8]
	ldr	w1, [sp, #12]
	ldr	w3, [x24]
	mov	x2, x21
	bl	_dma_sync_single_for_device
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_MLX4_MTT_FLAG_PRESENT,4,2      ; @MLX4_MTT_FLAG_PRESENT
	.no_dead_strip	_mlx4_write_mtt_chunk
.subsections_via_symbols
