	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vpu_load_firmware              ## -- Begin function vpu_load_firmware
	.p2align	4, 0x90
_vpu_load_firmware:                     ## @vpu_load_firmware
	.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	%rdi, %r12
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%r12, %rdi
	callq	_platform_get_drvdata
	movq	%rax, %r15
	leaq	4(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r15), %ebx
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%r13d, %r13d
	testl	%ebx, %ebx
	jne	LBB0_17
## %bb.3:
	movq	%r15, %rdi
	callq	_vpu_clock_enable
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_17
LBB0_1:
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
LBB0_17:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	$0, 12(%r15)
	movl	8(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
	movq	_P_FW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_load_requested_vpu
	testl	%eax, %eax
	js	LBB0_6
## %bb.8:
	movq	_D_FW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_load_requested_vpu
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movl	$1, (%r15)
	movq	_VPU_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_vpu_cfg_writel
	movl	12(%r15), %r13d
	movl	20(%r15), %ebx
	movq	_INIT_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movl	%ebx, %edi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_wait_event_interruptible_timeout
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:
	movl	%eax, %r13d
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r13d, %eax
	jne	LBB0_15
## %bb.13:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_14
LBB0_6:
	movl	%eax, %r13d
	movq	_VPU_P_FW@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_9:
	movl	%eax, %r13d
	movq	_VPU_D_FW@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %edx
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_16
LBB0_11:
	movq	_ETIME@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	leaq	L_.str.4(%rip), %rsi
LBB0_14:
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_16
LBB0_15:
	movl	16(%r15), %edx
	leaq	L_.str.6(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_info
	xorl	%r13d, %r13d
LBB0_16:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r15, %rdi
	callq	_vpu_clock_disable
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VPU platform device is invalid\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"enable clock failed %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"firmware request\n"

	.comm	_P_FW,4,2                       ## @P_FW
L_.str.3:                               ## @.str.3
	.asciz	"Failed to request %s, %d\n"

	.comm	_VPU_P_FW,4,2                   ## @VPU_P_FW
	.comm	_D_FW,4,2                       ## @D_FW
	.comm	_VPU_D_FW,4,2                   ## @VPU_D_FW
	.comm	_VPU_RESET,4,2                  ## @VPU_RESET
	.comm	_INIT_TIMEOUT_MS,4,2            ## @INIT_TIMEOUT_MS
	.comm	_ETIME,4,2                      ## @ETIME
L_.str.4:                               ## @.str.4
	.asciz	"wait vpu initialization timeout!\n"

	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
L_.str.5:                               ## @.str.5
	.asciz	"wait vpu interrupted by a signal!\n"

L_.str.6:                               ## @.str.6
	.asciz	"vpu is ready. Fw version %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vpu_load_firmware              ; -- Begin function vpu_load_firmware
	.p2align	2
_vpu_load_firmware:                     ; @vpu_load_firmware
	.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	x21, x0
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x21
	bl	_platform_get_drvdata
	mov	x19, x0
	add	x20, x0, #4
	mov	x0, x20
	bl	_mutex_lock
	ldr	w22, [x19]
	mov	x0, x20
	bl	_mutex_unlock
	cbz	w22, LBB0_4
; %bb.2:
	mov	w22, #0
	b	LBB0_18
LBB0_3:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_18
LBB0_4:
	mov	x0, x19
	bl	_vpu_clock_enable
	cbz	w0, LBB0_6
; %bb.5:
	mov	x22, x0
	str	x22, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	b	LBB0_18
LBB0_6:
	mov	x0, x20
	bl	_mutex_lock
	str	wzr, [x19, #12]
	ldr	w0, [x19, #8]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
Lloh9:
	adrp	x8, _P_FW@GOTPAGE
Lloh10:
	ldr	x8, [x8, _P_FW@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_load_requested_vpu
	tbnz	w0, #31, LBB0_11
; %bb.7:
Lloh12:
	adrp	x8, _D_FW@GOTPAGE
Lloh13:
	ldr	x8, [x8, _D_FW@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_load_requested_vpu
	tbnz	w0, #31, LBB0_12
; %bb.8:
	mov	w8, #1
	str	w8, [x19]
Lloh15:
	adrp	x8, _VPU_RESET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VPU_RESET@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #1
	bl	_vpu_cfg_writel
	ldr	w22, [x19, #20]
	ldr	w23, [x19, #12]
Lloh18:
	adrp	x8, _INIT_TIMEOUT_MS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _INIT_TIMEOUT_MS@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_wait_event_interruptible_timeout
	cbz	w0, LBB0_14
; %bb.9:
	mov	x22, x0
Lloh21:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_16
; %bb.10:
Lloh24:
	adrp	x1, l_.str.5@PAGE
Lloh25:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_15
LBB0_11:
	mov	x22, x0
Lloh26:
	adrp	x8, _VPU_P_FW@GOTPAGE
Lloh27:
	ldr	x8, [x8, _VPU_P_FW@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
	mov	x22, x0
Lloh28:
	adrp	x8, _VPU_D_FW@GOTPAGE
Lloh29:
	ldr	x8, [x8, _VPU_D_FW@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	stp	x8, x22, [sp]
Lloh30:
	adrp	x1, l_.str.3@PAGE
Lloh31:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_dev_err
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	b	LBB0_17
LBB0_14:
Lloh32:
	adrp	x8, _ETIME@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	neg	w22, w8
Lloh35:
	adrp	x1, l_.str.4@PAGE
Lloh36:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_15:
	mov	x0, x21
	bl	_dev_err
	b	LBB0_17
LBB0_16:
	ldr	w2, [x19, #16]
Lloh37:
	adrp	x1, l_.str.6@PAGE
Lloh38:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x21
	bl	_dev_info
	mov	w22, #0
LBB0_17:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	bl	_vpu_clock_disable
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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VPU platform device is invalid\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"enable clock failed %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"firmware request\n"

	.comm	_P_FW,4,2                       ; @P_FW
l_.str.3:                               ; @.str.3
	.asciz	"Failed to request %s, %d\n"

	.comm	_VPU_P_FW,4,2                   ; @VPU_P_FW
	.comm	_D_FW,4,2                       ; @D_FW
	.comm	_VPU_D_FW,4,2                   ; @VPU_D_FW
	.comm	_VPU_RESET,4,2                  ; @VPU_RESET
	.comm	_INIT_TIMEOUT_MS,4,2            ; @INIT_TIMEOUT_MS
	.comm	_ETIME,4,2                      ; @ETIME
l_.str.4:                               ; @.str.4
	.asciz	"wait vpu initialization timeout!\n"

	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
l_.str.5:                               ; @.str.5
	.asciz	"wait vpu interrupted by a signal!\n"

l_.str.6:                               ; @.str.6
	.asciz	"vpu is ready. Fw version %s\n"

.subsections_via_symbols
