	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function altera_ps_write_init
_altera_ps_write_init:                  ## @altera_ps_write_init
	.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, %rbx
	movq	8(%rdi), %r14
	movl	(%rsi), %eax
	movl	%eax, (%r14)
	movq	_FPGA_MGR_PARTIAL_RECONFIG@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%r15d, %r15d
LBB0_10:
	subl	(%rax), %r15d
LBB0_11:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	20(%r14), %edi
	movl	$1, %esi
	callq	_gpiod_set_value_cansleep
	movq	8(%r14), %rax
	movl	12(%rax), %edi
	callq	_altera_ps_delay
	movl	16(%r14), %edi
	callq	_gpiod_get_value_cansleep
	testl	%eax, %eax
	je	LBB0_8
## %bb.3:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	20(%r14), %edi
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_gpiod_set_value_cansleep
	movq	8(%r14), %rax
	movl	(%rax), %r12d
	movl	4(%rax), %eax
	cltd
	idivl	%r12d
	movl	%eax, %ebx
	cmpl	$1, %edx
	sbbl	$-1, %ebx
	testl	%ebx, %ebx
	jle	LBB0_7
## %bb.4:
	leal	10(%r12), %r13d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_usleep_range
	movl	16(%r14), %edi
	callq	_gpiod_get_value_cansleep
	testl	%eax, %eax
	je	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	decl	%ebx
	jne	LBB0_5
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_12:
	movq	8(%r14), %rax
	movl	8(%rax), %edi
	callq	_altera_ps_delay
	xorl	%r15d, %r15d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_FPGA_MGR_PARTIAL_RECONFIG,4,2  ## @FPGA_MGR_PARTIAL_RECONFIG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Partial reconfiguration not supported.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Status pin failed to show a reset\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"Status pin not ready.\n"

	.no_dead_strip	_altera_ps_write_init
.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_init
_altera_ps_write_init:                  ; @altera_ps_write_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	x22, [x0, #8]
	ldr	w8, [x1]
	str	w8, [x22]
Lloh0:
	adrp	x9, _FPGA_MGR_PARTIAL_RECONFIG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FPGA_MGR_PARTIAL_RECONFIG@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_2:
	ldr	w0, [x22, #20]
	mov	w1, #1
	bl	_gpiod_set_value_cansleep
	ldr	x8, [x22, #8]
	ldr	w0, [x8, #12]
	bl	_altera_ps_delay
	ldr	w0, [x22, #16]
	bl	_gpiod_get_value_cansleep
	cbz	w0, LBB0_8
; %bb.3:
	ldr	w0, [x22, #20]
	mov	w1, #0
	bl	_gpiod_set_value_cansleep
	ldr	x8, [x22, #8]
	ldp	w20, w8, [x8]
	sdiv	w9, w8, w20
	msub	w8, w9, w20, w8
	cmp	w8, #0
	cinc	w23, w9, ne
	cmp	w23, #1
	b.lt	LBB0_7
; %bb.4:
	add	w21, w20, #10
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_usleep_range
	ldr	w0, [x22, #16]
	bl	_gpiod_get_value_cansleep
	cbz	w0, LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	subs	w23, w23, #1
	b.ne	LBB0_5
LBB0_7:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_9:
	mov	x0, x19
	bl	_dev_err
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	x8, [x22, #8]
	ldr	w0, [x8, #8]
	bl	_altera_ps_delay
	mov	w0, #0
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_FPGA_MGR_PARTIAL_RECONFIG,4,2  ; @FPGA_MGR_PARTIAL_RECONFIG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Partial reconfiguration not supported.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Status pin failed to show a reset\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"Status pin not ready.\n"

	.no_dead_strip	_altera_ps_write_init
.subsections_via_symbols
