	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nes_connect                    ## -- Begin function nes_connect
	.p2align	4, 0x90
_nes_connect:                           ## @nes_connect
	.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	%rsi, %r12
	movq	%rdi, %rbx
	movl	56(%rdi), %edi
	movl	24(%rsi), %esi
	callq	_nes_get_qp
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rdi
	callq	_to_nesqp
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	%rax, %r15
	movl	8(%rax), %edi
	callq	_to_nesvnic
	testq	%rax, %rax
	je	LBB0_1
## %bb.5:
	movq	%rax, %r14
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.6:
	cmpl	$0, 8(%rbx)
	je	LBB0_1
## %bb.7:
	cmpl	$0, 32(%rbx)
	je	LBB0_1
## %bb.8:
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_NES_DBG_CM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movl	40(%r15), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	(%r14), %rdi
	callq	_ntohl
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	40(%rbx), %rdi
	callq	_ntohl
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	32(%rbx), %edi
	callq	_ntohs
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	16(%rbx), %rdi
	callq	_ntohl
	movl	%eax, %r13d
	movl	8(%rbx), %edi
	callq	_ntohs
	movl	%eax, %r10d
	leaq	L_.str(%rip), %rsi
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	-72(%rbp), %edi                 ## 4-byte Reload
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	movl	-64(%rbp), %r8d                 ## 4-byte Reload
	movl	-60(%rbp), %r9d                 ## 4-byte Reload
	xorl	%eax, %eax
	pushq	%r10
	pushq	%r13
	callq	_nes_debug
	addq	$16, %rsp
	movq	_cm_connects@GOTPCREL(%rip), %rdi
	callq	_atomic_inc
	movl	$1, (%r15)
	movq	%rbx, 32(%r15)
	movq	%r15, 48(%rbx)
	movl	(%r12), %eax
	movl	%eax, 4(%r15)
	movl	8(%r12), %edi
	callq	_cpu_to_le32
	movq	24(%r15), %rcx
	orl	%eax, (%rcx)
	movq	8(%r12), %rdx
	testq	%rdx, %rdx
	jne	LBB0_10
## %bb.9:
	movl	$1, %edi
	callq	_cpu_to_le32
	movq	24(%r15), %rcx
	orl	%eax, (%rcx)
	movq	8(%r12), %rdx
LBB0_10:
	movq	_NES_DBG_CM@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_nes_debug
	movl	(%r13), %edi
	movl	(%r12), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_nes_debug
	movq	16(%rbx), %r13
	movq	40(%rbx), %rax
	movq	%r13, %rdi
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	cmpq	%rax, %r13
	je	LBB0_12
## %bb.11:
	movl	8(%rbx), %edi
	callq	_ntohs
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_PCI_FUNC
	movq	_NES_MANAGE_APBVT_ADD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_nes_manage_apbvt
	movq	16(%rbx), %rdi
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_12:
	callq	_htonl
	movq	%rax, -88(%rbp)
	movl	8(%rbx), %edi
	callq	_htons
	movq	%rax, -96(%rbp)
	movq	40(%rbx), %rdi
	callq	_htonl
	movq	%rax, -104(%rbp)
	movl	32(%rbx), %edi
	callq	_htons
	movq	%rax, -112(%rbp)
	movq	%rbx, -120(%rbp)
	movq	_NES_CM_IWARP_CONN_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -128(%rbp)
	movq	%rbx, %rdi
	callq	*24(%rbx)
	movq	_g_cm_core@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	(%rdi), %rax
	movl	(%r12), %edx
	movq	16(%r12), %rcx
	leaq	-128(%rbp), %r8
	movq	%r14, %rsi
	callq	*(%rax)
	testq	%rax, %rax
	je	LBB0_13
## %bb.16:
	movq	%r15, %rdi
	addq	$8, %rdi
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%rax)
	movq	%rax, 16(%r15)
	movq	%r15, 8(%rax)
	callq	_nes_add_ref
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	cmpq	-56(%rbp), %r13                 ## 8-byte Folded Reload
	je	LBB0_15
