	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%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)
	cmpl	$2, %edi
	jl	LBB0_1
## %bb.2:
	movq	8(%rsi), %r14
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %r14
LBB0_3:
	leaq	-56(%rbp), %rdx
	xorl	%edi, %edi
	xorl	%esi, %esi
	movl	$2, %ecx
	callq	_mad_rpc_open_port
	movq	_srcport@GOTPCREL(%rip), %r12
	movl	%eax, (%r12)
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_err
LBB0_5:
	leaq	-72(%rbp), %rdx
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_resolve_sm_portid
	movl	$1, -72(%rbp)
	cmpq	$0, -64(%rbp)
	jne	LBB0_7
## %bb.6:
	movq	_IB_DEFAULT_QP1_QKEY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
LBB0_7:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_umad_size
                                        ## kill: def $eax killed $eax def $rax
	leal	256(%rax), %esi
	movl	$1, %edi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, %rbx
	movl	(%r12), %edi
	callq	_mad_rpc_portid
	movl	%eax, %r12d
	movq	_IB_SA_CLASS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edi
	movl	$2, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_umad_register
	movl	%eax, %r13d
	movq	_TMO@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	-72(%rbp), %rcx
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	%r13d, %edx
	callq	_rereg_and_test_port
	movq	%rbx, %rdi
	callq	_umad_get_mad
	movq	%rbx, %rdi
	callq	_free
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_umad_unregister
	movl	%r12d, %edi
	callq	_umad_close_port
	xorl	%eax, %eax
	callq	_umad_done
	jmp	LBB0_10
LBB0_8:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_err
	movl	$-1, %r15d
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"port_guids.list"

	.comm	_IB_SMI_CLASS,4,2               ## @IB_SMI_CLASS
	.comm	_IB_SMI_DIRECT_CLASS,4,2        ## @IB_SMI_DIRECT_CLASS
	.comm	_srcport,4,2                    ## @srcport
L_.str.1:                               ## @.str.1
	.asciz	"Failed to open port"

	.comm	_IB_DEFAULT_QP1_QKEY,8,3        ## @IB_DEFAULT_QP1_QKEY
L_.str.2:                               ## @.str.2
	.asciz	"cannot alloc mem for umad: %s\n"

	.comm	_errno,4,2                      ## @errno
	.comm	_IB_SA_CLASS,4,2                ## @IB_SA_CLASS
	.comm	_TMO,4,2                        ## @TMO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
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, [sp, #32]
	cmp	w0, #2
	b.lt	LBB0_2
; %bb.1:
	ldr	x19, [x1, #8]
	b	LBB0_3
LBB0_2:
Lloh9:
	adrp	x19, l_.str@PAGE
Lloh10:
	add	x19, x19, l_.str@PAGEOFF
LBB0_3:
	add	x2, sp, #32
	mov	x0, #0
	mov	w1, #0
	mov	w3, #2
	bl	_mad_rpc_open_port
Lloh11:
	adrp	x21, _srcport@GOTPAGE
Lloh12:
	ldr	x21, [x21, _srcport@GOTPAGEOFF]
	str	w0, [x21]
	cbnz	w0, LBB0_5
; %bb.4:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_err
LBB0_5:
	add	x2, sp, #16
	mov	x0, #0
	mov	w1, #0
	bl	_resolve_sm_portid
	mov	w8, #1
	str	w8, [sp, #16]
	ldr	x8, [sp, #24]
	cbnz	x8, LBB0_7
; %bb.6:
Lloh15:
	adrp	x8, _IB_DEFAULT_QP1_QKEY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IB_DEFAULT_QP1_QKEY@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	str	x8, [sp, #24]
LBB0_7:
	bl	_umad_size
	add	w1, w0, #256
	mov	w0, #1
	bl	_calloc
	cbz	x0, LBB0_9
; %bb.8:
	mov	x20, x0
	ldr	w0, [x21]
	bl	_mad_rpc_portid
	mov	x21, x0
Lloh18:
	adrp	x8, _IB_SA_CLASS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IB_SA_CLASS@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	w2, #2
	mov	w3, #0
	mov	x4, #0
	bl	_umad_register
	mov	x22, x0
Lloh21:
	adrp	x8, _TMO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _TMO@GOTPAGEOFF]
Lloh23:
	ldr	w4, [x8]
	add	x3, sp, #16
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_rereg_and_test_port
	mov	x0, x20
	bl	_umad_get_mad
	mov	x0, x20
	bl	_free
	mov	x0, x21
	mov	x1, x22
	bl	_umad_unregister
	mov	x0, x21
	bl	_umad_close_port
	bl	_umad_done
	mov	w0, #0
	b	LBB0_10
LBB0_9:
Lloh24:
	adrp	x8, _errno@GOTPAGE
Lloh25:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh27:
	adrp	x0, l_.str.2@PAGE
Lloh28:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_err
	mov	w0, #-1
LBB0_10:
	ldr	x8, [sp, #40]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	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
	add	sp, sp, #96
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"port_guids.list"

	.comm	_IB_SMI_CLASS,4,2               ; @IB_SMI_CLASS
	.comm	_IB_SMI_DIRECT_CLASS,4,2        ; @IB_SMI_DIRECT_CLASS
	.comm	_srcport,4,2                    ; @srcport
l_.str.1:                               ; @.str.1
	.asciz	"Failed to open port"

	.comm	_IB_DEFAULT_QP1_QKEY,8,3        ; @IB_DEFAULT_QP1_QKEY
l_.str.2:                               ; @.str.2
	.asciz	"cannot alloc mem for umad: %s\n"

	.comm	_errno,4,2                      ; @errno
	.comm	_IB_SA_CLASS,4,2                ; @IB_SA_CLASS
	.comm	_TMO,4,2                        ; @TMO
.subsections_via_symbols
