	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ibnd_discover_fabric           ## -- Begin function ibnd_discover_fabric
	.p2align	4, 0x90
_ibnd_discover_fabric:                  ## @ibnd_discover_fabric
	.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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movq	%rdx, %r13
	movl	%esi, %r15d
	movq	%rdi, -120(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -96(%rbp)
	movaps	%xmm0, -176(%rbp)
	movq	_IB_SMI_CLASS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_IB_SMI_DIRECT_CLASS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	testq	%rdx, %rdx
	leaq	-176(%rbp), %r14
	movq	%rdx, %rbx
	cmoveq	%r14, %rbx
	leaq	-96(%rbp), %rdi
	movq	%rcx, %rsi
	callq	_set_config
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
LBB0_2:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_IBND_ERROR
LBB0_17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_19
## %bb.18:
	movq	%rbx, %rax
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r12, -112(%rbp)                ## 8-byte Spill
	movl	%r15d, %eax
	movq	-120(%rbp), %r15                ## 8-byte Reload
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_allocate_fabric_internal
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r12
	leaq	-144(%rbp), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	testq	%r13, %r13
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, -128(%rbp)
	leaq	-96(%rbp), %rax
	movq	%rax, -136(%rbp)
	cmovneq	%r13, %r14
	movq	(%r14), %rax
	movq	%rax, -152(%rbp)
	leaq	-56(%rbp), %rdx
	movq	%r15, %r12
	movq	%r15, %rdi
	movl	%ebx, %r14d
	movl	%ebx, %esi
	movl	$2, %ecx
	callq	_mad_rpc_open_port
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r13
	movq	-112(%rbp), %rbx                ## 8-byte Reload
	movl	8(%rbx), %esi
	movq	%rax, %rdi
	callq	_mad_rpc_set_timeout
	movl	4(%rbx), %esi
	movq	%r13, %rdi
	callq	_mad_rpc_set_retries
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_smp_mkey_set
	leaq	-144(%rbp), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movq	%r13, %rcx
	callq	_ib_resolve_self_via
	testq	%rax, %rax
	js	LBB0_8
## %bb.9:
	movq	%r13, %rdi
	callq	_mad_rpc_close_port
	leaq	-64(%rbp), %rdi
	leaq	-152(%rbp), %rcx
	leaq	-96(%rbp), %r8
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_smp_engine_init
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_free
	jmp	LBB0_16
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%r12, %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_IBND_ERROR
	jmp	LBB0_17
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_IBND_ERROR
	movq	%r13, %rdi
	callq	_mad_rpc_close_port
	jmp	LBB0_17
LBB0_11:
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_portid2str
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %esi
	callq	_IBND_DEBUG
	leaq	-64(%rbp), %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_query_node_info
	testl	%eax, %eax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_12
LBB0_13:
	movl	-64(%rbp), %eax
	movl	%eax, 4(%rbx)
	movl	-152(%rbp), %eax
	addl	%eax, (%rbx)
	movq	%rbx, %rdi
	callq	_group_nodes
	testq	%rax, %rax
	jne	LBB0_15
## %bb.14:
	leaq	-64(%rbp), %rdi
	callq	_smp_engine_destroy
	jmp	LBB0_17
LBB0_12:
	leaq	-64(%rbp), %rdi
	callq	_process_mads
	testq	%rax, %rax
	je	LBB0_13
LBB0_15:
	leaq	-64(%rbp), %rdi
	callq	_smp_engine_destroy
	movq	%rbx, %rdi
	callq	_ibnd_destroy_fabric
LBB0_16:
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_SMI_CLASS,4,2               ## @IB_SMI_CLASS
	.comm	_IB_SMI_DIRECT_CLASS,4,2        ## @IB_SMI_DIRECT_CLASS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid ibnd_config\n"

L_.str.1:                               ## @.str.1
	.asciz	"OOM: failed to calloc ibnd_fabric_t\n"

L_.str.2:                               ## @.str.2
	.asciz	"can't open MAD port (%s:%d)\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to resolve self\n"

L_.str.4:                               ## @.str.4
	.asciz	"from %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ibnd_discover_fabric           ; -- Begin function ibnd_discover_fabric
	.p2align	2
_ibnd_discover_fabric:                  ; @ibnd_discover_fabric
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	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
	mov	x23, x3
	mov	x24, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	stp	xzr, xzr, [sp, #80]
	stp	xzr, xzr, [sp, #64]
Lloh3:
	adrp	x8, _IB_SMI_CLASS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IB_SMI_CLASS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _IB_SMI_DIRECT_CLASS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IB_SMI_DIRECT_CLASS@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w8, w9, [x29, #-80]
	add	x8, sp, #64
	cmp	x2, #0
	csel	x20, x8, x2, eq
	add	x0, sp, #80
	mov	x1, x3
	bl	_set_config
	cbz	x0, LBB0_6
; %bb.1:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
LBB0_2:
	bl	_IBND_ERROR
LBB0_3:
	mov	x19, #0
LBB0_4:
	ldur	x8, [x29, #-72]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.5:
	mov	x0, x19
	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
	add	sp, sp, #192
	ret
LBB0_6:
	bl	_allocate_fabric_internal
	mov	x19, x0
	cbz	x0, LBB0_11
; %bb.7:
	add	x8, sp, #24
	add	x25, x8, #8
	mov	x0, x25
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	add	x8, sp, #64
	cmp	x24, #0
	csel	x8, x8, x24, eq
	ldr	x8, [x8]
	add	x9, sp, #80
	stp	x9, x19, [sp, #40]
	str	x8, [sp, #24]
	sub	x2, x29, #80
	mov	x0, x22
	mov	x1, x21
	mov	w3, #2
	bl	_mad_rpc_open_port
	cbz	x0, LBB0_12
; %bb.8:
	mov	x24, x0
	ldr	w1, [x23, #8]
	bl	_mad_rpc_set_timeout
	ldr	w1, [x23, #4]
	mov	x0, x24
	bl	_mad_rpc_set_retries
	ldr	w1, [x23]
	mov	x0, x24
	bl	_smp_mkey_set
	mov	x0, x25
	mov	x1, #0
	mov	x2, #0
	mov	x3, x24
	bl	_ib_resolve_self_via
	tbnz	x0, #63, LBB0_13
; %bb.9:
	mov	x0, x24
	bl	_mad_rpc_close_port
	add	x0, sp, #56
	add	x3, sp, #24
	add	x4, sp, #80
	mov	x1, x22
	mov	x2, x21
	bl	_smp_engine_init
	cbz	x0, LBB0_14
; %bb.10:
	mov	x0, x19
	bl	_free
	b	LBB0_3
LBB0_11:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IBND_ERROR
	b	LBB0_4
LBB0_12:
	stp	x22, x21, [sp]
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_2
LBB0_13:
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_IBND_ERROR
	mov	x0, x24
	bl	_mad_rpc_close_port
	b	LBB0_3
LBB0_14:
	mov	x0, x20
	bl	_portid2str
	mov	x1, x0
Lloh20:
	adrp	x0, l_.str.4@PAGE
Lloh21:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_IBND_DEBUG
	add	x0, sp, #56
	mov	x1, x20
	mov	x2, #0
	bl	_query_node_info
	cbz	w0, LBB0_17
LBB0_15:
	ldr	w8, [sp, #56]
	ldr	w9, [sp, #24]
	ldr	w10, [x19]
	add	w9, w10, w9
	stp	w9, w8, [x19]
	mov	x0, x19
	bl	_group_nodes
	cbnz	x0, LBB0_18
; %bb.16:
	add	x0, sp, #56
	bl	_smp_engine_destroy
	b	LBB0_4
LBB0_17:
	add	x0, sp, #56
	bl	_process_mads
	cbz	x0, LBB0_15
LBB0_18:
	add	x0, sp, #56
	bl	_smp_engine_destroy
	mov	x0, x19
	bl	_ibnd_destroy_fabric
	b	LBB0_3
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_SMI_CLASS,4,2               ; @IB_SMI_CLASS
	.comm	_IB_SMI_DIRECT_CLASS,4,2        ; @IB_SMI_DIRECT_CLASS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid ibnd_config\n"

l_.str.1:                               ; @.str.1
	.asciz	"OOM: failed to calloc ibnd_fabric_t\n"

l_.str.2:                               ; @.str.2
	.asciz	"can't open MAD port (%s:%d)\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to resolve self\n"

l_.str.4:                               ; @.str.4
	.asciz	"from %s\n"

.subsections_via_symbols