## %bb.14:
	movl	8(%rbx), %edi
	callq	_ntohs
	movl	%eax, %r15d
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_PCI_FUNC
	movq	_NES_MANAGE_APBVT_DEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_nes_manage_apbvt
LBB0_15:
	movq	%rbx, %rdi
	callq	*(%rbx)
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NES_DBG_CM,4,2                 ## @NES_DBG_CM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"QP%u, current IP = 0x%08X, Destination IP = 0x%08X:0x%04X, local = 0x%08X:0x%04X.\n"

	.comm	_cm_connects,4,2                ## @cm_connects
L_.str.1:                               ## @.str.1
	.asciz	"requested ord = 0x%08X.\n"

L_.str.2:                               ## @.str.2
	.asciz	"mpa private data len =%u\n"

	.comm	_NES_MANAGE_APBVT_ADD,4,2       ## @NES_MANAGE_APBVT_ADD
	.comm	_NES_CM_IWARP_CONN_TYPE,4,2     ## @NES_CM_IWARP_CONN_TYPE
	.comm	_g_cm_core,8,3                  ## @g_cm_core
	.comm	_NES_MANAGE_APBVT_DEL,4,2       ## @NES_MANAGE_APBVT_DEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nes_connect                    ; -- Begin function nes_connect
	.p2align	2
