	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mad_rpc                        ## -- Begin function mad_rpc
	.p2align	4, 0x90
_mad_rpc:                               ## @mad_rpc
	.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
	movl	$8248, %eax                     ## imm = 0x2038
	callq	____chkstk_darwin
	subq	%rax, %rsp
	popq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$0, -8244(%rbp)
	movq	_IB_MAD_RPC_VERSION_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rsi), %eax
	movq	%r8, -8272(%rbp)                ## 8-byte Spill
	movq	%rcx, -8288(%rbp)               ## 8-byte Spill
	movq	%rdx, %r13
	movq	%rdi, -8280(%rbp)               ## 8-byte Spill
	movq	_IB_MAD_RPC_VERSION1@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.1:
	movl	$0, (%r15)
LBB0_2:
	leaq	-4144(%rbp), %rbx
	movq	%r13, -8264(%rbp)               ## 8-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_umad_size
	movq	_IB_MAD_SIZE@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movq	%rax, %rdx
	callq	_memset
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	movq	-8288(%rbp), %r8                ## 8-byte Reload
	callq	_mad_build_pkt
	testl	%eax, %eax
	js	LBB0_19
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %r12d
	movq	-8280(%rbp), %r14               ## 8-byte Reload
	movl	8(%r14), %eax
	movl	%eax, -8256(%rbp)               ## 4-byte Spill
	movq	(%r14), %rax
	movzbl	(%r15), %ecx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, -8252(%rbp)               ## 4-byte Spill
	movq	%r15, %r13
	movl	16(%r15), %esi
	movq	%r14, %rdi
	callq	_mad_get_timeout
	movl	%eax, -8248(%rbp)               ## 4-byte Spill
	movq	%r14, %rdi
	callq	_mad_get_retries
                                        ## kill: def $eax killed $eax def $rax
	movl	-8256(%rbp), %edi               ## 4-byte Reload
	movq	%rbx, %r15
	movq	%rbx, %rsi
	leaq	-8240(%rbp), %r14
	movq	%r14, %rdx
	movl	-8252(%rbp), %ecx               ## 4-byte Reload
	movl	%r12d, %r8d
	movl	-8248(%rbp), %r9d               ## 4-byte Reload
	leaq	-8244(%rbp), %rbx
	pushq	%rbx
	pushq	%rax
	callq	__do_madrpc
	addq	$16, %rsp
	testl	%eax, %eax
	js	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_umad_get_mad
	movq	%rax, %r12
	movq	_IB_DRSMP_STATUS_F@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_mad_get_field
	movl	%eax, %r14d
	movq	_IB_MAD_STS_REDIRECT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	movq	%r13, %rax
	movq	-8264(%rbp), %r13               ## 8-byte Reload
	movq	%r15, %rbx
	movq	%rax, %r15
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_redirect_port
	testq	%rax, %rax
	je	LBB0_3
LBB0_7:
	movq	_IB_MAD_RPC_VERSION_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r15), %eax
	movq	_IB_MAD_RPC_VERSION1@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_9
## %bb.8:
	movl	-8244(%rbp), %eax
	movl	%eax, (%r15)
LBB0_9:
	movl	%r14d, 4(%r15)
	testl	%r14d, %r14d
	je	LBB0_15
## %bb.10:
	movq	%r13, %rdi
	callq	_portid2str
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_ERRS
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_19:
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_12:
	movq	_IB_MAD_RPC_VERSION_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r13), %eax
	movq	_IB_MAD_RPC_VERSION1@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_14
## %bb.13:
	movl	-8244(%rbp), %eax
	movl	%eax, (%r13)
LBB0_14:
	movq	-8264(%rbp), %rdi               ## 8-byte Reload
	callq	_portid2str
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_IBWARN
	jmp	LBB0_20
LBB0_15:
	movq	_ibdebug@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_17
## %bb.16:
	movl	8(%r15), %esi
	movl	12(%r15), %edx
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_IBWARN
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movslq	8(%r15), %rax
	leaq	(%r12,%rax,4), %rdx
	movl	12(%r15), %ecx
	leaq	L_.str.3(%rip), %rsi
	callq	_xdump
