	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sc27xx_led_pattern_set
_sc27xx_led_pattern_set:                ## @sc27xx_led_pattern_set
	.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	$40, %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, %rbx
	callq	_to_sc27xx_led
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_sc27xx_led_get_offset
	movq	%rax, %r12
	movq	_SC27XX_LEDS_PATTERN_CNT@GOTPCREL(%rip), %rax
	cmpq	%r13, (%rax)
	jne	LBB0_1
## %bb.2:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rdi
	movq	_SC27XX_LEDS_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	(%rdi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_SC27XX_CTRL_SHIFT@GOTPCREL(%rip), %rax
	movl	(%r14), %ecx
	imull	(%rax), %ecx
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movq	16(%rdi), %rbx
	addq	$8, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_sc27xx_led_clamp_align_delta_t
	movq	_SC27XX_LEDS_CURVE0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	addq	%r12, %rsi
	movq	_SC27XX_CURVE_L_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movl	(%r15), %eax
	movq	_SC27XX_LEDS_STEP@GOTPCREL(%rip), %rdi
	cltd
	idivl	(%rdi)
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%ecx, %edx
	movl	%eax, %ecx
	callq	_regmap_update_bits
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.3:
	leaq	8(%r15), %rdi
	callq	_sc27xx_led_clamp_align_delta_t
	movq	_SC27XX_LEDS_CURVE1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	-56(%rbp), %rsi                 ## 8-byte Folded Reload
	movl	(%r12), %ecx
	movl	8(%r15), %eax
	cltd
	movq	_SC27XX_LEDS_STEP@GOTPCREL(%rip), %rdi
	idivl	(%rdi)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ecx, %edx
	movl	%eax, %ecx
	callq	_regmap_update_bits
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	leaq	16(%r15), %rdi
	callq	_sc27xx_led_clamp_align_delta_t
	movq	_SC27XX_LEDS_CURVE0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	-56(%rbp), %rsi                 ## 8-byte Folded Reload
	movq	_SC27XX_CURVE_H_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %r8d
	movl	16(%r15), %eax
	cltd
	movq	_SC27XX_LEDS_STEP@GOTPCREL(%rip), %rcx
	idivl	(%rcx)
	movq	_SC27XX_CURVE_SHIFT@GOTPCREL(%rip), %rbx
	movb	(%rbx), %cl
	shll	%cl, %eax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r8d, %edx
	movl	%eax, %ecx
	callq	_regmap_update_bits
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.5:
	leaq	24(%r15), %rdi
	callq	_sc27xx_led_clamp_align_delta_t
	movq	_SC27XX_LEDS_CURVE1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	-56(%rbp), %rsi                 ## 8-byte Folded Reload
	movl	(%r12), %r8d
	movl	24(%r15), %eax
	cltd
	movq	_SC27XX_LEDS_STEP@GOTPCREL(%rip), %rcx
	idivl	(%rcx)
	movb	(%rbx), %cl
	shll	%cl, %eax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r8d, %edx
	movl	%eax, %ecx
	callq	_regmap_update_bits
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.6:
	movq	_SC27XX_LEDS_DUTY@GOTPCREL(%rip), %rax
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	addq	(%rax), %rsi
	movq	_SC27XX_DUTY_MASK@GOTPCREL(%rip), %rdx
	movl	12(%r15), %eax
	movq	_SC27XX_DUTY_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	(%rdx), %edx
	movq	_SC27XX_MOD_MASK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %ecx
	callq	_regmap_update_bits
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.7:
	movq	_SC27XX_LED_RUN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movl	%edx, %ecx
	callq	_regmap_update_bits
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movl	12(%r15), %eax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%r13d, %r13d
LBB0_9:
	movq	8(%r14), %rdi
	addq	$8, %rdi
	callq	_mutex_unlock
	jmp	LBB0_10
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_10:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SC27XX_LEDS_CTRL,8,3           ## @SC27XX_LEDS_CTRL
	.comm	_SC27XX_CTRL_SHIFT,4,2          ## @SC27XX_CTRL_SHIFT
	.comm	_SC27XX_LEDS_PATTERN_CNT,8,3    ## @SC27XX_LEDS_PATTERN_CNT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SC27XX_LEDS_CURVE0,8,3         ## @SC27XX_LEDS_CURVE0
	.comm	_SC27XX_CURVE_L_MASK,4,2        ## @SC27XX_CURVE_L_MASK
	.comm	_SC27XX_LEDS_STEP,4,2           ## @SC27XX_LEDS_STEP
	.comm	_SC27XX_LEDS_CURVE1,8,3         ## @SC27XX_LEDS_CURVE1
	.comm	_SC27XX_CURVE_H_MASK,4,2        ## @SC27XX_CURVE_H_MASK
	.comm	_SC27XX_CURVE_SHIFT,4,2         ## @SC27XX_CURVE_SHIFT
	.comm	_SC27XX_LEDS_DUTY,8,3           ## @SC27XX_LEDS_DUTY
	.comm	_SC27XX_DUTY_MASK,4,2           ## @SC27XX_DUTY_MASK
	.comm	_SC27XX_DUTY_SHIFT,4,2          ## @SC27XX_DUTY_SHIFT
	.comm	_SC27XX_MOD_MASK,4,2            ## @SC27XX_MOD_MASK
	.comm	_SC27XX_LED_RUN,4,2             ## @SC27XX_LED_RUN
	.no_dead_strip	_sc27xx_led_pattern_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sc27xx_led_pattern_set
_sc27xx_led_pattern_set:                ; @sc27xx_led_pattern_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x2
	mov	x21, x1
	mov	x20, x0
	bl	_to_sc27xx_led
	mov	x19, x0
	bl	_sc27xx_led_get_offset
Lloh0:
	adrp	x8, _SC27XX_LEDS_PATTERN_CNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SC27XX_LEDS_PATTERN_CNT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x22
	b.ne	LBB0_9
; %bb.1:
	mov	x23, x0
	ldr	x8, [x19, #8]
	ldr	x9, [x8]
	str	x9, [sp, #24]                   ; 8-byte Folded Spill
Lloh3:
	adrp	x9, _SC27XX_LEDS_CTRL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SC27XX_LEDS_CTRL@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	str	x9, [sp, #16]                   ; 8-byte Folded Spill
Lloh6:
	adrp	x9, _SC27XX_CTRL_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SC27XX_CTRL_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	str	w9, [sp, #12]                   ; 4-byte Folded Spill
	ldr	w28, [x19]
	ldr	x22, [x8, #16]
	add	x0, x8, #8
	bl	_mutex_lock
	mov	x0, x21
	bl	_sc27xx_led_clamp_align_delta_t
Lloh9:
	adrp	x26, _SC27XX_LEDS_CURVE0@GOTPAGE
Lloh10:
	ldr	x26, [x26, _SC27XX_LEDS_CURVE0@GOTPAGEOFF]
	ldr	x8, [x26]
	add	x1, x8, x23
Lloh11:
	adrp	x27, _SC27XX_CURVE_L_MASK@GOTPAGE
Lloh12:
	ldr	x27, [x27, _SC27XX_CURVE_L_MASK@GOTPAGEOFF]
	ldr	w2, [x27]
	ldr	w8, [x21]
Lloh13:
	adrp	x25, _SC27XX_LEDS_STEP@GOTPAGE
Lloh14:
	ldr	x25, [x25, _SC27XX_LEDS_STEP@GOTPAGEOFF]
	ldr	w9, [x25]
	sdiv	w3, w8, w9
	mov	x0, x22
	bl	_regmap_update_bits
	mov	x24, x0
	cbnz	w0, LBB0_8
; %bb.2:
	add	x0, x21, #8
	bl	_sc27xx_led_clamp_align_delta_t
Lloh15:
	adrp	x8, _SC27XX_LEDS_CURVE1@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SC27XX_LEDS_CURVE1@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	add	x1, x8, x23
	ldr	w2, [x27]
	ldr	w8, [x21, #8]
	ldr	w9, [x25]
	sdiv	w3, w8, w9
	mov	x0, x22
	bl	_regmap_update_bits
	mov	x24, x0
	cbnz	w0, LBB0_8
; %bb.3:
	add	x0, x21, #16
	bl	_sc27xx_led_clamp_align_delta_t
	ldr	x8, [x26]
	add	x1, x8, x23
Lloh18:
	adrp	x27, _SC27XX_CURVE_H_MASK@GOTPAGE
Lloh19:
	ldr	x27, [x27, _SC27XX_CURVE_H_MASK@GOTPAGEOFF]
	ldr	w2, [x27]
	ldr	w8, [x21, #16]
	ldr	w9, [x25]
	sdiv	w8, w8, w9
Lloh20:
	adrp	x26, _SC27XX_CURVE_SHIFT@GOTPAGE
Lloh21:
	ldr	x26, [x26, _SC27XX_CURVE_SHIFT@GOTPAGEOFF]
	ldr	w9, [x26]
	lsl	w3, w8, w9
	mov	x0, x22
	bl	_regmap_update_bits
	mov	x24, x0
	cbnz	w0, LBB0_8
; %bb.4:
	add	x0, x21, #24
	bl	_sc27xx_led_clamp_align_delta_t
Lloh22:
	adrp	x8, _SC27XX_LEDS_CURVE1@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SC27XX_LEDS_CURVE1@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	add	x1, x8, x23
	ldr	w2, [x27]
	ldr	w8, [x21, #24]
	ldr	w9, [x25]
	sdiv	w8, w8, w9
	ldr	w9, [x26]
	lsl	w3, w8, w9
	mov	x0, x22
	bl	_regmap_update_bits
	mov	x24, x0
	cbnz	w0, LBB0_8
; %bb.5:
Lloh25:
	adrp	x8, _SC27XX_LEDS_DUTY@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SC27XX_LEDS_DUTY@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	add	x1, x8, x23
Lloh28:
	adrp	x8, _SC27XX_DUTY_MASK@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SC27XX_DUTY_MASK@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	ldr	w8, [x21, #12]
Lloh31:
	adrp	x9, _SC27XX_DUTY_SHIFT@GOTPAGE
Lloh32:
	ldr	x9, [x9, _SC27XX_DUTY_SHIFT@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	lsl	w8, w8, w9
Lloh34:
	adrp	x9, _SC27XX_MOD_MASK@GOTPAGE
Lloh35:
	ldr	x9, [x9, _SC27XX_MOD_MASK@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	orr	w3, w8, w9
	mov	x0, x22
	bl	_regmap_update_bits
	mov	x24, x0
	cbnz	w0, LBB0_8
; %bb.6:
	ldp	x9, x8, [sp, #16]               ; 16-byte Folded Reload
	add	x1, x9, x8
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	mul	w8, w28, w8
Lloh37:
	adrp	x9, _SC27XX_LED_RUN@GOTPAGE
Lloh38:
	ldr	x9, [x9, _SC27XX_LED_RUN@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	lsl	w2, w9, w8
	mov	x0, x22
	mov	x3, x2
	bl	_regmap_update_bits
	mov	x24, x0
	cbnz	w0, LBB0_8
; %bb.7:
	ldr	w8, [x21, #12]
	str	w8, [x20]
LBB0_8:
	ldr	x8, [x19, #8]
	add	x0, x8, #8
	bl	_mutex_unlock
	b	LBB0_10
LBB0_9:
Lloh40:
	adrp	x8, _EINVAL@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_10:
	mov	x0, x24
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_SC27XX_LEDS_CTRL,8,3           ; @SC27XX_LEDS_CTRL
	.comm	_SC27XX_CTRL_SHIFT,4,2          ; @SC27XX_CTRL_SHIFT
	.comm	_SC27XX_LEDS_PATTERN_CNT,8,3    ; @SC27XX_LEDS_PATTERN_CNT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SC27XX_LEDS_CURVE0,8,3         ; @SC27XX_LEDS_CURVE0
	.comm	_SC27XX_CURVE_L_MASK,4,2        ; @SC27XX_CURVE_L_MASK
	.comm	_SC27XX_LEDS_STEP,4,2           ; @SC27XX_LEDS_STEP
	.comm	_SC27XX_LEDS_CURVE1,8,3         ; @SC27XX_LEDS_CURVE1
	.comm	_SC27XX_CURVE_H_MASK,4,2        ; @SC27XX_CURVE_H_MASK
	.comm	_SC27XX_CURVE_SHIFT,4,2         ; @SC27XX_CURVE_SHIFT
	.comm	_SC27XX_LEDS_DUTY,8,3           ; @SC27XX_LEDS_DUTY
	.comm	_SC27XX_DUTY_MASK,4,2           ; @SC27XX_DUTY_MASK
	.comm	_SC27XX_DUTY_SHIFT,4,2          ; @SC27XX_DUTY_SHIFT
	.comm	_SC27XX_MOD_MASK,4,2            ; @SC27XX_MOD_MASK
	.comm	_SC27XX_LED_RUN,4,2             ; @SC27XX_LED_RUN
	.no_dead_strip	_sc27xx_led_pattern_set
.subsections_via_symbols
