	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxreg_led_get_hw
_mlxreg_led_get_hw:                     ## @mlxreg_led_get_hw
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rbx
	movq	16(%rdi), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movl	16(%rbx), %esi
	leaq	-20(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	movl	(%rbx), %eax
	notl	%eax
	andl	%eax, -20(%rbp)
	movl	(%rbx), %edi
	movq	8(%rbx), %rsi
	callq	_ror32
	movq	8(%rbx), %rcx
	leaq	4(%rcx), %rsi
	cmpl	$240, %eax
	movl	-20(%rbp), %edi
	cmoveq	%rcx, %rsi
	callq	_ror32
	movl	(%r14), %ecx
	cmpl	%ecx, %eax
	jl	LBB0_2
## %bb.4:
	movq	_MLXREG_LED_OFFSET_BLINK_6HZ@GOTPCREL(%rip), %rdx
	addl	(%rdx), %ecx
	cmpl	%ecx, %eax
	jg	LBB0_2
## %bb.5:
	movq	_LED_FULL@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_1:
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
LBB0_2:
	movq	_LED_OFF@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to get current brightness, error: %d\n"

	.comm	_LED_OFF,4,2                    ## @LED_OFF
	.comm	_MLXREG_LED_OFFSET_BLINK_6HZ,4,2 ## @MLXREG_LED_OFFSET_BLINK_6HZ
	.comm	_LED_FULL,4,2                   ## @LED_FULL
	.no_dead_strip	_mlxreg_led_get_hw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxreg_led_get_hw
_mlxreg_led_get_hw:                     ; @mlxreg_led_get_hw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldp	x20, x8, [x0, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	ldr	w1, [x20, #16]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_4
; %bb.1:
	ldr	w8, [sp, #12]
	ldr	w9, [x20]
	bic	w8, w8, w9
	str	w8, [sp, #12]
	ldr	w0, [x20]
	ldr	x1, [x20, #8]
	bl	_ror32
	ldr	w8, [sp, #12]
	ldr	x9, [x20, #8]
	add	x10, x9, #4
	cmp	w0, #240
	csel	x1, x9, x10, eq
	mov	x0, x8
	bl	_ror32
	ldr	w8, [x19]
	cmp	w0, w8
	b.lt	LBB0_5
; %bb.2:
Lloh0:
	adrp	x9, _MLXREG_LED_OFFSET_BLINK_6HZ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MLXREG_LED_OFFSET_BLINK_6HZ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w8, w9, w8
	cmp	w0, w8
	b.gt	LBB0_5
; %bb.3:
Lloh3:
	adrp	x8, _LED_FULL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LED_FULL@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	mov	x2, x0
	ldr	w0, [x19, #4]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_5:
Lloh7:
	adrp	x8, _LED_OFF@GOTPAGE
Lloh8:
	ldr	x8, [x8, _LED_OFF@GOTPAGEOFF]
LBB0_6:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to get current brightness, error: %d\n"

	.comm	_LED_OFF,4,2                    ; @LED_OFF
	.comm	_MLXREG_LED_OFFSET_BLINK_6HZ,4,2 ; @MLXREG_LED_OFFSET_BLINK_6HZ
	.comm	_LED_FULL,4,2                   ; @LED_FULL
	.no_dead_strip	_mlxreg_led_get_hw
.subsections_via_symbols
