	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_mad
_alloc_mad:                             ## @alloc_mad
	.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	%esi, %r14d
	movq	%rdi, %rbx
	movq	24(%rdi), %rdi
	addq	$4, %rdi
	callq	_spin_lock_irqsave
	movq	24(%rbx), %rdi
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	addq	$4, %rax
	movq	%rax, %rdi
	callq	_kref_get
	movq	24(%rbx), %rdi
	movq	8(%rdi), %rax
	movq	%rax, 8(%rbx)
	addq	$4, %rdi
	callq	_spin_unlock_irqrestore
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	leaq	-32(%rbp), %rsi
	callq	_rdma_query_ah
	testq	%rax, %rax
	js	LBB0_5
## %bb.2:
	leaq	-32(%rbp), %rdi
	callq	_rdma_is_valid_unicast_lid
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movq	8(%rbx), %rax
	movq	24(%rbx), %rcx
	movl	(%rcx), %edi
	movl	8(%rax), %edx
	movq	_IB_MGMT_SA_HDR@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_IB_MGMT_SA_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_IB_SA_QUERY_OPA@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	andq	(%rbx), %rax
	jne	LBB0_10
## %bb.4:
	movq	_IB_MGMT_BASE_VERSION@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_5:
	movq	8(%rbx), %rdi
	addq	$4, %rdi
	movq	_free_sm_ah@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kref_put
	jmp	LBB0_7
LBB0_6:
	addq	$4, %rdi
	callq	_spin_unlock_irqrestore
LBB0_7:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
LBB0_8:
	subl	(%rax), %r15d
LBB0_9:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_OPA_MGMT_BASE_VERSION@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
	xorl	%r15d, %r15d
	movl	$1, %esi
	xorl	%ecx, %ecx
	pushq	%rax
	pushq	%r14
	callq	_ib_create_send_mad
	addq	$16, %rsp
	movq	%rax, 16(%rbx)
	movq	%rax, %rdi
	callq	_IS_ERR
	movq	8(%rbx), %rdi
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	addq	$4, %rdi
	movq	_free_sm_ah@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kref_put
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_13:
	movl	(%rdi), %eax
	movq	16(%rbx), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_free_sm_ah,4,2                 ## @free_sm_ah
	.comm	_IB_MGMT_SA_HDR,4,2             ## @IB_MGMT_SA_HDR
	.comm	_IB_MGMT_SA_DATA,4,2            ## @IB_MGMT_SA_DATA
	.comm	_IB_SA_QUERY_OPA,8,3            ## @IB_SA_QUERY_OPA
	.comm	_OPA_MGMT_BASE_VERSION,4,2      ## @OPA_MGMT_BASE_VERSION
	.comm	_IB_MGMT_BASE_VERSION,4,2       ## @IB_MGMT_BASE_VERSION
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_alloc_mad
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_mad
_alloc_mad:                             ; @alloc_mad
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #24]
	add	x0, x8, #4
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #24]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_6
; %bb.1:
	add	x0, x9, #4
	bl	_kref_get
	ldr	x8, [x19, #24]
	ldr	x9, [x8, #8]
	str	x9, [x19, #8]
	add	x0, x8, #4
	bl	_spin_unlock_irqrestore
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	add	x1, sp, #8
	bl	_rdma_query_ah
	tbnz	x0, #63, LBB0_5
; %bb.2:
	add	x0, sp, #8
	bl	_rdma_is_valid_unicast_lid
	cbz	w0, LBB0_5
; %bb.3:
	ldr	x8, [x19, #24]
	ldr	w0, [x8]
	ldp	x9, x8, [x19]
	ldr	w2, [x8, #8]
Lloh0:
	adrp	x8, _IB_MGMT_SA_HDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_MGMT_SA_HDR@GOTPAGEOFF]
Lloh2:
	adrp	x10, _IB_MGMT_SA_DATA@GOTPAGE
Lloh3:
	ldr	x10, [x10, _IB_MGMT_SA_DATA@GOTPAGEOFF]
Lloh4:
	ldr	w4, [x8]
Lloh5:
	ldr	w5, [x10]
Lloh6:
	adrp	x8, _IB_SA_QUERY_OPA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IB_SA_QUERY_OPA@GOTPAGEOFF]
Lloh8:
	adrp	x10, _OPA_MGMT_BASE_VERSION@GOTPAGE
Lloh9:
	ldr	x10, [x10, _OPA_MGMT_BASE_VERSION@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x11, _IB_MGMT_BASE_VERSION@GOTPAGE
Lloh12:
	ldr	x11, [x11, _IB_MGMT_BASE_VERSION@GOTPAGEOFF]
	tst	x8, x9
	csel	x8, x11, x10, eq
	ldr	w7, [x8]
	mov	w1, #1
	mov	w3, #0
	mov	x6, x20
	bl	_ib_create_send_mad
	str	x0, [x19, #16]
	bl	_IS_ERR
	ldr	x8, [x19, #8]
	cbz	x0, LBB0_10
; %bb.4:
	add	x0, x8, #4
Lloh13:
	adrp	x8, _free_sm_ah@GOTPAGE
Lloh14:
	ldr	x8, [x8, _free_sm_ah@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_kref_put
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	ldr	x8, [x19, #8]
	add	x0, x8, #4
Lloh18:
	adrp	x8, _free_sm_ah@GOTPAGE
Lloh19:
	ldr	x8, [x8, _free_sm_ah@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_kref_put
	b	LBB0_7
LBB0_6:
	add	x0, x8, #4
	bl	_spin_unlock_irqrestore
LBB0_7:
Lloh21:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_10:
	ldr	w8, [x8]
	ldr	x9, [x19, #16]
	str	w8, [x9]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_free_sm_ah,4,2                 ; @free_sm_ah
	.comm	_IB_MGMT_SA_HDR,4,2             ; @IB_MGMT_SA_HDR
	.comm	_IB_MGMT_SA_DATA,4,2            ; @IB_MGMT_SA_DATA
	.comm	_IB_SA_QUERY_OPA,8,3            ; @IB_SA_QUERY_OPA
	.comm	_OPA_MGMT_BASE_VERSION,4,2      ; @OPA_MGMT_BASE_VERSION
	.comm	_IB_MGMT_BASE_VERSION,4,2       ; @IB_MGMT_BASE_VERSION
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_alloc_mad
.subsections_via_symbols
