	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_get_fd                     ## -- Begin function cxl_get_fd
	.p2align	4, 0x90
_cxl_get_fd:                            ## @cxl_get_fd
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 8(%rdi)
	je	LBB0_2
## %bb.1:
	movq	_EEXIST@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_2:
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movq	_O_CLOEXEC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	orl	(%rax), %r13d
	movl	%r13d, %edi
	callq	_get_unused_fd_flags
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testq	%r12, %r12
	je	LBB0_6
## %bb.7:
	movq	_open@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PATCH_FOPS
	movq	_poll@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PATCH_FOPS
	movq	_read@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PATCH_FOPS
	movq	_release@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PATCH_FOPS
	movq	_unlocked_ioctl@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PATCH_FOPS
	movq	_compat_ioctl@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PATCH_FOPS
	movq	_mmap@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PATCH_FOPS
	jmp	LBB0_8
LBB0_3:
	movl	%eax, %edi
	jmp	LBB0_4
LBB0_6:
	movq	_afu_fops@GOTPCREL(%rip), %r12
LBB0_8:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %edx
	leaq	L_.str(%rip), %rsi
	callq	_kasprintf
	movq	%rax, %r14
	movq	%rax, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movl	%r13d, %ecx
	callq	_cxl_getfile
	movq	%rax, %r12
	movq	%r14, %rdi
	callq	_kfree
	movq	%r12, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_put_unused_fd
	xorl	%r12d, %r12d
	jmp	LBB0_11
LBB0_9:
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_cxl_context_set_mapping
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rbx)
LBB0_11:
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EEXIST,4,2                     ## @EEXIST
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_CLOEXEC,4,2                  ## @O_CLOEXEC
	.comm	_open,4,2                       ## @open
	.comm	_poll,4,2                       ## @poll
	.comm	_read,4,2                       ## @read
	.comm	_release,4,2                    ## @release
	.comm	_unlocked_ioctl,4,2             ## @unlocked_ioctl
	.comm	_compat_ioctl,4,2               ## @compat_ioctl
	.comm	_mmap,4,2                       ## @mmap
	.comm	_afu_fops,4,2                   ## @afu_fops
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cxl:%d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_get_fd                     ; -- Begin function cxl_get_fd
	.p2align	2
_cxl_get_fd:                            ; @cxl_get_fd
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _EEXIST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_2:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_3:
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
Lloh3:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _O_CLOEXEC@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_CLOEXEC@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w23, w9, w8
	mov	x0, x23
	bl	_get_unused_fd_flags
	mov	x21, x0
	tbnz	w0, #31, LBB0_6
; %bb.4:
	cbz	x22, LBB0_7
; %bb.5:
Lloh9:
	adrp	x8, _open@GOTPAGE
Lloh10:
	ldr	x8, [x8, _open@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_PATCH_FOPS
Lloh12:
	adrp	x8, _poll@GOTPAGE
Lloh13:
	ldr	x8, [x8, _poll@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_PATCH_FOPS
Lloh15:
	adrp	x8, _read@GOTPAGE
Lloh16:
	ldr	x8, [x8, _read@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_PATCH_FOPS
Lloh18:
	adrp	x8, _release@GOTPAGE
Lloh19:
	ldr	x8, [x8, _release@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_PATCH_FOPS
Lloh21:
	adrp	x8, _unlocked_ioctl@GOTPAGE
Lloh22:
	ldr	x8, [x8, _unlocked_ioctl@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	bl	_PATCH_FOPS
Lloh24:
	adrp	x8, _compat_ioctl@GOTPAGE
Lloh25:
	ldr	x8, [x8, _compat_ioctl@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	bl	_PATCH_FOPS
Lloh27:
	adrp	x8, _mmap@GOTPAGE
Lloh28:
	ldr	x8, [x8, _mmap@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	bl	_PATCH_FOPS
	b	LBB0_8
LBB0_6:
	mov	x0, x21
	b	LBB0_2
LBB0_7:
Lloh30:
	adrp	x22, _afu_fops@GOTPAGE
Lloh31:
	ldr	x22, [x22, _afu_fops@GOTPAGEOFF]
LBB0_8:
Lloh32:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	ldr	w2, [x20]
Lloh35:
	adrp	x1, l_.str@PAGE
Lloh36:
	add	x1, x1, l_.str@PAGEOFF
	bl	_kasprintf
	mov	x24, x0
	mov	x1, x22
	mov	x2, x20
	mov	x3, x23
	bl	_cxl_getfile
	mov	x22, x0
	mov	x0, x24
	bl	_kfree
	mov	x0, x22
	bl	_IS_ERR
	cbz	x0, LBB0_10
; %bb.9:
	mov	x0, x21
	bl	_put_unused_fd
	mov	x22, #0
	b	LBB0_11
LBB0_10:
	ldr	w1, [x22]
	mov	x0, x20
	bl	_cxl_context_set_mapping
	str	w21, [x19]
LBB0_11:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_EEXIST,4,2                     ; @EEXIST
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_CLOEXEC,4,2                  ; @O_CLOEXEC
	.comm	_open,4,2                       ; @open
	.comm	_poll,4,2                       ; @poll
	.comm	_read,4,2                       ; @read
	.comm	_release,4,2                    ; @release
	.comm	_unlocked_ioctl,4,2             ; @unlocked_ioctl
	.comm	_compat_ioctl,4,2               ; @compat_ioctl
	.comm	_mmap,4,2                       ; @mmap
	.comm	_afu_fops,4,2                   ; @afu_fops
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cxl:%d"

.subsections_via_symbols
