	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function p54spi_op_start
_p54spi_op_start:                       ## @p54spi_op_start
	.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	%rdi, %rbx
	movq	(%rdi), %r15
	leaq	8(%r15), %r14
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINTR@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_2:
	movq	_FW_STATE_BOOTING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	movq	%r15, %rdi
	callq	_p54spi_power_on
	movq	%rbx, %rdi
	callq	_p54spi_upload_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	$2000, %edi                     ## imm = 0x7D0
	callq	_msecs_to_jiffies
	leaq	24(%r15), %rdi
	movq	%rax, %rsi
	callq	_wait_for_completion_interruptible_timeout
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_EINTR@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_p54spi_power_off
	jmp	LBB0_10
LBB0_3:
	movq	%r15, %rdi
	callq	_p54spi_power_off
	jmp	LBB0_9
LBB0_5:
	movq	16(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	%r15, %rdi
	callq	_p54spi_power_off
	movl	$-1, %ebx
	jmp	LBB0_10
LBB0_8:
	movq	(%r15), %rax
	movq	_FW_STATE_READY@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_WARN_ON
LBB0_9:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_FW_STATE_BOOTING,8,3           ## @FW_STATE_BOOTING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"firmware boot failed"

	.comm	_FW_STATE_READY,8,3             ## @FW_STATE_READY
	.no_dead_strip	_p54spi_op_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function p54spi_op_start
_p54spi_op_start:                       ; @p54spi_op_start
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x0
	ldr	x19, [x0]
	add	x20, x19, #8
	mov	x0, x20
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINTR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_2:
Lloh3:
	adrp	x8, _FW_STATE_BOOTING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FW_STATE_BOOTING@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [x19]
	mov	x0, x19
	bl	_p54spi_power_on
	mov	x0, x21
	bl	_p54spi_upload_firmware
	mov	x21, x0
	tbnz	w0, #31, LBB0_6
; %bb.3:
	mov	x0, x20
	bl	_mutex_unlock
	mov	w0, #2000
	bl	_msecs_to_jiffies
	mov	x1, x0
	add	x0, x19, #24
	bl	_wait_for_completion_interruptible_timeout
	cbz	x0, LBB0_7
; %bb.4:
	mov	x0, x20
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_8
; %bb.5:
Lloh6:
	adrp	x8, _EINTR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
	mov	x0, x19
	bl	_p54spi_power_off
	b	LBB0_10
LBB0_6:
	mov	x0, x19
	bl	_p54spi_power_off
	b	LBB0_9
LBB0_7:
	ldr	x0, [x19, #16]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x0, x19
	bl	_p54spi_power_off
	mov	w21, #-1
	b	LBB0_10
LBB0_8:
	ldr	x8, [x19]
Lloh11:
	adrp	x9, _FW_STATE_READY@GOTPAGE
Lloh12:
	ldr	x9, [x9, _FW_STATE_READY@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
	bl	_WARN_ON
LBB0_9:
	mov	x0, x20
	bl	_mutex_unlock
LBB0_10:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_FW_STATE_BOOTING,8,3           ; @FW_STATE_BOOTING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"firmware boot failed"

	.comm	_FW_STATE_READY,8,3             ; @FW_STATE_READY
	.no_dead_strip	_p54spi_op_start
.subsections_via_symbols