_nes_connect:                           ; @nes_connect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
	mov	x22, x1
	mov	x19, x0
	ldr	w0, [x0, #56]
	ldr	w1, [x1, #24]
	bl	_nes_get_qp
	cbz	x0, LBB0_10
; %bb.1:
	bl	_to_nesqp
	cbz	x0, LBB0_10
; %bb.2:
	mov	x21, x0
	mov	x23, x0
	ldr	w0, [x23, #8]!
	bl	_to_nesvnic
	cbz	x0, LBB0_10
; %bb.3:
	mov	x20, x0
	ldr	x24, [x0, #8]
	cbz	x24, LBB0_10
; %bb.4:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_10
; %bb.5:
	ldr	w8, [x19, #32]
	cbz	w8, LBB0_10
; %bb.6:
Lloh0:
	adrp	x8, _NES_DBG_CM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NES_DBG_CM@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	ldr	w8, [x21, #40]
	stp	w9, w8, [sp, #40]               ; 8-byte Folded Spill
	ldr	x0, [x20]
	bl	_ntohl
	mov	x26, x0
	ldr	x0, [x19, #40]
	bl	_ntohl
	mov	x27, x0
	ldr	w0, [x19, #32]
	bl	_ntohs
	mov	x28, x0
	ldr	x0, [x19, #16]
	bl	_ntohl
	mov	x25, x0
	ldr	w0, [x19, #8]
	bl	_ntohs
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x25, x0, [sp, #24]
	stp	x27, x28, [sp, #8]
	str	x26, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	ldp	w0, w2, [sp, #40]               ; 8-byte Folded Reload
	bl	_nes_debug
Lloh5:
	adrp	x0, _cm_connects@GOTPAGE
Lloh6:
	ldr	x0, [x0, _cm_connects@GOTPAGEOFF]
	bl	_atomic_inc
	mov	w8, #1
	str	w8, [x21]
	str	x19, [x21, #32]
	str	x21, [x19, #48]
	ldr	w8, [x22]
	str	w8, [x21, #4]
	ldr	w0, [x22, #8]
	bl	_cpu_to_le32
	ldr	x8, [x21, #24]
	ldr	w9, [x8]
	orr	w9, w9, w0
	str	w9, [x8]
	ldr	x2, [x22, #8]
	cbnz	x2, LBB0_8
; %bb.7:
	mov	w0, #1
	bl	_cpu_to_le32
	ldr	x8, [x21, #24]
	ldr	w9, [x8]
	orr	w9, w9, w0
	str	w9, [x8]
	ldr	x2, [x22, #8]
LBB0_8:
Lloh7:
	adrp	x25, _NES_DBG_CM@GOTPAGE
Lloh8:
	ldr	x25, [x25, _NES_DBG_CM@GOTPAGEOFF]
	ldr	w0, [x25]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_nes_debug
	ldr	w0, [x25]
	ldr	w2, [x22]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_nes_debug
	ldr	x26, [x19, #16]
	ldr	x27, [x19, #40]
	cmp	x26, x27
	b.ne	LBB0_13
; %bb.9:
	mov	w25, #0
	mov	x0, x26
	b	LBB0_14
LBB0_10:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_13:
	ldr	w0, [x19, #8]
	bl	_ntohs
	mov	x25, x0
	ldr	x8, [x24]
	ldr	w0, [x8]
	bl	_PCI_FUNC
	mov	x2, x0
Lloh15:
	adrp	x8, _NES_MANAGE_APBVT_ADD@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NES_MANAGE_APBVT_ADD@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x25
	bl	_nes_manage_apbvt
	ldr	x0, [x19, #16]
	mov	w25, #1
LBB0_14:
	bl	_htonl
	str	x0, [sp, #88]
	ldr	w0, [x19, #8]
	bl	_htons
	str	x0, [sp, #80]
	ldr	x0, [x19, #40]
	bl	_htonl
	str	x0, [sp, #72]
	ldr	w0, [x19, #32]
	bl	_htons
	stp	x19, x0, [sp, #56]
Lloh18:
	adrp	x8, _NES_CM_IWARP_CONN_TYPE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _NES_CM_IWARP_CONN_TYPE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [sp, #48]
	ldr	x8, [x19, #24]
	mov	x0, x19
	blr	x8
Lloh21:
	adrp	x8, _g_cm_core@GOTPAGE
Lloh22:
	ldr	x8, [x8, _g_cm_core@GOTPAGEOFF]
Lloh23:
	ldr	x0, [x8]
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	w2, [x22]
	ldr	x3, [x22, #16]
	add	x4, sp, #48
	mov	x1, x20
	blr	x8
	cbz	x0, LBB0_16
; %bb.15:
	str	w25, [x0]
	str	x0, [x21, #16]
	str	x21, [x0, #8]
	mov	x0, x23
	bl	_nes_add_ref
	mov	w0, #0
	b	LBB0_12
LBB0_16:
	cmp	x26, x27
	b.eq	LBB0_18
; %bb.17:
	ldr	w0, [x19, #8]
	bl	_ntohs
	mov	x21, x0
	ldr	x8, [x24]
	ldr	w0, [x8]
	bl	_PCI_FUNC
	mov	x2, x0
Lloh24:
	adrp	x8, _NES_MANAGE_APBVT_DEL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _NES_MANAGE_APBVT_DEL@GOTPAGEOFF]
Lloh26:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_nes_manage_apbvt
LBB0_18:
	ldr	x8, [x19]
	mov	x0, x19
	blr	x8
Lloh27:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NES_DBG_CM,4,2                 ; @NES_DBG_CM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"QP%u, current IP = 0x%08X, Destination IP = 0x%08X:0x%04X, local = 0x%08X:0x%04X.\n"

	.comm	_cm_connects,4,2                ; @cm_connects
l_.str.1:                               ; @.str.1
	.asciz	"requested ord = 0x%08X.\n"

l_.str.2:                               ; @.str.2
	.asciz	"mpa private data len =%u\n"

	.comm	_NES_MANAGE_APBVT_ADD,4,2       ; @NES_MANAGE_APBVT_ADD
	.comm	_NES_CM_IWARP_CONN_TYPE,4,2     ; @NES_CM_IWARP_CONN_TYPE
	.comm	_g_cm_core,8,3                  ; @g_cm_core
	.comm	_NES_MANAGE_APBVT_DEL,4,2       ; @NES_MANAGE_APBVT_DEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