LBB0_17:
	movq	-8272(%rbp), %rbx               ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_19
## %bb.18:
	movslq	8(%r15), %rax
	leaq	(%r12,%rax,4), %rsi
	movl	12(%r15), %edx
	movq	%rbx, %rdi
	callq	_memcpy
LBB0_20:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_22
## %bb.21:
	movq	%rbx, %rax
	addq	$8248, %rsp                     ## imm = 0x2038
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_MAD_RPC_VERSION_MASK,4,2    ## @IB_MAD_RPC_VERSION_MASK
	.comm	_IB_MAD_RPC_VERSION1,4,2        ## @IB_MAD_RPC_VERSION1
	.comm	_IB_MAD_SIZE,8,3                ## @IB_MAD_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"_do_madrpc failed; dport (%s)"

	.comm	_IB_DRSMP_STATUS_F,4,2          ## @IB_DRSMP_STATUS_F
	.comm	_IB_MAD_STS_REDIRECT,4,2        ## @IB_MAD_STS_REDIRECT
L_.str.1:                               ## @.str.1
	.asciz	"MAD completed with error status 0x%x; dport (%s)"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_errno,4,2                      ## @errno
	.comm	_ibdebug,8,3                    ## @ibdebug
L_.str.2:                               ## @.str.2
	.asciz	"data offs %d sz %d"

	.comm	_stderr,4,2                     ## @stderr
L_.str.3:                               ## @.str.3
	.asciz	"mad data\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mad_rpc                        ; -- Begin function mad_rpc
	.p2align	2
