	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function switchtec_ntb_init_shared_mw
_switchtec_ntb_init_shared_mw:          ## @switchtec_ntb_init_shared_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	16(%rdi), %rcx
	movl	(%rax), %r14d
	incl	36(%rdi)
	movq	(%rcx), %rdi
	movq	_LUT_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	8(%rbx), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movl	%eax, 12(%rbx)
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	callq	_switchtec_ntb_init_shared
	movl	32(%rbx), %esi
	movl	8(%rbx), %r8d
	movl	28(%rbx), %ecx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_config_rsvd_lut_win
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_3
LBB0_5:
	movq	16(%rbx), %rax
	movq	(%rax), %rdi
	movl	(%r12), %esi
	movl	8(%rbx), %ecx
	movl	12(%rbx), %edx
	callq	_dma_free_coherent
	jmp	LBB0_6
LBB0_1:
	movq	16(%rbx), %rdi
	addq	$8, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_6
LBB0_3:
	movq	16(%rbx), %rax
	movq	(%rax), %rdi
	movl	(%r12), %edx
	movl	%r14d, %esi
	callq	_pci_iomap
	movl	%eax, 24(%rbx)
	testl	%eax, %eax
	je	LBB0_4
## %bb.7:
	movq	16(%rbx), %rdi
	addq	$8, %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	xorl	%r15d, %r15d
LBB0_6:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_LUT_SIZE,4,2                   ## @LUT_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to allocate memory for shared mw\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Shared MW Ready\n"

	.no_dead_strip	_switchtec_ntb_init_shared_mw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function switchtec_ntb_init_shared_mw
_switchtec_ntb_init_shared_mw:          ; @switchtec_ntb_init_shared_mw
	.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	x19, x0
	ldr	x8, [x0]
	ldr	w20, [x8]
	ldr	w8, [x0, #36]
	add	w8, w8, #1
	str	w8, [x0, #36]
	ldr	x8, [x0, #16]
Lloh0:
	adrp	x22, _LUT_SIZE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _LUT_SIZE@GOTPAGEOFF]
	ldr	x0, [x8]
	ldr	w1, [x22]
	add	x2, x19, #8
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	bl	_dma_alloc_coherent
	str	w0, [x19, #12]
	cbz	w0, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_switchtec_ntb_init_shared
	ldp	w3, w1, [x19, #28]
	ldr	w4, [x19, #8]
	mov	x0, x19
	mov	w2, #0
	bl	_config_rsvd_lut_win
	mov	x21, x0
	cbz	w0, LBB0_4
LBB0_2:
	ldr	x8, [x19, #16]
	ldr	x0, [x8]
	ldr	w1, [x22]
	ldp	w3, w2, [x19, #8]
	bl	_dma_free_coherent
	b	LBB0_6
LBB0_3:
	ldr	x8, [x19, #16]
	add	x0, x8, #8
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_6
LBB0_4:
	ldr	x8, [x19, #16]
	ldr	x0, [x8]
	ldr	w2, [x22]
	mov	x1, x20
	bl	_pci_iomap
	str	w0, [x19, #24]
	cbz	w0, LBB0_7
; %bb.5:
	ldr	x8, [x19, #16]
	add	x0, x8, #8
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	w21, #0
LBB0_6:
	mov	x0, x21
	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
LBB0_7:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_LUT_SIZE,4,2                   ; @LUT_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to allocate memory for shared mw\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Shared MW Ready\n"

	.no_dead_strip	_switchtec_ntb_init_shared_mw
.subsections_via_symbols
