	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_buf_write_mtt             ## -- Begin function mlx4_buf_write_mtt
	.p2align	4, 0x90
_mlx4_buf_write_mtt:                    ## @mlx4_buf_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	(%rdx), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$8, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %r12
	movl	(%rbx), %r8d
	testl	%r8d, %r8d
	jle	LBB0_19
## %bb.2:
	movl	4(%rbx), %esi
	cmpl	$1, %r8d
	jne	LBB0_6
## %bb.3:
	xorl	%edx, %edx
LBB0_14:
	testb	$1, %r8b
	je	LBB0_19
## %bb.15:
	cmpl	$1, %esi
	jne	LBB0_16
## %bb.17:
	movb	8(%rbx), %cl
	movl	%edx, %eax
	shll	%cl, %eax
	movslq	%eax, %rcx
	addq	24(%rbx), %rcx
	jmp	LBB0_18
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_5
LBB0_6:
	movl	%r8d, %edi
	andl	$-2, %edi
	xorl	%edx, %edx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	movzbl	8(%rbx), %ecx
	leal	1(%rdx), %eax
	shll	%cl, %eax
	movslq	%eax, %rcx
	addq	24(%rbx), %rcx
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%rcx, 8(%r12,%rdx,8)
	addq	$2, %rdx
	cmpq	%rdx, %rdi
	je	LBB0_14
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$1, %esi
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movzbl	8(%rbx), %ecx
	movl	%edx, %eax
	shll	%cl, %eax
	movslq	%eax, %rcx
	addq	24(%rbx), %rcx
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	16(%rbx), %rax
	movq	(%rax,%rdx,8), %rcx
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%rcx, (%r12,%rdx,8)
	cmpl	$1, %esi
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	16(%rbx), %rax
	movq	8(%rax,%rdx,8), %rcx
	jmp	LBB0_13
LBB0_16:
	movq	16(%rbx), %rax
	movq	(%rax,%rdx,8), %rcx
LBB0_18:
	movq	%rcx, (%r12,%rdx,8)
LBB0_19:
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	movl	%r8d, %ecx
	movq	%r12, %r8
	callq	_mlx4_write_mtt
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_kfree
	movl	%ebx, %eax
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_buf_write_mtt             ; -- Begin function mlx4_buf_write_mtt
	.p2align	2
_mlx4_buf_write_mtt:                    ; @mlx4_buf_write_mtt
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x2]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #8
	bl	_kcalloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x21, x0
	ldr	w3, [x22]
	cmp	w3, #1
	b.lt	LBB0_7
; %bb.2:
	mov	x8, #0
	ldr	w9, [x22, #4]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x10, [x22, #16]
	ldr	x10, [x10, x8, lsl #3]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	x10, [x21, x8, lsl #3]
	add	x8, x8, #1
	cmp	x3, x8
	b.eq	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w9, #1
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x10, [x22, #24]
	ldr	w11, [x22, #8]
	lsl	w11, w8, w11
	add	x10, x10, w11, sxtw
	b	LBB0_4
LBB0_7:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
                                        ; kill: def $w3 killed $w3 killed $x3
	mov	x4, x21
	bl	_mlx4_write_mtt
	mov	x19, x0
	mov	x0, x21
	bl	_kfree
	mov	x0, x19
	b	LBB0_9
LBB0_8:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
