	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function altera_cvp_teardown
_altera_cvp_teardown:                   ## @altera_cvp_teardown
	.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, %r14
	movq	8(%rdi), %rbx
	movq	_VSE_CVP_PROG_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_altera_read_config_dword
	movq	_VSE_CVP_PROG_CTRL_START_XFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-28(%rbp), %edx
	movl	%edx, -28(%rbp)
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_altera_write_config_dword
	movq	_VSE_CVP_PROG_CTRL_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-28(%rbp), %edx
	movl	%edx, -28(%rbp)
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_altera_write_config_dword
	movq	(%rbx), %rax
	movq	8(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	*%rcx
	movq	(%rbx), %rax
LBB0_2:
	movq	_VSE_CVP_STATUS_CFG_RDY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_altera_cvp_wait_status
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
LBB0_4:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VSE_CVP_PROG_CTRL,4,2          ## @VSE_CVP_PROG_CTRL
	.comm	_VSE_CVP_PROG_CTRL_START_XFER,4,2 ## @VSE_CVP_PROG_CTRL_START_XFER
	.comm	_VSE_CVP_PROG_CTRL_CONFIG,4,2   ## @VSE_CVP_PROG_CTRL_CONFIG
	.comm	_VSE_CVP_STATUS_CFG_RDY,4,2     ## @VSE_CVP_STATUS_CFG_RDY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CFG_RDY == 0 timeout\n"

	.no_dead_strip	_altera_cvp_teardown
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function altera_cvp_teardown
_altera_cvp_teardown:                   ; @altera_cvp_teardown
	.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]
Lloh0:
	adrp	x21, _VSE_CVP_PROG_CTRL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _VSE_CVP_PROG_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x20
	bl	_altera_read_config_dword
Lloh2:
	adrp	x8, _VSE_CVP_PROG_CTRL_START_XFER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VSE_CVP_PROG_CTRL_START_XFER@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_altera_write_config_dword
Lloh5:
	adrp	x8, _VSE_CVP_PROG_CTRL_CONFIG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VSE_CVP_PROG_CTRL_CONFIG@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_altera_write_config_dword
	ldr	x8, [x20]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_2
; %bb.1:
	mov	x0, x20
	blr	x9
	ldr	x8, [x20]
LBB0_2:
Lloh8:
	adrp	x9, _VSE_CVP_STATUS_CFG_RDY@GOTPAGE
Lloh9:
	ldr	x9, [x9, _VSE_CVP_STATUS_CFG_RDY@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x9]
	ldr	w3, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_altera_cvp_wait_status
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.3:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_4:
	mov	x0, x20
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_VSE_CVP_PROG_CTRL,4,2          ; @VSE_CVP_PROG_CTRL
	.comm	_VSE_CVP_PROG_CTRL_START_XFER,4,2 ; @VSE_CVP_PROG_CTRL_START_XFER
	.comm	_VSE_CVP_PROG_CTRL_CONFIG,4,2   ; @VSE_CVP_PROG_CTRL_CONFIG
	.comm	_VSE_CVP_STATUS_CFG_RDY,4,2     ; @VSE_CVP_STATUS_CFG_RDY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CFG_RDY == 0 timeout\n"

	.no_dead_strip	_altera_cvp_teardown
.subsections_via_symbols
