	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ucma_get_device
_ucma_get_device:                       ## @ucma_get_device
	.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
	movq	_cma_dev_cnt@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_4
## %bb.1:
	movq	%rdi, %r14
	movq	_cma_dev_array@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rsi, (%rbx)
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	$24, %rbx
	decq	%rax
	jne	LBB0_2
LBB0_4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR                            ## TAILCALL
LBB0_5:
	movq	_mut@GOTPCREL(%rip), %rdi
	callq	_pthread_mutex_lock
	movq	%rbx, %rdi
	callq	_ucma_init_device
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	movl	20(%rbx), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 20(%rbx)
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movq	8(%rbx), %rax
	jmp	LBB0_8
LBB0_9:
	movl	16(%rbx), %edi
	callq	_ibv_alloc_pd
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_10
LBB0_8:
	movq	%rbx, 16(%r14)
	movl	16(%rbx), %ecx
	movl	%ecx, 8(%r14)
	movq	%rax, (%r14)
	xorl	%r15d, %r15d
LBB0_11:
	movq	_mut@GOTPCREL(%rip), %rdi
	callq	_pthread_mutex_unlock
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	decl	20(%rbx)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ERR
	movl	%eax, %r15d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_cma_dev_cnt,4,2                ## @cma_dev_cnt
	.comm	_cma_dev_array,8,3              ## @cma_dev_array
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_mut,4,2                        ## @mut
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_ucma_get_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ucma_get_device
_ucma_get_device:                       ; @ucma_get_device
	.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
Lloh0:
	adrp	x8, _cma_dev_cnt@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cma_dev_cnt@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x9, _cma_dev_array@GOTPAGE
Lloh4:
	ldr	x9, [x9, _cma_dev_array@GOTPAGEOFF]
Lloh5:
	ldr	x20, [x9]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x20]
	cmp	x9, x1
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x20, x20, #24
	subs	x8, x8, #1
	b.ne	LBB0_2
LBB0_4:
Lloh6:
	adrp	x8, _ENODEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	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
	b	_ERR
LBB0_5:
Lloh9:
	adrp	x0, _mut@GOTPAGE
Lloh10:
	ldr	x0, [x0, _mut@GOTPAGEOFF]
	bl	_pthread_mutex_lock
	mov	x0, x20
	bl	_ucma_init_device
	mov	x21, x0
	cbnz	w0, LBB0_10
; %bb.6:
	ldr	w8, [x20, #20]
	add	w9, w8, #1
	str	w9, [x20, #20]
	cbz	w8, LBB0_8
; %bb.7:
	ldr	x0, [x20, #8]
	b	LBB0_9
LBB0_8:
	ldr	w0, [x20, #16]
	bl	_ibv_alloc_pd
	str	x0, [x20, #8]
	cbz	x0, LBB0_11
LBB0_9:
	mov	w21, #0
	str	x20, [x19, #16]
	ldr	w8, [x20, #16]
	str	w8, [x19, #8]
	str	x0, [x19]
LBB0_10:
Lloh11:
	adrp	x0, _mut@GOTPAGE
Lloh12:
	ldr	x0, [x0, _mut@GOTPAGEOFF]
	bl	_pthread_mutex_unlock
	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
LBB0_11:
	ldr	w8, [x20, #20]
	sub	w8, w8, #1
	str	w8, [x20, #20]
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_ERR
	mov	x21, x0
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_cma_dev_cnt,4,2                ; @cma_dev_cnt
	.comm	_cma_dev_array,8,3              ; @cma_dev_array
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_mut,4,2                        ; @mut
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_ucma_get_device
.subsections_via_symbols
