	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ice40_fpga_ops_write_init
_ice40_fpga_ops_write_init:             ## @ice40_fpga_ops_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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r15
	movq	8(%r15), %r14
	movl	$1, -48(%rbp)
	movq	_ICE40_SPI_RESET_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	$0, -40(%rbp)
	movq	_ICE40_SPI_HOUSEKEEPING_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movq	_FPGA_MGR_PARTIAL_RECONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_2
## %bb.1:
	addq	$4, %r14
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_2:
	movl	(%r14), %edi
	callq	_spi_bus_lock
	movl	4(%r15), %edi
	movl	$1, %esi
	callq	_gpiod_set_value
	leaq	-32(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_spi_message_init
	leaq	-48(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_spi_message_add_tail
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_spi_sync_locked
	movl	%eax, %ebx
	movl	4(%r15), %edi
	xorl	%esi, %esi
	callq	_gpiod_set_value
	testl	%ebx, %ebx
	jne	LBB0_6
## %bb.3:
	movl	(%r15), %edi
	callq	_gpiod_get_value
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	4(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_5:
	leaq	-32(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_spi_message_init
	leaq	-40(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_spi_message_add_tail
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_spi_sync_locked
	movl	%eax, %ebx
LBB0_6:
	movl	(%r14), %edi
	callq	_spi_bus_unlock
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ICE40_SPI_RESET_DELAY,4,2      ## @ICE40_SPI_RESET_DELAY
	.comm	_ICE40_SPI_HOUSEKEEPING_DELAY,4,2 ## @ICE40_SPI_HOUSEKEEPING_DELAY
	.comm	_FPGA_MGR_PARTIAL_RECONFIG,4,2  ## @FPGA_MGR_PARTIAL_RECONFIG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Partial reconfiguration is not supported\n"

	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
L_.str.1:                               ## @.str.1
	.asciz	"Device reset failed, CDONE is asserted\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_ice40_fpga_ops_write_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ice40_fpga_ops_write_init
_ice40_fpga_ops_write_init:             ; @ice40_fpga_ops_write_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	ldr	x21, [x0]
	ldr	x19, [x21, #8]
	mov	w8, #1
Lloh0:
	adrp	x9, _ICE40_SPI_RESET_DELAY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ICE40_SPI_RESET_DELAY@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #16]
Lloh3:
	adrp	x8, _ICE40_SPI_HOUSEKEEPING_DELAY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ICE40_SPI_HOUSEKEEPING_DELAY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	stp	wzr, w8, [sp, #8]
	ldr	w8, [x1]
Lloh6:
	adrp	x9, _FPGA_MGR_PARTIAL_RECONFIG@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FPGA_MGR_PARTIAL_RECONFIG@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	add	x0, x19, #4
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh11:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_2:
	ldr	w0, [x19]
	bl	_spi_bus_lock
	ldr	w0, [x21, #4]
	mov	w1, #1
	bl	_gpiod_set_value
	add	x0, sp, #24
	bl	_spi_message_init
	add	x0, sp, #16
	add	x1, sp, #24
	bl	_spi_message_add_tail
	add	x1, sp, #24
	mov	x0, x19
	bl	_spi_sync_locked
	mov	x20, x0
	ldr	w0, [x21, #4]
	mov	w1, #0
	bl	_gpiod_set_value
	cbnz	w20, LBB0_6
; %bb.3:
	ldr	w0, [x21]
	bl	_gpiod_get_value
	cbz	x0, LBB0_5
; %bb.4:
	add	x0, x19, #4
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_6
LBB0_5:
	add	x0, sp, #24
	bl	_spi_message_init
	add	x0, sp, #8
	add	x1, sp, #24
	bl	_spi_message_add_tail
	add	x1, sp, #24
	mov	x0, x19
	bl	_spi_sync_locked
	mov	x20, x0
LBB0_6:
	ldr	w0, [x19]
	bl	_spi_bus_unlock
LBB0_7:
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ICE40_SPI_RESET_DELAY,4,2      ; @ICE40_SPI_RESET_DELAY
	.comm	_ICE40_SPI_HOUSEKEEPING_DELAY,4,2 ; @ICE40_SPI_HOUSEKEEPING_DELAY
	.comm	_FPGA_MGR_PARTIAL_RECONFIG,4,2  ; @FPGA_MGR_PARTIAL_RECONFIG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Partial reconfiguration is not supported\n"

	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
l_.str.1:                               ; @.str.1
	.asciz	"Device reset failed, CDONE is asserted\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_ice40_fpga_ops_write_init
.subsections_via_symbols
