	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cxl_add_chardev
_cxl_add_chardev:                       ## @cxl_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r13
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	16(%rbp), %rsi
	movq	%rdx, %rdi
	callq	_cdev_init
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	$1, %edx
	callq	_cdev_add
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r13, %rdx
	movl	%eax, %ecx
	callq	_dev_err
LBB0_5:
	movl	%r14d, %eax
	jmp	LBB0_6
LBB0_2:
	movq	_cxl_class@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%rbx), %rax
	movl	(%rax), %r9d
	movl	4(%rbx), %eax
	leaq	L_.str.1(%rip), %r8
	movq	%rbx, %rsi
	movl	%r12d, %edx
	movq	%rbx, %rcx
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	pushq	%rax
	callq	_device_create
	addq	$16, %rsp
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	callq	_dev_err
	movq	%r12, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_cdev_del
	movl	%ebx, %eax
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r12, (%rax)
	xorl	%r14d, %r14d
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to add %s chardev: %i\n"

	.comm	_cxl_class,4,2                  ## @cxl_class
L_.str.1:                               ## @.str.1
	.asciz	"afu%i.%i%s"

L_.str.2:                               ## @.str.2
	.asciz	"Unable to create %s chardev in sysfs: %i\n"

	.no_dead_strip	_cxl_add_chardev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cxl_add_chardev
_cxl_add_chardev:                       ; @cxl_add_chardev
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x5
	mov	x23, x4
	mov	x22, x3
	mov	x19, x2
	mov	x24, x1
	mov	x21, x0
	mov	x0, x2
	mov	x1, x6
	bl	_cdev_init
	mov	x0, x19
	mov	x1, x24
	mov	w2, #1
	bl	_cdev_add
	cbz	w0, LBB0_3
; %bb.1:
	mov	x25, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	mov	x3, x25
	bl	_dev_err
LBB0_2:
	mov	x0, x25
	b	LBB0_5
LBB0_3:
Lloh2:
	adrp	x8, _cxl_class@GOTPAGE
Lloh3:
	ldr	x8, [x8, _cxl_class@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	ldr	x8, [x21, #8]
	ldr	w5, [x8]
	ldr	w6, [x21, #4]
Lloh5:
	adrp	x4, l_.str.1@PAGE
Lloh6:
	add	x4, x4, l_.str.1@PAGEOFF
	mov	x1, x21
	mov	x2, x24
	mov	x3, x21
	mov	x7, x23
	bl	_device_create
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.4:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	mov	w3, #0
	bl	_dev_err
	mov	x0, x23
	bl	_PTR_ERR
	mov	x20, x0
	mov	x0, x19
	bl	_cdev_del
	mov	x0, x20
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	w25, #0
	str	x23, [x22]
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to add %s chardev: %i\n"

	.comm	_cxl_class,4,2                  ; @cxl_class
l_.str.1:                               ; @.str.1
	.asciz	"afu%i.%i%s"

l_.str.2:                               ; @.str.2
	.asciz	"Unable to create %s chardev in sysfs: %i\n"

	.no_dead_strip	_cxl_add_chardev
.subsections_via_symbols
