	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lp55xx_store_engine_select
_lp55xx_store_engine_select:            ## @lp55xx_store_engine_select
	.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, %r13
	movq	%rdi, %r15
	callq	_to_i2c_client
	movl	%eax, %edi
	callq	_i2c_get_clientdata
	movq	(%rax), %r12
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %rdx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_kstrtoul
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_2:
	movq	-48(%rbp), %rdx
	leaq	-128(%rdx), %rax
	cmpq	$2, %rax
	ja	LBB0_7
## %bb.3:
	leaq	8(%r12), %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	-48(%rbp), %rax
	movq	%rax, (%r12)
	movq	%r12, %rdi
	callq	_lp55xx_request_firmware
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_dev_err
	jmp	LBB0_6
LBB0_7:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_5:
	movl	%r14d, %ebx
LBB0_6:
	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	"%lu: invalid engine index. (1, 2, 3)\n"

L_.str.1:                               ## @.str.1
	.asciz	"request firmware err: %d\n"

	.no_dead_strip	_lp55xx_store_engine_select
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lp55xx_store_engine_select
_lp55xx_store_engine_select:            ; @lp55xx_store_engine_select
	.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
	mov	x20, x3
	mov	x22, x2
	mov	x19, x0
	bl	_to_i2c_client
	bl	_i2c_get_clientdata
	ldr	x21, [x0]
	add	x2, sp, #8
	mov	x0, x22
	mov	w1, #0
	bl	_kstrtoul
	cbnz	x0, LBB0_5
; %bb.1:
	ldr	x2, [sp, #8]
	sub	x8, x2, #128
	cmp	x8, #2
	b.hi	LBB0_4
; %bb.2:
	add	x22, x21, #8
	mov	x0, x22
	bl	_mutex_lock
	ldr	x8, [sp, #8]
	str	x8, [x21]
	mov	x0, x21
	bl	_lp55xx_request_firmware
	mov	x21, x0
	mov	x0, x22
	bl	_mutex_unlock
	cbz	w21, LBB0_7
; %bb.3:
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dev_err
	b	LBB0_6
LBB0_4:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_dev_err
LBB0_5:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_6:
	mov	x0, x21
	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
LBB0_7:
	mov	x21, x20
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%lu: invalid engine index. (1, 2, 3)\n"

l_.str.1:                               ; @.str.1
	.asciz	"request firmware err: %d\n"

	.no_dead_strip	_lp55xx_store_engine_select
.subsections_via_symbols
