	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_write_mtt                ## -- Begin function mthca_write_mtt
	.p2align	4, 0x90
_mthca_write_mtt:                       ## @mthca_write_mtt
	.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
	movl	%r8d, %r14d
	movq	%rcx, %r15
	movl	%edx, %ebx
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	callq	_mthca_write_mtt_size
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	leaq	8(%r13), %rax
	cmpq	%rax, 16(%r13)
	je	LBB0_1
LBB0_8:
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movq	%r15, %rcx
	movl	%r14d, %r8d
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	___mthca_write_mtt              ## TAILCALL
LBB0_1:
	movq	_MTHCA_FLAG_FMR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r13)
	je	LBB0_8
## %bb.2:
	testl	%r14d, %r14d
	jg	LBB0_3
LBB0_7:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movq	%r15, %rcx
	movl	%r12d, %r8d
	callq	_mthca_tavor_write_mtt_seg
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	addl	%r12d, %ebx
	movslq	%r12d, %rax
	leaq	(%r15,%rax,4), %r15
	subl	%r12d, %r14d
	jle	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movl	%r14d, %esi
	callq	_min
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_mthca_is_memfree
	movq	%r13, %rdi
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movq	%r15, %rcx
	movl	%r12d, %r8d
	callq	_mthca_arbel_write_mtt_seg
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_FLAG_FMR,4,2             ## @MTHCA_FLAG_FMR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_write_mtt                ; -- Begin function mthca_write_mtt
	.p2align	2
_mthca_write_mtt:                       ; @mthca_write_mtt
	.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, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	bl	_mthca_write_mtt_size
	add	x8, x23, #8
	ldr	x9, [x23, #16]
	cmp	x9, x8
	b.eq	LBB0_2
LBB0_1:
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	mov	x4, x19
	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
	b	___mthca_write_mtt
LBB0_2:
	ldr	w8, [x23]
Lloh0:
	adrp	x9, _MTHCA_FLAG_FMR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MTHCA_FLAG_FMR@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_1
; %bb.3:
	cmp	w19, #1
	b.lt	LBB0_9
; %bb.4:
	mov	x24, x0
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	mov	x4, x25
	bl	_mthca_tavor_write_mtt_seg
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	sub	w19, w19, w25
	add	w21, w25, w21
	add	x20, x20, w25, sxtw #2
	cmp	w19, #0
	b.le	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	mov	x1, x19
	bl	_min
	mov	x25, x0
	mov	x0, x23
	bl	_mthca_is_memfree
	cbz	x0, LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	mov	x4, x25
	bl	_mthca_arbel_write_mtt_seg
	b	LBB0_6
LBB0_9:
	mov	w0, #0
	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	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_FLAG_FMR,4,2             ; @MTHCA_FLAG_FMR
.subsections_via_symbols
