	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mad_rpc_open_port              ## -- Begin function mad_rpc_open_port
	.p2align	4, 0x90
_mad_rpc_open_port:                     ## @mad_rpc_open_port
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movq	_MAX_CLASS@GOTPCREL(%rip), %rax
	cmpl	%ecx, (%rax)
	jle	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movl	%esi, %r13d
	movq	%rdi, %r15
	xorl	%eax, %eax
	callq	_umad_init
	testq	%rax, %rax
	js	LBB0_3
## %bb.5:
	movl	$24, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r12
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_umad_open_port
	testl	%eax, %eax
	js	LBB0_8
## %bb.10:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, (%r12)
	testq	%r15, %r15
	je	LBB0_12
## %bb.11:
	movl	16(%r12), %edi
	movq	%r15, %rsi
	movl	$3, %edx
	callq	_strncpy
LBB0_12:
	movl	%r13d, 4(%r12)
	movq	8(%r12), %rdi
	movl	$255, %esi
	movl	$8, %edx
	callq	_memset
	movl	%ebx, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%ebx, %r15d
	je	LBB0_22
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	(%r14,%rbx,4), %r13d
	testl	%r13d, %r13d
	js	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	_MAX_CLASS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jge	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	xorl	%esi, %esi
	movq	_IB_SA_CLASS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	sete	%sil
	movl	%r13d, %edi
	movq	%r12, %rdx
	callq	_mad_register_client_via
	incq	%rbx
	testq	%rax, %rax
	jns	LBB0_13
LBB0_17:
	leaq	L_.str.3(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_IBWARN
	movq	_errno@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_19
## %bb.18:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
LBB0_19:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_umad_close_port
	jmp	LBB0_20
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_IBWARN
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_IBWARN
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_4:
	movq	(%rax), %rax
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	jmp	LBB0_22
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	jmp	LBB0_21
LBB0_8:
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_IBWARN
	movq	_errno@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_20
## %bb.9:
	movq	_EIO@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
LBB0_20:
	movq	%r12, %rdi
	callq	_free
LBB0_21:
	xorl	%r12d, %r12d
LBB0_22:
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_CLASS,4,2                  ## @MAX_CLASS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"too many classes %d requested"

	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_errno,8,3                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"can't init UMAD library"

	.comm	_ENODEV,8,3                     ## @ENODEV
	.comm	_ENOMEM,8,3                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"can't open UMAD port (%s:%d)"

	.comm	_EIO,8,3                        ## @EIO
	.comm	_IB_SA_CLASS,4,2                ## @IB_SA_CLASS
L_.str.3:                               ## @.str.3
	.asciz	"client_register for mgmt %d failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mad_rpc_open_port              ; -- Begin function mad_rpc_open_port
	.p2align	2
_mad_rpc_open_port:                     ; @mad_rpc_open_port
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x20, x3
Lloh0:
	adrp	x25, _MAX_CLASS@GOTPAGE
Lloh1:
	ldr	x25, [x25, _MAX_CLASS@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, w3
	b.le	LBB0_14
; %bb.1:
	mov	x21, x2
	mov	x23, x1
	mov	x24, x0
	bl	_umad_init
	tbnz	x0, #63, LBB0_15
; %bb.2:
	mov	w0, #24
	bl	_malloc
	mov	x19, x0
	cbz	x0, LBB0_16
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	mov	x0, x24
	mov	x1, x23
	bl	_umad_open_port
	tbnz	w0, #31, LBB0_19
; %bb.4:
	mov	x22, x0
	str	w0, [x19]
	cbz	x24, LBB0_6
; %bb.5:
	ldr	w0, [x19, #16]
	mov	x1, x24
	mov	w2, #3
	bl	_strncpy
LBB0_6:
	str	w23, [x19, #4]
	ldr	x0, [x19, #8]
	mov	w1, #255
	mov	w2, #8
	bl	_memset
Lloh2:
	adrp	x24, _IB_SA_CLASS@GOTPAGE
Lloh3:
	ldr	x24, [x24, _IB_SA_CLASS@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	cbz	w20, LBB0_18
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w23, [x21]
	tbnz	w23, #31, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x25]
	cmp	w23, w8
	b.ge	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x24]
	cmp	w23, w8
	cset	w1, eq
	add	x21, x21, #4
	mov	x0, x23
	mov	x2, x19
	bl	_mad_register_client_via
	sub	w20, w20, #1
	tbz	x0, #63, LBB0_7
LBB0_11:
	str	x23, [sp]
Lloh4:
	adrp	x0, l_.str.3@PAGE
Lloh5:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_IBWARN
Lloh6:
	adrp	x8, _errno@GOTPAGE
Lloh7:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
	ldr	x9, [x8]
	cbnz	x9, LBB0_13
; %bb.12:
Lloh8:
	adrp	x9, _EINVAL@GOTPAGE
Lloh9:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	str	x9, [x8]
LBB0_13:
	mov	x0, x22
	bl	_umad_close_port
	b	LBB0_21
LBB0_14:
	str	x20, [sp]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IBWARN
	mov	x19, #0
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_17
LBB0_15:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IBWARN
	mov	x19, #0
Lloh17:
	adrp	x8, _ENODEV@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_17
LBB0_16:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_17:
	ldr	x8, [x8]
Lloh21:
	adrp	x9, _errno@GOTPAGE
Lloh22:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh23:
	str	x8, [x9]
LBB0_18:
	mov	x0, x19
	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
	add	sp, sp, #96
	ret
LBB0_19:
	stp	x24, x23, [sp]
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IBWARN
Lloh26:
	adrp	x8, _errno@GOTPAGE
Lloh27:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
	ldr	x9, [x8]
	cbnz	x9, LBB0_21
; %bb.20:
Lloh28:
	adrp	x9, _EIO@GOTPAGE
Lloh29:
	ldr	x9, [x9, _EIO@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	str	x9, [x8]
LBB0_21:
	mov	x0, x19
	bl	_free
	mov	x19, #0
	b	LBB0_18
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_CLASS,4,2                  ; @MAX_CLASS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"too many classes %d requested"

	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_errno,8,3                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"can't init UMAD library"

	.comm	_ENODEV,8,3                     ; @ENODEV
	.comm	_ENOMEM,8,3                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"can't open UMAD port (%s:%d)"

	.comm	_EIO,8,3                        ; @EIO
	.comm	_IB_SA_CLASS,4,2                ; @IB_SA_CLASS
l_.str.3:                               ; @.str.3
	.asciz	"client_register for mgmt %d failed"

.subsections_via_symbols
