	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_guest_add_chardev          ## -- Begin function cxl_guest_add_chardev
	.p2align	4, 0x90
_cxl_guest_add_chardev:                 ## @cxl_guest_add_chardev
	.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	%rdi, %rbx
	xorl	%eax, %eax
	callq	_cxl_get_dev
	movl	%eax, %edi
	callq	_MAJOR
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_CXL_CARD_MINOR
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_MKDEV
	movl	%eax, %r15d
	movq	8(%rbx), %rdi
	movq	_fops@GOTPCREL(%rip), %rsi
	callq	_cdev_init
	movq	8(%rbx), %rdi
	movl	%r15d, %esi
	movl	$1, %edx
	callq	_cdev_add
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	4(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %ecx
	callq	_dev_err
	jmp	LBB0_3
LBB0_2:
	movl	%r15d, (%rbx)
	movq	_sem@GOTPCREL(%rip), %rdi
	movl	$1, %esi
	callq	_sema_init
LBB0_3:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fops,4,2                       ## @fops
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to add chardev on adapter (card%i): %i\n"

	.comm	_sem,4,2                        ## @sem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cxl_guest_add_chardev          ; -- Begin function cxl_guest_add_chardev
	.p2align	2
_cxl_guest_add_chardev:                 ; @cxl_guest_add_chardev
	.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	x19, x0
	bl	_cxl_get_dev
	bl	_MAJOR
	mov	x20, x0
	mov	x0, x19
	bl	_CXL_CARD_MINOR
	mov	x1, x0
	mov	x0, x20
	bl	_MKDEV
	mov	x21, x0
	ldr	x0, [x19, #8]
Lloh0:
	adrp	x1, _fops@GOTPAGE
Lloh1:
	ldr	x1, [x1, _fops@GOTPAGEOFF]
	bl	_cdev_init
	ldr	x0, [x19, #8]
	mov	x1, x21
	mov	w2, #1
	bl	_cdev_add
	mov	x20, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w2, [x19, #4]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	bl	_dev_err
	b	LBB0_3
LBB0_2:
	str	w21, [x19]
Lloh4:
	adrp	x0, _sem@GOTPAGE
Lloh5:
	ldr	x0, [x0, _sem@GOTPAGEOFF]
	mov	w1, #1
	bl	_sema_init
LBB0_3:
	mov	x0, x20
	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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_fops,4,2                       ; @fops
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to add chardev on adapter (card%i): %i\n"

	.comm	_sem,4,2                        ; @sem
.subsections_via_symbols
