	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ib_uverbs_open_xrcd
_ib_uverbs_open_xrcd:                   ## @ib_uverbs_open_xrcd
	.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
	subq	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %r14
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -112(%rbp)
	movq	$0, -96(%rbp)
	leaq	-88(%rbp), %rsi
	movl	$8, %edx
	callq	_uverbs_request
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_31
## %bb.1:
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	-88(%rbp), %esi
	cmpl	$-1, %esi
	je	LBB0_2
## %bb.5:
	leaq	-112(%rbp), %rdi
	callq	_fdget
	movq	-112(%rbp), %r15
	testq	%r15, %r15
	je	LBB0_6
## %bb.7:
	movq	%r15, %rdi
	callq	_file_inode
	movq	%r14, %rdi
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, %rsi
	callq	_find_xrcd
	movq	%rax, %r13
	movl	-84(%rbp), %eax
	testq	%r13, %r13
	je	LBB0_8
## %bb.10:
	movq	_O_EXCL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_29
LBB0_2:
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
LBB0_3:
	movq	_UVERBS_OBJECT_XRCD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-80(%rbp), %rdx
	movq	%rbx, %rsi
	callq	_uobj_alloc
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_12
## %bb.4:
	movq	%r12, %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	jne	LBB0_29
	jmp	LBB0_30
LBB0_6:
	movq	_EBADF@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_30
LBB0_12:
	movq	%r13, %rax
	testq	%r13, %r13
	je	LBB0_13
