	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366s_getLedConfig          ## -- Begin function rtl8366s_getLedConfig
	.p2align	4, 0x90
_rtl8366s_getLedConfig:                 ## @rtl8366s_getLedConfig
	.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	_RTL8366S_LED_GROUP_MAX@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jle	LBB0_1
## %bb.2:
	movq	%rsi, %r14
	movl	%edi, %ebx
	movq	_RTL8366S_LED_INDICATED_CONF_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-20(%rbp), %rsi
	callq	_rtl8366_readRegister
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	$-1, %eax
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	movl	$-1, %eax
	jmp	LBB0_6
LBB0_4:
	xorl	%eax, %eax
	testq	%r14, %r14
	je	LBB0_6
## %bb.5:
	movl	-20(%rbp), %edx
	shll	$2, %ebx
	movl	%ebx, %ecx
	sarl	%cl, %edx
	andl	$15, %edx
	movl	%edx, (%r14)
LBB0_6:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8366S_LED_GROUP_MAX,4,2     ## @RTL8366S_LED_GROUP_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rtl8366s_getLedConfig: invalid led group\n"

	.comm	_RTL8366S_LED_INDICATED_CONF_REG,4,2 ## @RTL8366S_LED_INDICATED_CONF_REG
L_str:                                  ## @str
	.asciz	"rtl8366s_getLedConfig: failed to get led register!"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366s_getLedConfig          ; -- Begin function rtl8366s_getLedConfig
	.p2align	2
_rtl8366s_getLedConfig:                 ; @rtl8366s_getLedConfig
	.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
Lloh0:
	adrp	x8, _RTL8366S_LED_GROUP_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTL8366S_LED_GROUP_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.le	LBB0_3
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh3:
	adrp	x8, _RTL8366S_LED_INDICATED_CONF_REG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RTL8366S_LED_INDICATED_CONF_REG@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x1, sp, #12
	bl	_rtl8366_readRegister
	cbz	x0, LBB0_4
; %bb.2:
Lloh6:
	adrp	x0, l_str@PAGE
Lloh7:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w0, #-1
	b	LBB0_6
LBB0_3:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	mov	w0, #-1
	b	LBB0_6
LBB0_4:
	mov	w0, #0
	cbz	x19, LBB0_6
; %bb.5:
	ldr	w8, [sp, #12]
	lsl	w9, w20, #2
	asr	w8, w8, w9
	and	w8, w8, #0xf
	str	w8, [x19]
LBB0_6:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8366S_LED_GROUP_MAX,4,2     ; @RTL8366S_LED_GROUP_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rtl8366s_getLedConfig: invalid led group\n"

	.comm	_RTL8366S_LED_INDICATED_CONF_REG,4,2 ; @RTL8366S_LED_INDICATED_CONF_REG
l_str:                                  ; @str
	.asciz	"rtl8366s_getLedConfig: failed to get led register!"

.subsections_via_symbols
