	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tool_setup_peer_mw
_tool_setup_peer_mw:                    ## @tool_setup_peer_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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	movq	%rsp, -128(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rdi), %rbx
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movslq	%edx, %r15
	shlq	$5, %r15
	movq	_TOOL_BUF_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r13, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rax
	xorl	%r12d, %r12d
	cmpq	$0, 24(%rbx,%r15)
	jne	LBB0_6
## %bb.1:
	movq	%r15, -112(%rbp)                ## 8-byte Spill
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	%rbx, -120(%rbp)                ## 8-byte Spill
	movl	(%r14), %edi
	leaq	-64(%rbp), %rdx
	leaq	-68(%rbp), %rcx
	movl	-60(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %esi
	callq	_ntb_peer_mw_get_addr
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movl	(%r14), %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %edx
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	movq	-80(%rbp), %r8                  ## 8-byte Reload
	callq	_ntb_peer_mw_set_trans
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movq	-120(%rbp), %r13                ## 8-byte Reload
	movq	-112(%rbp), %rbx                ## 8-byte Reload
	leaq	(%rbx,%r13), %r12
	addq	$24, %r12
	movl	-64(%rbp), %edi
	movl	-68(%rbp), %esi
	callq	_ioremap_wc
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	leaq	(%rbx,%r13), %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 16(%r13,%rbx)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movl	%r15d, %ecx
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, 8(%r13,%rbx)
	leaq	L_.str(%rip), %rdx
	movq	-104(%rbp), %r12                ## 8-byte Reload
	movq	%r12, %rdi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_snprintf
	movq	8(%r14), %rax
	movslq	%r15d, %rcx
	movl	(%rax,%rcx,4), %edx
	movq	_tool_peer_mw_fops@GOTPCREL(%rip), %r8
	movq	%r12, %rdi
	movl	$384, %esi                      ## imm = 0x180
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	callq	_debugfs_create_file
	movl	%eax, 12(%r13,%rbx)
	xorl	%r12d, %r12d
	jmp	LBB0_6
LBB0_4:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movl	(%r14), %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %edx
	callq	_ntb_peer_mw_clear_trans
LBB0_6:
	movq	-128(%rbp), %rsp                ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%r12d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TOOL_BUF_LEN,4,2               ## @TOOL_BUF_LEN
	.comm	_EFAULT,4,2                     ## @EFAULT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"peer_mw%d"

	.comm	_tool_peer_mw_fops,4,2          ## @tool_peer_mw_fops
	.no_dead_strip	_tool_setup_peer_mw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tool_setup_peer_mw
_tool_setup_peer_mw:                    ; @tool_setup_peer_mw
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #48
	mov	x20, x2
	mov	x21, x0
	mov	x28, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	ldr	x19, [x0, #16]
	sxtw	x23, w20
	add	x24, x19, x23, lsl #5
Lloh3:
	adrp	x8, _TOOL_BUF_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TOOL_BUF_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w25, [x8]
	mov	x9, x25
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x25, #15
	and	x9, x9, #0x1fffffff0
	sub	x26, x8, x9
	mov	sp, x26
	mov	x22, x24
	ldr	x8, [x22, #24]!
	cbz	x8, LBB0_2
; %bb.1:
	mov	w27, #0
	b	LBB0_7
LBB0_2:
	stur	w3, [x29, #-116]                ; 4-byte Folded Spill
	stur	x4, [x29, #-112]                ; 8-byte Folded Spill
	stur	w1, [x29, #-100]                ; 4-byte Folded Spill
	ldr	w0, [x21]
	sub	x2, x29, #96
	sub	x3, x29, #92
	mov	x1, x20
	bl	_ntb_peer_mw_get_addr
	mov	x27, x0
	cbnz	w0, LBB0_7
; %bb.3:
	ldr	w0, [x21]
	ldur	w1, [x29, #-100]                ; 4-byte Folded Reload
	mov	x2, x20
	ldur	w3, [x29, #-116]                ; 4-byte Folded Reload
	ldur	x4, [x29, #-112]                ; 8-byte Folded Reload
	bl	_ntb_peer_mw_set_trans
	mov	x27, x0
	cbnz	w0, LBB0_7
; %bb.4:
	ldp	w0, w1, [x29, #-96]
	bl	_ioremap_wc
	str	x0, [x22]
	cbz	x0, LBB0_6
; %bb.5:
	add	x19, x19, x23, lsl #5
	ldur	w8, [x29, #-116]                ; 4-byte Folded Reload
	str	w8, [x19, #16]
	ldur	x8, [x29, #-112]                ; 8-byte Folded Reload
	str	x8, [x24]
	ldur	w22, [x29, #-100]               ; 4-byte Folded Reload
	str	w22, [x19, #8]
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x26
	mov	x1, x25
	mov	x3, x20
	bl	_snprintf
	ldr	x8, [x21, #8]
	ldr	w2, [x8, w22, sxtw #2]
Lloh10:
	adrp	x4, _tool_peer_mw_fops@GOTPAGE
Lloh11:
	ldr	x4, [x4, _tool_peer_mw_fops@GOTPAGEOFF]
	mov	x0, x26
	mov	w1, #384
	mov	x3, x24
	bl	_debugfs_create_file
	mov	w27, #0
	str	w0, [x19, #12]
	b	LBB0_7
LBB0_6:
Lloh12:
	adrp	x8, _EFAULT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w27, w8
	ldr	w0, [x21]
	ldur	w1, [x29, #-100]                ; 4-byte Folded Reload
	mov	x2, x20
	bl	_ntb_peer_mw_clear_trans
LBB0_7:
	mov	sp, x28
	ldur	x8, [x29, #-88]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x27
	sub	sp, x29, #80
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_TOOL_BUF_LEN,4,2               ; @TOOL_BUF_LEN
	.comm	_EFAULT,4,2                     ; @EFAULT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"peer_mw%d"

	.comm	_tool_peer_mw_fops,4,2          ; @tool_peer_mw_fops
	.no_dead_strip	_tool_setup_peer_mw
.subsections_via_symbols