LBB0_16:
	movq	%r13, -128(%rbp)                ## 8-byte Spill
	movq	%r12, %rdi
	addq	$20, %rdi
	xorl	%esi, %esi
	movq	%r12, %r13
	movq	%rax, %r12
	callq	_atomic_set
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, 8(%r13)
	movq	%r13, %r12
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movl	(%r13), %eax
	movl	%eax, -56(%rbp)
	cmpq	$0, -64(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_32
## %bb.17:
	movq	-128(%rbp), %r13                ## 8-byte Reload
	testq	%r13, %r13
	je	LBB0_18
LBB0_19:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	16(%rax), %rdi
	movq	%rdi, -120(%rbp)                ## 8-byte Spill
	callq	_atomic_inc
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_uverbs_response
	testl	%eax, %eax
	je	LBB0_20
## %bb.23:
	movl	%eax, %r15d
	testq	%r13, %r13
	jne	LBB0_25
## %bb.24:
	movq	%r14, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_xrcd_table_delete
LBB0_25:
	movq	-120(%rbp), %rdi                ## 8-byte Reload
	callq	_atomic_dec
	jmp	LBB0_26
LBB0_8:
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	xorl	%r13d, %r13d
	testl	%eax, (%rcx)
	jne	LBB0_3
## %bb.9:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movl	%r13d, %r15d
	jmp	LBB0_29
LBB0_13:
	movq	-80(%rbp), %rdi
	movq	%rbx, %rsi
	callq	*(%rdi)
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_PTR_ERR
	movl	%eax, %r15d
	jmp	LBB0_27
LBB0_32:
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_uverbs_response
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_26
LBB0_20:
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_22
## %bb.21:
	movq	-96(%rbp), %rax
	movq	%rax, 16(%rsp)
	movaps	-112(%rbp), %xmm0
	movups	%xmm0, (%rsp)
	callq	_fdput
LBB0_22:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_uobj_alloc_commit
	movl	%eax, %r15d
	jmp	LBB0_31
LBB0_18:
	movq	%r14, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_xrcd_table_insert
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_19
LBB0_26:
	movq	%rbx, %rdi
	callq	_uverbs_get_cleared_udata
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_ib_dealloc_xrcd
LBB0_27:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_uobj_alloc_abort
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_30
LBB0_29:
	movq	-96(%rbp), %rax
	movq	%rax, 16(%rsp)
	movaps	-112(%rbp), %xmm0
	movups	%xmm0, (%rsp)
	callq	_fdput
LBB0_30:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_31:
	movl	%r15d, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 40(%rcx)
	movq	-80(%rbp), %rax
	movq	%rax, 32(%rcx)
	leaq	16(%rcx), %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	28(%rax), %rdi
	callq	_mutex_init
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	addq	$24, %rdi
	callq	_INIT_LIST_HEAD
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_EBADF,4,2                      ## @EBADF
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_O_EXCL,4,2                     ## @O_EXCL
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_UVERBS_OBJECT_XRCD,4,2         ## @UVERBS_OBJECT_XRCD
	.no_dead_strip	_ib_uverbs_open_xrcd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ib_uverbs_open_xrcd
_ib_uverbs_open_xrcd:                   ; @ib_uverbs_open_xrcd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x20, x0
	ldr	x8, [x0, #8]
	ldr	x19, [x8]
	stp	xzr, xzr, [sp, #32]
	add	x1, sp, #56
	mov	w2, #8
	bl	_uverbs_request
	mov	x26, x0
	cbnz	w0, LBB0_33
; %bb.1:
	mov	x0, x19
	bl	_mutex_lock
	ldr	w0, [sp, #56]
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.2:
	mov	x8, sp
	bl	_fdget
	ldr	x21, [sp]
	ldur	q0, [sp, #8]
	str	q0, [sp, #32]
	cbz	x21, LBB0_9
; %bb.3:
	mov	x0, x21
	bl	_file_inode
	mov	x23, x0
	mov	x0, x19
	mov	x1, x23
	bl	_find_xrcd
	ldr	w8, [sp, #60]
	cbz	x0, LBB0_17
; %bb.4:
Lloh0:
	adrp	x9, _O_EXCL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _O_EXCL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.5:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_27
LBB0_6:
	mov	x24, #0
	mov	x21, #0
	mov	x23, #0
LBB0_7:
Lloh5:
	adrp	x8, _UVERBS_OBJECT_XRCD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _UVERBS_OBJECT_XRCD@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x2, sp, #24
	mov	x1, x20
	bl	_uobj_alloc
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_10
; %bb.8:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x26, x0
	cbnz	x21, LBB0_31
	b	LBB0_32
LBB0_9:
Lloh8:
	adrp	x8, _EBADF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBADF@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_32
LBB0_10:
	mov	x25, x24
	cbz	x24, LBB0_20
LBB0_11:
	add	x0, x22, #20
	mov	w1, #0
	bl	_atomic_set
	str	x25, [x22, #8]
	add	x0, sp, #48
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	w8, [x22]
	str	w8, [sp, #48]
	cbz	x23, LBB0_22
; %bb.12:
	cbz	x24, LBB0_28
LBB0_13:
	add	x27, x25, #16
	mov	x0, x27
	bl	_atomic_inc
	add	x1, sp, #48
	mov	x0, x20
	mov	w2, #4
	bl	_uverbs_response
	cbz	w0, LBB0_23
; %bb.14:
	mov	x26, x0
	cbnz	x24, LBB0_16
; %bb.15:
	mov	x0, x19
	mov	x1, x23
	bl	_xrcd_table_delete
LBB0_16:
	mov	x0, x27
	bl	_atomic_dec
	b	LBB0_29
LBB0_17:
Lloh11:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_26
; %bb.18:
	mov	x24, #0
	b	LBB0_7
LBB0_19:
	mov	x24, x0
	b	LBB0_7
LBB0_20:
	ldr	x0, [sp, #24]
	ldr	x8, [x0]
	mov	x1, x20
	blr	x8
	mov	x25, x0
	bl	_IS_ERR
	cbz	x0, LBB0_34
; %bb.21:
	mov	x0, x25
	bl	_PTR_ERR
	mov	x26, x0
	b	LBB0_30
LBB0_22:
	add	x1, sp, #48
	mov	x0, x20
	mov	w2, #4
	bl	_uverbs_response
	mov	x26, x0
	cbnz	w0, LBB0_29
LBB0_23:
	cbz	x21, LBB0_25
; %bb.24:
	str	x21, [sp]
	ldr	q0, [sp, #32]
	stur	q0, [sp, #8]
	mov	x0, sp
	bl	_fdput
LBB0_25:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	mov	x1, x20
	bl	_uobj_alloc_commit
	mov	x26, x0
	b	LBB0_33
LBB0_26:
Lloh14:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_27:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_31
LBB0_28:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x25
	bl	_xrcd_table_insert
	mov	x26, x0
	cbz	w0, LBB0_13
LBB0_29:
	mov	x0, x20
	bl	_uverbs_get_cleared_udata
	mov	x1, x0
	mov	x0, x25
	bl	_ib_dealloc_xrcd
LBB0_30:
	mov	x0, x22
	mov	x1, x20
	bl	_uobj_alloc_abort
	cbz	x21, LBB0_32
LBB0_31:
	str	x21, [sp]
	ldr	q0, [sp, #32]
	stur	q0, [sp, #8]
	mov	x0, sp
	bl	_fdput
LBB0_32:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_33:
	mov	x0, x26
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_34:
	ldr	x8, [sp, #24]
	stp	x8, x23, [x25, #32]
	add	x0, x25, #16
	mov	w1, #0
	bl	_atomic_set
	add	x0, x25, #28
	bl	_mutex_init
	add	x0, x25, #24
	bl	_INIT_LIST_HEAD
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EBADF,4,2                      ; @EBADF
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_O_EXCL,4,2                     ; @O_EXCL
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_UVERBS_OBJECT_XRCD,4,2         ; @UVERBS_OBJECT_XRCD
	.no_dead_strip	_ib_uverbs_open_xrcd
.subsections_via_symbols
