	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sa_get_handle                  ## -- Begin function sa_get_handle
	.p2align	4, 0x90
_sa_get_handle:                         ## @sa_get_handle
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$1, %edi
	movl	$32, %esi
	callq	_calloc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_IBPANIC
LBB0_2:
	movq	_ibd_ca@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	movq	_ibd_ca_port@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdx
	addq	$8, %rdx
	callq	_resolve_sm_portid
	cmpl	$0, 24(%rbx)
	je	LBB0_3
## %bb.4:
	movl	$1, 8(%rbx)
	cmpq	$0, 16(%rbx)
	jne	LBB0_6
## %bb.5:
	movq	_IB_DEFAULT_QP1_QKEY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
LBB0_6:
	movq	(%r15), %rdi
	movl	(%r14), %esi
	callq	_umad_open_port
	movl	%eax, (%rbx)
	movq	_IB_SA_CLASS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	movl	$2, %edx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	_umad_register
	movl	%eax, 4(%rbx)
	jmp	LBB0_7
LBB0_3:
	movq	(%r15), %rax
	testq	%rax, %rax
	leaq	L_.str.2(%rip), %rsi
	cmoveq	%rax, %rsi
	movl	(%r14), %edx
	leaq	L_.str.1(%rip), %rdi
	callq	_IBWARN
	movq	%rbx, %rdi
	callq	_free
	xorl	%ebx, %ebx
LBB0_7:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"calloc failed"

	.comm	_ibd_ca,8,3                     ## @ibd_ca
	.comm	_ibd_ca_port,4,2                ## @ibd_ca_port
L_.str.1:                               ## @.str.1
	.asciz	"No SM/SA found on port %s:%d"

L_.str.2:                               ## @.str.2
	.space	1

	.comm	_IB_DEFAULT_QP1_QKEY,8,3        ## @IB_DEFAULT_QP1_QKEY
	.comm	_IB_SA_CLASS,4,2                ## @IB_SA_CLASS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sa_get_handle                  ; -- Begin function sa_get_handle
	.p2align	2
_sa_get_handle:                         ; @sa_get_handle
	.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	w0, #1
	mov	w1, #32
	bl	_calloc
	mov	x19, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IBPANIC
LBB0_2:
Lloh2:
	adrp	x21, _ibd_ca@GOTPAGE
Lloh3:
	ldr	x21, [x21, _ibd_ca@GOTPAGEOFF]
	ldr	x0, [x21]
Lloh4:
	adrp	x20, _ibd_ca_port@GOTPAGE
Lloh5:
	ldr	x20, [x20, _ibd_ca_port@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, x19, #8
	bl	_resolve_sm_portid
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_6
; %bb.3:
	mov	w8, #1
	str	w8, [x19, #8]
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_5
; %bb.4:
Lloh6:
	adrp	x8, _IB_DEFAULT_QP1_QKEY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IB_DEFAULT_QP1_QKEY@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	x8, [x19, #16]
LBB0_5:
	ldr	x0, [x21]
	ldr	w1, [x20]
	bl	_umad_open_port
	str	w0, [x19]
Lloh9:
	adrp	x8, _IB_SA_CLASS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IB_SA_CLASS@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	w2, #2
	mov	w3, #1
	mov	x4, #0
	bl	_umad_register
	str	w0, [x19, #4]
	b	LBB0_7
LBB0_6:
	ldr	x8, [x21]
Lloh12:
	adrp	x9, l_.str.2@PAGE
Lloh13:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	x8, #0
	csel	x1, xzr, x9, eq
	ldr	w2, [x20]
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IBWARN
	mov	x0, x19
	bl	_free
	mov	x19, #0
LBB0_7:
	mov	x0, x19
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"calloc failed"

	.comm	_ibd_ca,8,3                     ; @ibd_ca
	.comm	_ibd_ca_port,4,2                ; @ibd_ca_port
l_.str.1:                               ; @.str.1
	.asciz	"No SM/SA found on port %s:%d"

l_.str.2:                               ; @.str.2
	.space	1

	.comm	_IB_DEFAULT_QP1_QKEY,8,3        ; @IB_DEFAULT_QP1_QKEY
	.comm	_IB_SA_CLASS,4,2                ; @IB_SA_CLASS
.subsections_via_symbols
