	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_pd_alloc                 ## -- Begin function mthca_pd_alloc
	.p2align	4, 0x90
_mthca_pd_alloc:                        ## @mthca_pd_alloc
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r12d
	movq	%rdi, %r14
	movl	%esi, (%rdx)
	leaq	12(%rdx), %rdi
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_atomic_set
	movq	%r14, %rdi
	callq	_mthca_alloc
	movl	%eax, 4(%rbx)
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	testl	%r12d, %r12d
	je	LBB0_5
## %bb.3:
	movq	_MTHCA_MPT_FLAG_LOCAL_READ@GOTPCREL(%rip), %rcx
	movq	_MTHCA_MPT_FLAG_LOCAL_WRITE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	leaq	8(%rbx), %rcx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mthca_mr_alloc_notrans
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r12d
	movl	4(%rbx), %esi
	movq	%r14, %rdi
	callq	_mthca_free
	movl	%r12d, %r15d
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_5:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MTHCA_MPT_FLAG_LOCAL_READ,4,2  ## @MTHCA_MPT_FLAG_LOCAL_READ
	.comm	_MTHCA_MPT_FLAG_LOCAL_WRITE,4,2 ## @MTHCA_MPT_FLAG_LOCAL_WRITE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_pd_alloc                 ; -- Begin function mthca_pd_alloc
	.p2align	2
_mthca_pd_alloc:                        ; @mthca_pd_alloc
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	str	w1, [x2]
	add	x0, x2, #12
	mov	w1, #0
	bl	_atomic_set
	mov	x0, x19
	bl	_mthca_alloc
	str	w0, [x20, #4]
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.1:
	cbz	w21, LBB0_5
; %bb.2:
	mov	x1, x0
Lloh0:
	adrp	x8, _MTHCA_MPT_FLAG_LOCAL_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTHCA_MPT_FLAG_LOCAL_READ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _MTHCA_MPT_FLAG_LOCAL_WRITE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MTHCA_MPT_FLAG_LOCAL_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w2, w9, w8
	add	x3, x20, #8
	mov	x0, x19
	bl	_mthca_mr_alloc_notrans
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.3:
	ldr	w1, [x20, #4]
	mov	x0, x19
	bl	_mthca_free
	b	LBB0_5
LBB0_4:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_5:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MTHCA_MPT_FLAG_LOCAL_READ,4,2  ; @MTHCA_MPT_FLAG_LOCAL_READ
	.comm	_MTHCA_MPT_FLAG_LOCAL_WRITE,4,2 ; @MTHCA_MPT_FLAG_LOCAL_WRITE
.subsections_via_symbols
