	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_led_classdev_register_ext      ## -- Begin function led_classdev_register_ext
	.p2align	4, 0x90
_led_classdev_register_ext:             ## @led_classdev_register_ext
	.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	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_LED_MAX_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	testq	%r13, %r13
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_6
## %bb.1:
	cmpq	$0, 16(%r13)
	je	LBB0_4
## %bb.2:
	cmpl	$0, 8(%r13)
	je	LBB0_3
LBB0_4:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	_led_compose_name
	testl	%eax, %eax
	jns	LBB0_7
## %bb.5:
	movl	%eax, %r15d
	jmp	LBB0_21
LBB0_6:
	movq	(%r15), %r12
LBB0_7:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_led_classdev_next_name
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_21
## %bb.8:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	leaq	16(%rbx), %r12
	movq	%r12, %rdi
	callq	_mutex_init
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	_leds_class@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	56(%rbx), %r8d
	subq	$8, %rsp
	leaq	L_.str.1(%rip), %r9
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	movq	%rbx, %rcx
	pushq	%r14
	callq	_device_create_with_groups
	addq	$16, %rsp
	movq	%rax, 48(%rbx)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	48(%rbx), %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
	jmp	LBB0_21
LBB0_10:
	testq	%r13, %r13
	je	LBB0_13
## %bb.11:
	movq	(%r13), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	48(%rbx), %rcx
	movq	%rax, (%rcx)
LBB0_13:
	testl	%r15d, %r15d
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_15
## %bb.14:
	movq	(%rbx), %r14
	movq	48(%rbx), %rdi
	callq	_dev_name
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	_dev_warn
LBB0_15:
	movq	_LED_BRIGHT_HW_CHANGED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_18
## %bb.16:
	movq	%rbx, %rdi
	callq	_led_add_brightness_hw_changed
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %r15d
	movq	48(%rbx), %rdi
	callq	_device_unregister
	movq	$0, 48(%rbx)
	movq	%r12, %rdi
	callq	_mutex_unlock
	jmp	LBB0_21
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_21
LBB0_18:
	movq	$0, 40(%rbx)
	movq	_leds_list_lock@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_down_write
	leaq	32(%rbx), %rdi
	movq	_leds_list@GOTPCREL(%rip), %rsi
	callq	_list_add_tail
	movq	%r14, %rdi
	callq	_up_write
	cmpq	$0, 24(%rbx)
	jne	LBB0_20
## %bb.19:
	movq	_LED_FULL@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%rbx)
LBB0_20:
	movq	%rbx, %rdi
	callq	_led_update_brightness
	movq	%rbx, %rdi
	callq	_led_init_core
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	(%rbx), %rdx
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_dbg
	xorl	%r15d, %r15d
LBB0_21:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_23
## %bb.22:
	movl	%r15d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_LED_MAX_NAME_SIZE,4,2          ## @LED_MAX_NAME_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Mandatory device name is missing"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_leds_class,4,2                 ## @leds_class
L_.str.1:                               ## @.str.1
	.asciz	"%s"

L_.str.2:                               ## @.str.2
	.asciz	"Led %s renamed to %s due to name collision"

	.comm	_LED_BRIGHT_HW_CHANGED,4,2      ## @LED_BRIGHT_HW_CHANGED
	.comm	_leds_list_lock,4,2             ## @leds_list_lock
	.comm	_leds_list,4,2                  ## @leds_list
	.comm	_LED_FULL,8,3                   ## @LED_FULL
L_.str.3:                               ## @.str.3
	.asciz	"Registered led device: %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_led_classdev_register_ext      ; -- Begin function led_classdev_register_ext
	.p2align	2
_led_classdev_register_ext:             ; @led_classdev_register_ext
	.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
	sub	sp, sp, #16
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _LED_MAX_NAME_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LED_MAX_NAME_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	mov	x9, x21
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x21, #15
	and	x12, x9, #0x1fffffff0
	sub	x25, x8, x12
	mov	sp, x25
	mov	x9, x21
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x24, x8, x12
	mov	sp, x24
	cbz	x2, LBB0_5
