	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function altera_ps_write_complete
_altera_ps_write_complete:              ## @altera_ps_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rbx
	movl	16(%rbx), %edi
	callq	_gpiod_get_value_cansleep
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rsi
LBB0_2:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_3:
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.4:
	callq	_gpiod_get_raw_value_cansleep
	testl	%eax, %eax
	je	LBB0_5
LBB0_6:
	movl	(%rbx), %edi
	leaq	_altera_ps_write_complete.dummy(%rip), %rsi
	movl	$1, %edx
	callq	_spi_write
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_9
LBB0_7:
	xorl	%ebx, %ebx
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
_altera_ps_write_complete.dummy:        ## @altera_ps_write_complete.dummy
	.space	1

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error during configuration.\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"CONF_DONE is inactive!\n"

L_.str.2:                               ## @.str.2
	.asciz	"spi error during end sequence: %d\n"

	.no_dead_strip	_altera_ps_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_ps_write_complete
_altera_ps_write_complete:              ; @altera_ps_write_complete
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	x20, [x0, #8]
	ldr	w0, [x20, #16]
	bl	_gpiod_get_value_cansleep
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x19
	bl	_dev_err
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_3:
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_5
; %bb.4:
	bl	_gpiod_get_raw_value_cansleep
	cbz	w0, LBB0_8
LBB0_5:
	ldr	w0, [x20]
Lloh5:
	adrp	x1, _altera_ps_write_complete.dummy@PAGE
Lloh6:
	add	x1, x1, _altera_ps_write_complete.dummy@PAGEOFF
	mov	w2, #1
	bl	_spi_write
	mov	x20, x0
	cbz	w0, LBB0_7
; %bb.6:
	str	x20, [sp]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_8:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_altera_ps_write_complete.dummy:        ; @altera_ps_write_complete.dummy
	.space	1

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error during configuration.\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"CONF_DONE is inactive!\n"

l_.str.2:                               ; @.str.2
	.asciz	"spi error during end sequence: %d\n"

	.no_dead_strip	_altera_ps_write_complete
.subsections_via_symbols
