	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function altera_cvp_write_complete
_altera_cvp_write_complete:             ## @altera_cvp_write_complete
	.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, %r15
	movq	8(%rdi), %r14
	callq	_altera_cvp_teardown
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	_VSE_UNCOR_ERR_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_altera_read_config_dword
	movq	_VSE_UNCOR_ERR_CVP_CFG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -28(%rbp)
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EPROTO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_3:
	movq	_VSE_CVP_MODE_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_altera_read_config_dword
	movq	_VSE_CVP_MODE_CTRL_HIP_CLK_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_VSE_CVP_MODE_CTRL_CVP_MODE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	notl	%edx
	andl	-28(%rbp), %edx
	movl	%edx, -28(%rbp)
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_altera_write_config_dword
	movq	_VSE_CVP_STATUS_PLD_CLK_IN_USE@GOTPCREL(%rip), %rax
	movq	_VSE_CVP_STATUS_USERMODE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	(%r14), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%edx, %esi
	callq	_altera_cvp_wait_status
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_6
LBB0_4:
	xorl	%ebx, %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VSE_UNCOR_ERR_STATUS,4,2       ## @VSE_UNCOR_ERR_STATUS
	.comm	_VSE_UNCOR_ERR_CVP_CFG_ERR,4,2  ## @VSE_UNCOR_ERR_CVP_CFG_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"detected CVP_CONFIG_ERROR_LATCHED!\n"

	.comm	_EPROTO,4,2                     ## @EPROTO
	.comm	_VSE_CVP_MODE_CTRL,4,2          ## @VSE_CVP_MODE_CTRL
	.comm	_VSE_CVP_MODE_CTRL_HIP_CLK_SEL,4,2 ## @VSE_CVP_MODE_CTRL_HIP_CLK_SEL
	.comm	_VSE_CVP_MODE_CTRL_CVP_MODE,4,2 ## @VSE_CVP_MODE_CTRL_CVP_MODE
	.comm	_VSE_CVP_STATUS_PLD_CLK_IN_USE,4,2 ## @VSE_CVP_STATUS_PLD_CLK_IN_USE
	.comm	_VSE_CVP_STATUS_USERMODE,4,2    ## @VSE_CVP_STATUS_USERMODE
L_.str.1:                               ## @.str.1
	.asciz	"PLD_CLK_IN_USE|USERMODE timeout\n"

	.no_dead_strip	_altera_cvp_write_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function altera_cvp_write_complete
_altera_cvp_write_complete:             ; @altera_cvp_write_complete
	.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	x19, x0
	ldr	x20, [x0, #8]
	bl	_altera_cvp_teardown
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _VSE_UNCOR_ERR_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VSE_UNCOR_ERR_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_altera_read_config_dword
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _VSE_UNCOR_ERR_CVP_CFG_ERR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VSE_UNCOR_ERR_CVP_CFG_ERR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh8:
	adrp	x8, _EPROTO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EPROTO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_5
LBB0_3:
Lloh11:
	adrp	x21, _VSE_CVP_MODE_CTRL@GOTPAGE
Lloh12:
	ldr	x21, [x21, _VSE_CVP_MODE_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x20
	bl	_altera_read_config_dword
Lloh13:
	adrp	x8, _VSE_CVP_MODE_CTRL_HIP_CLK_SEL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _VSE_CVP_MODE_CTRL_HIP_CLK_SEL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _VSE_CVP_MODE_CTRL_CVP_MODE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _VSE_CVP_MODE_CTRL_CVP_MODE@GOTPAGEOFF]
	ldr	w10, [sp, #12]
Lloh18:
	ldr	w9, [x9]
	orr	w8, w8, w9
	bic	w2, w10, w8
	str	w2, [sp, #12]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_altera_write_config_dword
Lloh19:
	adrp	x8, _VSE_CVP_STATUS_PLD_CLK_IN_USE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _VSE_CVP_STATUS_PLD_CLK_IN_USE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	adrp	x9, _VSE_CVP_STATUS_USERMODE@GOTPAGE
Lloh23:
	ldr	x9, [x9, _VSE_CVP_STATUS_USERMODE@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	orr	w1, w9, w8
	ldr	x8, [x20]
	ldr	w3, [x8]
	mov	x0, x20
	mov	x2, x1
	bl	_altera_cvp_wait_status
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.4:
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_5:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_VSE_UNCOR_ERR_STATUS,4,2       ; @VSE_UNCOR_ERR_STATUS
	.comm	_VSE_UNCOR_ERR_CVP_CFG_ERR,4,2  ; @VSE_UNCOR_ERR_CVP_CFG_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"detected CVP_CONFIG_ERROR_LATCHED!\n"

	.comm	_EPROTO,4,2                     ; @EPROTO
	.comm	_VSE_CVP_MODE_CTRL,4,2          ; @VSE_CVP_MODE_CTRL
	.comm	_VSE_CVP_MODE_CTRL_HIP_CLK_SEL,4,2 ; @VSE_CVP_MODE_CTRL_HIP_CLK_SEL
	.comm	_VSE_CVP_MODE_CTRL_CVP_MODE,4,2 ; @VSE_CVP_MODE_CTRL_CVP_MODE
	.comm	_VSE_CVP_STATUS_PLD_CLK_IN_USE,4,2 ; @VSE_CVP_STATUS_PLD_CLK_IN_USE
	.comm	_VSE_CVP_STATUS_USERMODE,4,2    ; @VSE_CVP_STATUS_USERMODE
l_.str.1:                               ; @.str.1
	.asciz	"PLD_CLK_IN_USE|USERMODE timeout\n"

	.no_dead_strip	_altera_cvp_write_complete
.subsections_via_symbols