; %bb.1:
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	w8, [x22, #8]
	cbz	w8, LBB0_17
LBB0_3:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x25
	bl	_led_compose_name
	tbz	w0, #31, LBB0_6
; %bb.4:
	mov	x23, x0
	b	LBB0_21
LBB0_5:
	ldr	x25, [x19]
LBB0_6:
	mov	x0, x25
	mov	x1, x24
	mov	x2, x21
	bl	_led_classdev_next_name
	mov	x23, x0
	tbnz	w0, #31, LBB0_21
; %bb.7:
	add	x21, x19, #16
	mov	x0, x21
	bl	_mutex_init
	mov	x0, x21
	bl	_mutex_lock
Lloh10:
	adrp	x8, _leds_class@GOTPAGE
Lloh11:
	ldr	x8, [x8, _leds_class@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ldr	w4, [x19, #56]
Lloh13:
	adrp	x5, l_.str.1@PAGE
Lloh14:
	add	x5, x5, l_.str.1@PAGEOFF
	mov	x1, x20
	mov	w2, #0
	mov	x3, x19
	mov	x6, x24
	bl	_device_create_with_groups
	str	x0, [x19, #48]
	bl	_IS_ERR
	cbz	x0, LBB0_9
; %bb.8:
	mov	x0, x21
	bl	_mutex_unlock
	ldr	x0, [x19, #48]
	bl	_PTR_ERR
	mov	x23, x0
	b	LBB0_21
LBB0_9:
	cbz	x22, LBB0_12
; %bb.10:
	ldr	x8, [x22]
	cbz	x8, LBB0_12
; %bb.11:
	ldr	x9, [x19, #48]
	str	x8, [x9]
LBB0_12:
	cbz	w23, LBB0_14
; %bb.13:
	ldr	x22, [x19]
	ldr	x0, [x19, #48]
	bl	_dev_name
	mov	x3, x0
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x22
	bl	_dev_warn
LBB0_14:
	ldr	w8, [x19, #8]
Lloh17:
	adrp	x9, _LED_BRIGHT_HW_CHANGED@GOTPAGE
Lloh18:
	ldr	x9, [x9, _LED_BRIGHT_HW_CHANGED@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.15:
	mov	x0, x19
	bl	_led_add_brightness_hw_changed
	cbz	w0, LBB0_18
; %bb.16:
	mov	x23, x0
	ldr	x0, [x19, #48]
	bl	_device_unregister
	str	xzr, [x19, #48]
	mov	x0, x21
	bl	_mutex_unlock
	b	LBB0_21
LBB0_17:
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_21
LBB0_18:
	str	xzr, [x19, #40]
Lloh25:
	adrp	x22, _leds_list_lock@GOTPAGE
Lloh26:
	ldr	x22, [x22, _leds_list_lock@GOTPAGEOFF]
	mov	x0, x22
	bl	_down_write
	add	x0, x19, #32
Lloh27:
	adrp	x1, _leds_list@GOTPAGE
Lloh28:
	ldr	x1, [x1, _leds_list@GOTPAGEOFF]
	bl	_list_add_tail
	mov	x0, x22
	bl	_up_write
	ldr	x8, [x19, #24]
	cbnz	x8, LBB0_20
; %bb.19:
Lloh29:
	adrp	x8, _LED_FULL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _LED_FULL@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	str	x8, [x19, #24]
LBB0_20:
	mov	x0, x19
	bl	_led_update_brightness
	mov	x0, x19
	bl	_led_init_core
	mov	x0, x21
	bl	_mutex_unlock
	ldr	x2, [x19]
Lloh32:
	adrp	x1, l_.str.3@PAGE
Lloh33:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	mov	w23, #0
LBB0_21:
	ldur	x8, [x29, #-72]
Lloh34:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh35:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_23
; %bb.22:
	mov	x0, x23
	sub	sp, x29, #64
	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_23:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_LED_MAX_NAME_SIZE,4,2          ; @LED_MAX_NAME_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Mandatory device name is missing"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_leds_class,4,2                 ; @leds_class
l_.str.1:                               ; @.str.1
	.asciz	"%s"

l_.str.2:                               ; @.str.2
	.asciz	"Led %s renamed to %s due to name collision"

	.comm	_LED_BRIGHT_HW_CHANGED,4,2      ; @LED_BRIGHT_HW_CHANGED
	.comm	_leds_list_lock,4,2             ; @leds_list_lock
	.comm	_leds_list,4,2                  ; @leds_list
	.comm	_LED_FULL,8,3                   ; @LED_FULL
l_.str.3:                               ; @.str.3
	.asciz	"Registered led device: %s\n"

.subsections_via_symbols
