	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_alloc_memfree
_mthca_alloc_memfree:                   ## @mthca_alloc_memfree
	.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	%rsi, %rbx
	movq	%rdi, %r14
	callq	_mthca_is_memfree
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	_MTHCA_DB_TYPE_RQ@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	32(%rbx), %edx
	leaq	8(%rbx), %rcx
	movq	%r14, %rdi
	callq	_mthca_alloc_db
	movq	%rax, (%rbx)
	testq	%rax, %rax
	js	LBB0_4
## %bb.2:
	movq	_MTHCA_DB_TYPE_SQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	32(%rbx), %edx
	leaq	24(%rbx), %rcx
	movq	%r14, %rdi
	callq	_mthca_alloc_db
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	jns	LBB0_5
## %bb.3:
	movl	(%r12), %esi
	movq	(%rbx), %rdx
	movq	%r14, %rdi
	callq	_mthca_free_db
LBB0_4:
	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	_MTHCA_DB_TYPE_RQ,4,2           ## @MTHCA_DB_TYPE_RQ
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MTHCA_DB_TYPE_SQ,4,2           ## @MTHCA_DB_TYPE_SQ
	.no_dead_strip	_mthca_alloc_memfree
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_alloc_memfree
_mthca_alloc_memfree:                   ; @mthca_alloc_memfree
	.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, x1
	mov	x19, x0
	bl	_mthca_is_memfree
	cbz	x0, LBB0_6
; %bb.1:
Lloh0:
	adrp	x21, _MTHCA_DB_TYPE_RQ@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MTHCA_DB_TYPE_RQ@GOTPAGEOFF]
	ldr	w1, [x21]
	ldr	w2, [x20, #32]
	add	x3, x20, #8
	mov	x0, x19
	bl	_mthca_alloc_db
	str	x0, [x20]
	tbnz	x0, #63, LBB0_4
; %bb.2:
Lloh2:
	adrp	x8, _MTHCA_DB_TYPE_SQ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MTHCA_DB_TYPE_SQ@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	w2, [x20, #32]
	add	x3, x20, #24
	mov	x0, x19
	bl	_mthca_alloc_db
	str	x0, [x20, #16]
	tbz	x0, #63, LBB0_5
; %bb.3:
	ldr	w1, [x21]
	ldr	x2, [x20]
	mov	x0, x19
	bl	_mthca_free_db
LBB0_4:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_DB_TYPE_RQ,4,2           ; @MTHCA_DB_TYPE_RQ
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MTHCA_DB_TYPE_SQ,4,2           ; @MTHCA_DB_TYPE_SQ
	.no_dead_strip	_mthca_alloc_memfree
.subsections_via_symbols