_mad_rpc:                               ; @mad_rpc
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	w9, #8240
Lloh0:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh1:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	sub	sp, sp, #2, lsl #12             ; =8192
	sub	sp, sp, #48
	str	x4, [sp, #16]                   ; 8-byte Folded Spill
	mov	x22, x3
	mov	x21, x2
	mov	x20, x1
	mov	x23, x0
Lloh2:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh3:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
	str	wzr, [sp, #28]
	ldr	w8, [x1]
Lloh5:
	adrp	x9, _IB_MAD_RPC_VERSION_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IB_MAD_RPC_VERSION_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh8:
	adrp	x9, _IB_MAD_RPC_VERSION1@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IB_MAD_RPC_VERSION1@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	str	wzr, [x20]
LBB0_2:
Lloh11:
	adrp	x28, _IB_MAD_SIZE@GOTPAGE
Lloh12:
	ldr	x28, [x28, _IB_MAD_SIZE@GOTPAGEOFF]
Lloh13:
	adrp	x19, _IB_MAD_STS_REDIRECT@GOTPAGE
Lloh14:
	ldr	x19, [x19, _IB_MAD_STS_REDIRECT@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	bl	_umad_size
	ldr	x8, [x28]
	add	x2, x8, x0
	add	x0, sp, #1, lsl #12             ; =4096
	add	x0, x0, #32
	mov	w1, #0
	bl	_memset
	add	x0, sp, #1, lsl #12             ; =4096
	add	x0, x0, #32
	mov	x1, x20
	mov	x2, x21
	mov	w3, #0
	mov	x4, x22
	bl	_mad_build_pkt
	tbnz	w0, #31, LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x24, x0
	ldr	w25, [x23, #8]
	ldr	x8, [x23]
	ldrb	w9, [x20]
	ldr	w26, [x8, x9, lsl #2]
	ldr	w1, [x20, #16]
	mov	x0, x23
	bl	_mad_get_timeout
	mov	x27, x0
	mov	x0, x23
	bl	_mad_get_retries
	mov	x6, x0
	add	x1, sp, #1, lsl #12             ; =4096
	add	x1, x1, #32
	add	x2, sp, #32
	add	x7, sp, #28
	mov	x0, x25
	mov	x3, x26
	mov	x4, x24
	mov	x5, x27
	bl	__do_madrpc
	tbnz	w0, #31, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x0, sp, #32
	bl	_umad_get_mad
	mov	x24, x0
Lloh15:
	adrp	x8, _IB_DRSMP_STATUS_F@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IB_DRSMP_STATUS_F@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_mad_get_field
	mov	x25, x0
	ldr	w8, [x19]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	mov	x1, x24
	bl	_redirect_port
	cbz	x0, LBB0_3
LBB0_7:
	ldr	w8, [x20]
Lloh18:
	adrp	x9, _IB_MAD_RPC_VERSION_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _IB_MAD_RPC_VERSION_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh21:
	adrp	x9, _IB_MAD_RPC_VERSION1@GOTPAGE
Lloh22:
	ldr	x9, [x9, _IB_MAD_RPC_VERSION1@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.8:
	ldr	w8, [sp, #28]
	str	w8, [x20]
LBB0_9:
	str	w25, [x20, #4]
	cbz	w25, LBB0_15
; %bb.10:
	mov	x0, x21
	bl	_portid2str
	mov	x2, x0
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x25
	bl	_ERRS
	mov	x19, #0
Lloh26:
	adrp	x8, _EIO@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
Lloh29:
	adrp	x9, _errno@GOTPAGE
Lloh30:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh31:
	str	w8, [x9]
	b	LBB0_19
LBB0_11:
	mov	x19, #0
	b	LBB0_19
LBB0_12:
	ldr	w8, [x20]
Lloh32:
	adrp	x9, _IB_MAD_RPC_VERSION_MASK@GOTPAGE
Lloh33:
	ldr	x9, [x9, _IB_MAD_RPC_VERSION_MASK@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh35:
	adrp	x9, _IB_MAD_RPC_VERSION1@GOTPAGE
Lloh36:
	ldr	x9, [x9, _IB_MAD_RPC_VERSION1@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_14
; %bb.13:
	ldr	w8, [sp, #28]
	str	w8, [x20]
LBB0_14:
	mov	x0, x21
	bl	_portid2str
	mov	x1, x0
Lloh38:
	adrp	x0, l_.str@PAGE
Lloh39:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IBWARN
	mov	x19, #0
	b	LBB0_19
LBB0_15:
Lloh40:
	adrp	x8, _ibdebug@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ibdebug@GOTPAGEOFF]
Lloh42:
	ldr	x8, [x8]
	cbz	x8, LBB0_17
; %bb.16:
	ldp	w1, w8, [x20, #8]
	str	x8, [sp]
Lloh43:
	adrp	x0, l_.str.2@PAGE
Lloh44:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IBWARN
Lloh45:
	adrp	x8, _stderr@GOTPAGE
Lloh46:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh47:
	ldr	w0, [x8]
	ldp	w8, w3, [x20, #8]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	x2, x24, x8, lsl #2
Lloh48:
	adrp	x1, l_.str.3@PAGE
Lloh49:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_xdump
LBB0_17:
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
	cbz	x19, LBB0_19
; %bb.18:
	ldp	w8, w2, [x20, #8]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	x1, x24, x8, lsl #2
	mov	x0, x19
	bl	_memcpy
LBB0_19:
	ldur	x8, [x29, #-96]
Lloh50:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh51:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh52:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.20:
	mov	x0, x19
	add	sp, sp, #2, lsl #12             ; =8192
	add	sp, sp, #48
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotStr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_MAD_RPC_VERSION_MASK,4,2    ; @IB_MAD_RPC_VERSION_MASK
	.comm	_IB_MAD_RPC_VERSION1,4,2        ; @IB_MAD_RPC_VERSION1
	.comm	_IB_MAD_SIZE,8,3                ; @IB_MAD_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"_do_madrpc failed; dport (%s)"

	.comm	_IB_DRSMP_STATUS_F,4,2          ; @IB_DRSMP_STATUS_F
	.comm	_IB_MAD_STS_REDIRECT,4,2        ; @IB_MAD_STS_REDIRECT
l_.str.1:                               ; @.str.1
	.asciz	"MAD completed with error status 0x%x; dport (%s)"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_errno,4,2                      ; @errno
	.comm	_ibdebug,8,3                    ; @ibdebug
l_.str.2:                               ; @.str.2
	.asciz	"data offs %d sz %d"

	.comm	_stderr,4,2                     ; @stderr
l_.str.3:                               ; @.str.3
	.asciz	"mad data\n"

.subsections_via_symbols
