	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kone_sysfs_set_tcu
_kone_sysfs_set_tcu:                    ## @kone_sysfs_set_tcu
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	(%rdi), %rax
	movq	(%rax), %rbx
	movq	%rbx, %rdi
	callq	_dev_get_drvdata
	movl	%eax, %edi
	callq	_hid_get_drvdata
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_to_usb_interface
	movl	%eax, %edi
	callq	_interface_to_usbdev
	movq	%rax, %r12
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	movl	$10, %esi
	callq	_kstrtoul
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.1:
	cmpq	$2, -48(%rbp)
	jae	LBB0_2
## %bb.3:
	movq	%r13, %r15
	movq	%r13, %rdi
	callq	_mutex_lock
	cmpq	$1, -48(%rbp)
	jne	LBB0_10
## %bb.4:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_kone_tcu_command
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.5:
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_kone_tcu_command
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.6:
	movl	$5, %edi
	callq	_ssleep
	movq	%r12, %rdi
	movl	$3, %esi
	callq	_kone_tcu_command
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.7:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_kone_tcu_command
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.8:
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_kone_tcu_command
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.9:
	movl	$1, %edi
	callq	_ssleep
LBB0_10:
	addq	$8, %r13
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_kone_get_settings
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_17
## %bb.11:
	movq	-48(%rbp), %rax
	cmpq	%rax, (%r13)
	je	LBB0_16
## %bb.12:
	movq	%rax, (%r13)
	movq	%r13, %rdi
	callq	_kone_set_settings_checksum
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_kone_set_settings
	testl	%eax, %eax
	je	LBB0_15
## %bb.13:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_kone_get_settings
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_17
## %bb.14:
	xorl	%ebx, %ebx
	jmp	LBB0_18
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_15:
	movl	16(%r15), %esi
	movq	%r15, %rdi
	callq	_kone_profile_activated
LBB0_16:
	movl	%r14d, %ebx
LBB0_17:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
LBB0_18:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"couldn't set tcu state\n"

L_.str.1:                               ## @.str.1
	.asciz	"couldn't read settings\n"

	.no_dead_strip	_kone_sysfs_set_tcu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kone_sysfs_set_tcu
_kone_sysfs_set_tcu:                    ; @kone_sysfs_set_tcu
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x3
	mov	x22, x2
	ldr	x8, [x0]
	ldr	x21, [x8]
	mov	x0, x21
	bl	_dev_get_drvdata
	bl	_hid_get_drvdata
	mov	x19, x0
	mov	x0, x21
	bl	_to_usb_interface
	bl	_interface_to_usbdev
	mov	x21, x0
	add	x2, sp, #8
	mov	x0, x22
	mov	w1, #10
	bl	_kstrtoul
	mov	x22, x0
	cbnz	w0, LBB0_18
; %bb.1:
	ldr	x8, [sp, #8]
	cmp	x8, #2
	b.hs	LBB0_13
; %bb.2:
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [sp, #8]
	cmp	x8, #1
	b.ne	LBB0_9
; %bb.3:
	mov	x0, x21
	mov	w1, #1
	bl	_kone_tcu_command
	mov	x22, x0
	cbnz	w0, LBB0_17
; %bb.4:
	mov	x0, x21
	mov	w1, #2
	bl	_kone_tcu_command
	mov	x22, x0
	cbnz	w0, LBB0_17
; %bb.5:
	mov	w0, #5
	bl	_ssleep
	mov	x0, x21
	mov	w1, #3
	bl	_kone_tcu_command
	mov	x22, x0
	cbnz	w0, LBB0_17
; %bb.6:
	mov	x0, x21
	mov	w1, #0
	bl	_kone_tcu_command
	mov	x22, x0
	cbnz	w0, LBB0_17
; %bb.7:
	mov	x0, x21
	mov	w1, #4
	bl	_kone_tcu_command
	mov	x22, x0
	cbnz	w0, LBB0_17
; %bb.8:
	mov	w0, #1
	bl	_ssleep
LBB0_9:
	add	x23, x19, #8
	mov	x0, x21
	mov	x1, x23
	bl	_kone_get_settings
	mov	x22, x0
	cbnz	w0, LBB0_16
; %bb.10:
	ldr	x9, [x23]
	ldr	x8, [sp, #8]
	cmp	x9, x8
	b.eq	LBB0_15
; %bb.11:
	str	x8, [x23]
	mov	x0, x23
	bl	_kone_set_settings_checksum
	mov	x0, x21
	mov	x1, x23
	bl	_kone_set_settings
	cbz	w0, LBB0_14
; %bb.12:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	mov	x0, x21
	mov	x1, x23
	bl	_kone_get_settings
	mov	x22, x0
	cbnz	w0, LBB0_16
	b	LBB0_17
LBB0_13:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_18
LBB0_14:
	ldr	w1, [x19, #16]
	mov	x0, x19
	bl	_kone_profile_activated
LBB0_15:
	mov	x22, x20
LBB0_16:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
LBB0_17:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_18:
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"couldn't set tcu state\n"

l_.str.1:                               ; @.str.1
	.asciz	"couldn't read settings\n"

	.no_dead_strip	_kone_sysfs_set_tcu
.subsections_via_symbols
