	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spu_init
_spu_init:                              ## @spu_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	$0, (%rdi)
	movq	_IF_SPI_BUS_MODE_SPI_CLOCK_PHASE_RISING@GOTPCREL(%rip), %r15
	movq	_IF_SPI_BUS_MODE_DELAY_METHOD_TIMED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%r15), %eax
	movl	%esi, %r14d
	movq	_IF_SPI_BUS_MODE_16_BIT_ADDRESS_16_BIT_DATA@GOTPCREL(%rip), %r12
	orl	(%r12), %eax
	movl	%eax, %esi
	callq	_spu_set_bus_mode
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movabsq	$4294967297000, %rax            ## imm = 0x3E8000003E8
	movq	%rax, 4(%rbx)
	movq	_IF_SPI_DELAY_READ_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_spu_read_u32
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movl	-36(%rbp), %edx
	movzwl	%dx, %esi
	movl	%esi, 4(%rbx)
	shrl	$16, %edx
	movl	%edx, 8(%rbx)
	testl	%r14d, %r14d
	je	LBB0_5
## %bb.3:
	movl	$1, (%rbx)
	movq	_IF_SPI_BUS_MODE_DELAY_METHOD_DUMMY_CLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r15), %esi
	orl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_spu_set_bus_mode
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:
	movl	4(%rbx), %esi
	movl	8(%rbx), %edx
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_lbs_deb_spi
	xorl	%eax, %eax
LBB0_6:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IF_SPI_BUS_MODE_SPI_CLOCK_PHASE_RISING,4,2 ## @IF_SPI_BUS_MODE_SPI_CLOCK_PHASE_RISING
	.comm	_IF_SPI_BUS_MODE_DELAY_METHOD_TIMED,4,2 ## @IF_SPI_BUS_MODE_DELAY_METHOD_TIMED
	.comm	_IF_SPI_BUS_MODE_16_BIT_ADDRESS_16_BIT_DATA,4,2 ## @IF_SPI_BUS_MODE_16_BIT_ADDRESS_16_BIT_DATA
	.comm	_IF_SPI_DELAY_READ_REG,4,2      ## @IF_SPI_DELAY_READ_REG
	.comm	_IF_SPI_BUS_MODE_DELAY_METHOD_DUMMY_CLOCK,4,2 ## @IF_SPI_BUS_MODE_DELAY_METHOD_DUMMY_CLOCK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Initialized SPU unit. spu_port_delay=0x%04lx, spu_reg_delay=0x%04lx\n"

	.no_dead_strip	_spu_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spu_init
_spu_init:                              ; @spu_init
	.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	x20, x1
	mov	x19, x0
	str	wzr, [x0]
Lloh0:
	adrp	x21, _IF_SPI_BUS_MODE_SPI_CLOCK_PHASE_RISING@GOTPAGE
Lloh1:
	ldr	x21, [x21, _IF_SPI_BUS_MODE_SPI_CLOCK_PHASE_RISING@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh2:
	adrp	x9, _IF_SPI_BUS_MODE_DELAY_METHOD_TIMED@GOTPAGE
Lloh3:
	ldr	x9, [x9, _IF_SPI_BUS_MODE_DELAY_METHOD_TIMED@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh5:
	adrp	x22, _IF_SPI_BUS_MODE_16_BIT_ADDRESS_16_BIT_DATA@GOTPAGE
Lloh6:
	ldr	x22, [x22, _IF_SPI_BUS_MODE_16_BIT_ADDRESS_16_BIT_DATA@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w1, w8, w9
	bl	_spu_set_bus_mode
	cbnz	w0, LBB0_6
; %bb.1:
	mov	w8, #1000
	dup.2s	v0, w8
	stur	d0, [x19, #4]
Lloh7:
	adrp	x8, _IF_SPI_DELAY_READ_REG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IF_SPI_DELAY_READ_REG@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_spu_read_u32
	cbnz	w0, LBB0_6
; %bb.2:
	ldr	w8, [sp, #12]
	and	w1, w8, #0xffff
	lsr	w2, w8, #16
	stp	w1, w2, [x19, #4]
	cbz	w20, LBB0_5
; %bb.3:
	mov	w8, #1
	str	w8, [x19]
	ldr	w8, [x21]
Lloh10:
	adrp	x9, _IF_SPI_BUS_MODE_DELAY_METHOD_DUMMY_CLOCK@GOTPAGE
Lloh11:
	ldr	x9, [x9, _IF_SPI_BUS_MODE_DELAY_METHOD_DUMMY_CLOCK@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x22]
	orr	w1, w8, w9
	mov	x0, x19
	bl	_spu_set_bus_mode
	cbnz	w0, LBB0_6
; %bb.4:
	ldp	w1, w2, [x19, #4]
LBB0_5:
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_lbs_deb_spi
	mov	w0, #0
LBB0_6:
	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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_IF_SPI_BUS_MODE_SPI_CLOCK_PHASE_RISING,4,2 ; @IF_SPI_BUS_MODE_SPI_CLOCK_PHASE_RISING
	.comm	_IF_SPI_BUS_MODE_DELAY_METHOD_TIMED,4,2 ; @IF_SPI_BUS_MODE_DELAY_METHOD_TIMED
	.comm	_IF_SPI_BUS_MODE_16_BIT_ADDRESS_16_BIT_DATA,4,2 ; @IF_SPI_BUS_MODE_16_BIT_ADDRESS_16_BIT_DATA
	.comm	_IF_SPI_DELAY_READ_REG,4,2      ; @IF_SPI_DELAY_READ_REG
	.comm	_IF_SPI_BUS_MODE_DELAY_METHOD_DUMMY_CLOCK,4,2 ; @IF_SPI_BUS_MODE_DELAY_METHOD_DUMMY_CLOCK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Initialized SPU unit. spu_port_delay=0x%04lx, spu_reg_delay=0x%04lx\n"

	.no_dead_strip	_spu_init
.subsections_via_symbols
