	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ntb_set_mw
_ntb_set_mw:                            ## @ntb_set_mw
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, %r13
	movq	(%rdi), %rdi
	movq	8(%r13), %r14
	movq	(%rdi), %r12
	movq	_PIDX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rcx
	leaq	-60(%rbp), %r8
	movl	%ebx, %edx
	xorl	%r9d, %r9d
	callq	_ntb_mw_get_align
	movl	%ebx, %ecx
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.3:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movslq	%ecx, %r12
	shlq	$5, %r12
	leaq	(%r14,%r12), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	-60(%rbp), %esi
	movl	%r15d, %edi
	callq	_round_up
	movq	%rax, %rbx
	movl	-44(%rbp), %esi
	movl	%r15d, %edi
	callq	_round_up
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rbx, (%rcx)
	jne	LBB0_5
## %bb.4:
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_12:
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rax, %r15
	leaq	(%r14,%r12), %rax
	addq	$8, %rax
	cmpq	$0, 8(%r14,%r12)
	je	LBB0_7
## %bb.6:
	movq	%r13, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, %r14
	callq	_ntb_free_mw
	movq	%r14, %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	-80(%rbp), %r14                 ## 8-byte Reload
LBB0_7:
	movq	%rbx, (%rcx)
	movq	%r15, (%rax)
	movq	%r15, 16(%r14,%r12)
	movl	-44(%rbp), %edx
	movq	%rcx, %r15
	movq	%rcx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_ntb_alloc_mw_buffer
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	leaq	(%r14,%r12), %rax
	addq	$16, %rax
	shlq	(%rax)
	movl	-44(%rbp), %edx
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_ntb_alloc_mw_buffer
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r15)
	movq	$0, 16(%r15)
	jmp	LBB0_13
LBB0_10:
	movq	(%r13), %rdi
	movq	_PIDX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	24(%r14,%r12), %ecx
	movq	(%r15), %r8
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edx
	callq	_ntb_mw_set_trans
	movl	$0, %ebx
	testl	%eax, %eax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_13
## %bb.11:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_ntb_free_mw
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PIDX,4,2                       ## @PIDX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to alloc aligned MW buff\n"

L_.str.1:                               ## @.str.1
	.asciz	"Unable to set mw%d translation"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_ntb_set_mw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ntb_set_mw
_ntb_set_mw:                            ; @ntb_set_mw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	cbz	w2, LBB0_4
; %bb.1:
	mov	x23, x2
	mov	x19, x1
	mov	x20, x0
	ldp	x0, x25, [x0]
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _PIDX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PIDX@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x3, sp, #12
	add	x4, sp, #8
	mov	x2, x19
	mov	x5, #0
	bl	_ntb_mw_get_align
	mov	x24, x0
	cbnz	w0, LBB0_6
; %bb.2:
	sxtw	x27, w19
	add	x22, x25, x27, lsl #5
	ldr	w1, [sp, #8]
	mov	x0, x23
	bl	_round_up
	mov	x24, x0
	ldr	w1, [sp, #12]
	mov	x0, x23
	bl	_round_up
	ldr	x8, [x22]
	cmp	x8, x24
	b.ne	LBB0_7
LBB0_3:
	mov	w24, #0
	b	LBB0_6
LBB0_4:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_6:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_7:
	mov	x23, x0
	add	x26, x25, x27, lsl #5
	mov	x28, x26
	ldr	x8, [x28, #8]!
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x20
	mov	x1, x19
	bl	_ntb_free_mw
LBB0_9:
	str	x24, [x22]
	str	x23, [x28]
	str	x23, [x26, #16]!
	ldr	w2, [sp, #12]
	mov	x0, x22
	mov	x1, x21
	bl	_ntb_alloc_mw_buffer
	cbz	w0, LBB0_12
; %bb.10:
	ldr	x8, [x26]
	lsl	x8, x8, #1
	str	x8, [x26]
	ldr	w2, [sp, #12]
	mov	x0, x22
	mov	x1, x21
	bl	_ntb_alloc_mw_buffer
	cbz	w0, LBB0_12
; %bb.11:
	mov	x24, x0
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	stp	xzr, xzr, [x22, #8]
	str	xzr, [x22]
	b	LBB0_6
LBB0_12:
	ldr	x0, [x20]
Lloh7:
	adrp	x8, _PIDX@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PIDX@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	add	x8, x25, x27, lsl #5
	ldr	w3, [x8, #24]
	ldr	x4, [x22]
	mov	x2, x19
	bl	_ntb_mw_set_trans
	cbz	w0, LBB0_3
; %bb.13:
	mov	x8, x19
	str	x8, [sp]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	mov	x0, x20
	mov	x1, x19
	bl	_ntb_free_mw
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PIDX,4,2                       ; @PIDX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to alloc aligned MW buff\n"

l_.str.1:                               ; @.str.1
	.asciz	"Unable to set mw%d translation"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_ntb_set_mw
.subsections_via_symbols
