	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_umad_open_port                 ## -- Begin function umad_open_port
	.p2align	4, 0x90
_umad_open_port:                        ## @umad_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	%esi, -52(%rbp)
	movq	_UMAD_DEV_FILE_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r12, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_TRACE
	leaq	-52(%rbp), %rsi
	movq	%r15, %rdi
	callq	_resolve_ca_name
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %rbx
	movl	-52(%rbp), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%r13d, %r13d
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_DEBUG
	movl	-52(%rbp), %esi
	movq	%rbx, %rdi
	callq	_dev_to_umad_id
	testl	%eax, %eax
	js	LBB0_7
## %bb.2:
	movl	%eax, %r15d
	movq	_UMAD_DEV_DIR@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	%r15d, %r8d
	callq	_snprintf
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%r14, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_8
## %bb.3:
	movl	%eax, %r13d
	movq	_abi_version@GOTPCREL(%rip), %rax
	movl	$1, %ecx
	cmpl	$5, (%rax)
	jg	LBB0_5
## %bb.4:
	movq	_IB_USER_MAD_ENABLE_PKEY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	xorl	%edx, %edx
	callq	_ioctl
	xorl	%ecx, %ecx
	testl	%eax, %eax
	sete	%cl
LBB0_5:
	movq	_new_user_mad_api@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	leaq	L_.str.4(%rip), %rdi
	movq	%r14, %rsi
	movl	%r13d, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_DEBUG
	jmp	LBB0_10
LBB0_6:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	jmp	LBB0_9
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.3(%rip), %rdi
	xorl	%r13d, %r13d
	movq	%r14, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_DEBUG
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_9:
	subl	(%rax), %r13d
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%r13d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_UMAD_DEV_FILE_SZ,4,2           ## @UMAD_DEV_FILE_SZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ca %s port %d"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"opening %s port %d"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"%s/umad%d"

	.comm	_UMAD_DEV_DIR,8,3               ## @UMAD_DEV_DIR
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
L_.str.3:                               ## @.str.3
	.asciz	"open %s failed: %s"

	.comm	_errno,4,2                      ## @errno
	.comm	_EIO,4,2                        ## @EIO
	.comm	_abi_version,4,2                ## @abi_version
	.comm	_IB_USER_MAD_ENABLE_PKEY,4,2    ## @IB_USER_MAD_ENABLE_PKEY
	.comm	_new_user_mad_api,4,2           ## @new_user_mad_api
L_.str.4:                               ## @.str.4
	.asciz	"opened %s fd %d portid %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_umad_open_port                 ; -- Begin function umad_open_port
	.p2align	2
_umad_open_port:                        ; @umad_open_port
	.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
	sub	sp, sp, #16
	mov	x2, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	stur	w1, [x29, #-44]
Lloh3:
	adrp	x8, _UMAD_DEV_FILE_SZ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UMAD_DEV_FILE_SZ@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	mov	x9, x21
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x21, #15
	and	x9, x9, #0x1fffffff0
	sub	x19, x8, x9
	mov	sp, x19
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_TRACE
	sub	x1, x29, #44
	mov	x0, x20
	bl	_resolve_ca_name
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	ldur	w2, [x29, #-44]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_DEBUG
	ldur	w1, [x29, #-44]
	mov	x0, x20
	bl	_dev_to_umad_id
	tbnz	w0, #31, LBB0_6
; %bb.2:
	mov	x20, x0
Lloh12:
	adrp	x8, _UMAD_DEV_DIR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _UMAD_DEV_DIR@GOTPAGEOFF]
Lloh14:
	ldr	x3, [x8]
Lloh15:
	adrp	x2, l_.str.2@PAGE
Lloh16:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	mov	x4, x20
	bl	_snprintf
Lloh17:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh21:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_open
	tbnz	w0, #31, LBB0_7
; %bb.3:
	mov	x21, x0
Lloh23:
	adrp	x8, _abi_version@GOTPAGE
Lloh24:
	ldr	x8, [x8, _abi_version@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	cmp	w8, #5
	b.le	LBB0_9
; %bb.4:
	mov	w8, #1
	b	LBB0_10
LBB0_5:
Lloh26:
	adrp	x8, _ENODEV@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
Lloh28:
	adrp	x8, _EINVAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh30:
	adrp	x8, _errno@GOTPAGE
Lloh31:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	bl	_strerror
	mov	x2, x0
Lloh33:
	adrp	x0, l_.str.3@PAGE
Lloh34:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_DEBUG
Lloh35:
	adrp	x8, _EIO@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_9:
Lloh37:
	adrp	x8, _IB_USER_MAD_ENABLE_PKEY@GOTPAGE
Lloh38:
	ldr	x8, [x8, _IB_USER_MAD_ENABLE_PKEY@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, #0
	bl	_ioctl
	cmp	w0, #0
	cset	w8, eq
LBB0_10:
Lloh40:
	adrp	x9, _new_user_mad_api@GOTPAGE
Lloh41:
	ldr	x9, [x9, _new_user_mad_api@GOTPAGEOFF]
Lloh42:
	str	w8, [x9]
	str	x20, [sp, #-16]!
Lloh43:
	adrp	x0, l_.str.4@PAGE
Lloh44:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x19
	mov	x2, x21
	bl	_DEBUG
	add	sp, sp, #16
LBB0_11:
	ldur	x8, [x29, #-40]
Lloh45:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh46:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh47:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x21
	sub	sp, x29, #32
	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
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotStr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_UMAD_DEV_FILE_SZ,4,2           ; @UMAD_DEV_FILE_SZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ca %s port %d"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"opening %s port %d"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"%s/umad%d"

	.comm	_UMAD_DEV_DIR,8,3               ; @UMAD_DEV_DIR
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
l_.str.3:                               ; @.str.3
	.asciz	"open %s failed: %s"

	.comm	_errno,4,2                      ; @errno
	.comm	_EIO,4,2                        ; @EIO
	.comm	_abi_version,4,2                ; @abi_version
	.comm	_IB_USER_MAD_ENABLE_PKEY,4,2    ; @IB_USER_MAD_ENABLE_PKEY
	.comm	_new_user_mad_api,4,2           ; @new_user_mad_api
l_.str.4:                               ; @.str.4
	.asciz	"opened %s fd %d portid %d"

.subsections_via_symbols
