	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8366s_setLedConfig          ## -- Begin function rtl8366s_setLedConfig
	.p2align	4, 0x90
_rtl8366s_setLedConfig:                 ## @rtl8366s_setLedConfig
	.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	_RTL8366S_LED_GROUP_MAX@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jle	LBB0_1
## %bb.3:
	movl	%esi, %r14d
	movq	_RTL8366S_LEDCONF_LEDFORCE@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jge	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	callq	_DBG
	jmp	LBB0_11
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	jmp	LBB0_11
LBB0_5:
	movl	%edi, %ebx
	movq	_RTL8366S_LED_INDICATED_CONF_REG@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	leaq	-28(%rbp), %rsi
	callq	_rtl8366_readRegister
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_str.4(%rip), %rdi
	jmp	LBB0_10
LBB0_7:
	shll	$2, %ebx
	movl	$15, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	notl	%eax
	andl	-28(%rbp), %eax
	shll	%cl, %r14d
	orl	%eax, %r14d
	movl	%r14d, -28(%rbp)
	movl	(%r15), %edi
	movl	%r14d, %esi
	callq	_rtl8366_writeRegister
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	leaq	L_str(%rip), %rdi
LBB0_10:
	callq	_puts
LBB0_11:
	movl	$-1, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_12
	.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_setLedConfig: invalid led group\n"

	.comm	_RTL8366S_LEDCONF_LEDFORCE,4,2  ## @RTL8366S_LEDCONF_LEDFORCE
L_.str.1:                               ## @.str.1
	.asciz	"rtl8366s_setLedConfig: invalid led config\n"

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

L_str.4:                                ## @str.4
	.asciz	"rtl8366s_setLedConfig: 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_setLedConfig          ; -- Begin function rtl8366s_setLedConfig
	.p2align	2
_rtl8366s_setLedConfig:                 ; @rtl8366s_setLedConfig
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
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
Lloh3:
	adrp	x8, _RTL8366S_LEDCONF_LEDFORCE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RTL8366S_LEDCONF_LEDFORCE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ge	LBB0_4
; %bb.2:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DBG
	b	LBB0_9
LBB0_3:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	b	LBB0_9
LBB0_4:
	mov	x20, x0
Lloh10:
	adrp	x21, _RTL8366S_LED_INDICATED_CONF_REG@GOTPAGE
Lloh11:
	ldr	x21, [x21, _RTL8366S_LED_INDICATED_CONF_REG@GOTPAGEOFF]
	ldr	w0, [x21]
	add	x1, sp, #12
	bl	_rtl8366_readRegister
	cbz	x0, LBB0_6
; %bb.5:
Lloh12:
	adrp	x0, l_str.4@PAGE
Lloh13:
	add	x0, x0, l_str.4@PAGEOFF
	b	LBB0_8
LBB0_6:
	lsl	w8, w20, #2
	mov	w9, #15
	lsl	w9, w9, w8
	ldr	w10, [sp, #12]
	bic	w9, w10, w9
	lsl	w8, w19, w8
	orr	w1, w9, w8
	str	w1, [sp, #12]
	ldr	w0, [x21]
	bl	_rtl8366_writeRegister
	cbz	x0, LBB0_10
; %bb.7:
Lloh14:
	adrp	x0, l_str@PAGE
Lloh15:
	add	x0, x0, l_str@PAGEOFF
LBB0_8:
	bl	_puts
LBB0_9:
	mov	w0, #-1
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.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_setLedConfig: invalid led group\n"

	.comm	_RTL8366S_LEDCONF_LEDFORCE,4,2  ; @RTL8366S_LEDCONF_LEDFORCE
l_.str.1:                               ; @.str.1
	.asciz	"rtl8366s_setLedConfig: invalid led config\n"

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

l_str.4:                                ; @str.4
	.asciz	"rtl8366s_setLedConfig: failed to get led register!"

.subsections_via_symbols
