	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mv_spi_attach
_mv_spi_attach:                         ## @mv_spi_attach
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	%r14d, 36(%rax)
	movl	$0, -44(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	leaq	-44(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rdi
	callq	_rman_get_bustag
	movl	%eax, 32(%rbx)
	movq	8(%rbx), %rdi
	callq	_rman_get_bushandle
	movl	%eax, 28(%rbx)
	movl	$0, -44(%rbp)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	(%r15), %ecx
	leaq	-44(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	_MV_SPI_CONTROL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_MV_SPI_READ
	movl	(%r15), %esi
	movq	_MV_SPI_CTRL_CS_ACTIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	%rbx, %rdi
	callq	_MV_SPI_WRITE
	movq	_MV_SPI_CONF@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_MV_SPI_READ
	movl	(%r15), %esi
	movq	_MV_SPI_CONF_BYTELEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	%rbx, %rdi
	callq	_MV_SPI_WRITE
	movq	_MV_SPI_INTR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_MV_SPI_WRITE
	movq	_MV_SPI_INTR_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_MV_SPI_WRITE
	movq	_INTR_TYPE_MISC@GOTPCREL(%rip), %rax
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	16(%rbx), %rsi
	movq	_mv_spi_intr@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rax
	addq	$24, %rax
	movq	%rax, (%rsp)
	movl	%r14d, %edi
	xorl	%ecx, %ecx
	movq	%rbx, %r9
	callq	_bus_setup_intr
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	(%r13), %esi
	movq	16(%rbx), %rcx
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
	movl	(%r12), %esi
	movq	8(%rbx), %rcx
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	movl	(%r12), %esi
	movq	8(%rbx), %rcx
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movl	%r14d, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_8:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_MTX_DEF@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mtx_init
	leaq	L_.str.4(%rip), %rsi
	movl	%r14d, %edi
	movl	$-1, %edx
	callq	_device_add_child
	movq	_bus_generic_attach@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_config_intrhook_oneshot
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot allocate memory window\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
L_.str.1:                               ## @.str.1
	.asciz	"cannot allocate interrupt\n"

	.comm	_MV_SPI_CONTROL,4,2             ## @MV_SPI_CONTROL
	.comm	_MV_SPI_CTRL_CS_ACTIVE,4,2      ## @MV_SPI_CTRL_CS_ACTIVE
	.comm	_MV_SPI_CONF,4,2                ## @MV_SPI_CONF
	.comm	_MV_SPI_CONF_BYTELEN,4,2        ## @MV_SPI_CONF_BYTELEN
	.comm	_MV_SPI_INTR_MASK,4,2           ## @MV_SPI_INTR_MASK
	.comm	_MV_SPI_INTR_STAT,4,2           ## @MV_SPI_INTR_STAT
	.comm	_INTR_TYPE_MISC,4,2             ## @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_mv_spi_intr,4,2                ## @mv_spi_intr
L_.str.2:                               ## @.str.2
	.asciz	"cannot setup the interrupt handler\n"

L_.str.3:                               ## @.str.3
	.asciz	"mv_spi"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
L_.str.4:                               ## @.str.4
	.asciz	"spibus"

	.comm	_bus_generic_attach,8,3         ## @bus_generic_attach
	.no_dead_strip	_mv_spi_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mv_spi_attach
_mv_spi_attach:                         ; @mv_spi_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	str	w19, [x0, #36]
	str	wzr, [sp, #12]
Lloh0:
	adrp	x21, _SYS_RES_MEMORY@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh2:
	adrp	x23, _RF_ACTIVE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w3, [x23]
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20, #8]
	cbz	x0, LBB0_4
; %bb.1:
	bl	_rman_get_bustag
	str	w0, [x20, #32]
	ldr	x0, [x20, #8]
	bl	_rman_get_bushandle
	str	w0, [x20, #28]
	str	wzr, [sp, #12]
Lloh4:
	adrp	x22, _SYS_RES_IRQ@GOTPAGE
Lloh5:
	ldr	x22, [x22, _SYS_RES_IRQ@GOTPAGEOFF]
	ldr	w1, [x22]
	ldr	w3, [x23]
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20, #16]
	cbz	x0, LBB0_5
; %bb.2:
Lloh6:
	adrp	x23, _MV_SPI_CONTROL@GOTPAGE
Lloh7:
	ldr	x23, [x23, _MV_SPI_CONTROL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_MV_SPI_READ
	ldr	w1, [x23]
Lloh8:
	adrp	x8, _MV_SPI_CTRL_CS_ACTIVE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MV_SPI_CTRL_CS_ACTIVE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	bic	w2, w0, w8
	mov	x0, x20
	bl	_MV_SPI_WRITE
Lloh11:
	adrp	x23, _MV_SPI_CONF@GOTPAGE
Lloh12:
	ldr	x23, [x23, _MV_SPI_CONF@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_MV_SPI_READ
	ldr	w1, [x23]
Lloh13:
	adrp	x8, _MV_SPI_CONF_BYTELEN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MV_SPI_CONF_BYTELEN@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	bic	w2, w0, w8
	mov	x0, x20
	bl	_MV_SPI_WRITE
Lloh16:
	adrp	x8, _MV_SPI_INTR_MASK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MV_SPI_INTR_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_MV_SPI_WRITE
Lloh19:
	adrp	x8, _MV_SPI_INTR_STAT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MV_SPI_INTR_STAT@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_MV_SPI_WRITE
	ldr	x1, [x20, #16]
Lloh22:
	adrp	x8, _INTR_TYPE_MISC@GOTPAGE
Lloh23:
	ldr	x8, [x8, _INTR_TYPE_MISC@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _INTR_MPSAFE@GOTPAGE
Lloh26:
	ldr	x9, [x9, _INTR_MPSAFE@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh28:
	adrp	x8, _mv_spi_intr@GOTPAGE
Lloh29:
	ldr	x8, [x8, _mv_spi_intr@GOTPAGEOFF]
Lloh30:
	ldr	w4, [x8]
	add	x6, x20, #24
	mov	x0, x19
	mov	x3, #0
	mov	x5, x20
	bl	_bus_setup_intr
	cbz	x0, LBB0_8
; %bb.3:
	ldr	w1, [x22]
	ldr	x3, [x20, #16]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
	ldr	w1, [x21]
	ldr	x3, [x20, #8]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
Lloh31:
	adrp	x1, l_.str.2@PAGE
Lloh32:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh33:
	adrp	x1, l_.str@PAGE
Lloh34:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
	ldr	w1, [x21]
	ldr	x3, [x20, #8]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
Lloh35:
	adrp	x1, l_.str.1@PAGE
Lloh36:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_device_printf
Lloh37:
	adrp	x8, _ENXIO@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
LBB0_7:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_8:
Lloh40:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh41:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
Lloh42:
	ldr	w3, [x8]
Lloh43:
	adrp	x1, l_.str.3@PAGE
Lloh44:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x2, #0
	bl	_mtx_init
Lloh45:
	adrp	x1, l_.str.4@PAGE
Lloh46:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	w2, #-1
	bl	_device_add_child
Lloh47:
	adrp	x8, _bus_generic_attach@GOTPAGE
Lloh48:
	ldr	x8, [x8, _bus_generic_attach@GOTPAGEOFF]
Lloh49:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_config_intrhook_oneshot
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot allocate memory window\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
l_.str.1:                               ; @.str.1
	.asciz	"cannot allocate interrupt\n"

	.comm	_MV_SPI_CONTROL,4,2             ; @MV_SPI_CONTROL
	.comm	_MV_SPI_CTRL_CS_ACTIVE,4,2      ; @MV_SPI_CTRL_CS_ACTIVE
	.comm	_MV_SPI_CONF,4,2                ; @MV_SPI_CONF
	.comm	_MV_SPI_CONF_BYTELEN,4,2        ; @MV_SPI_CONF_BYTELEN
	.comm	_MV_SPI_INTR_MASK,4,2           ; @MV_SPI_INTR_MASK
	.comm	_MV_SPI_INTR_STAT,4,2           ; @MV_SPI_INTR_STAT
	.comm	_INTR_TYPE_MISC,4,2             ; @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_mv_spi_intr,4,2                ; @mv_spi_intr
l_.str.2:                               ; @.str.2
	.asciz	"cannot setup the interrupt handler\n"

l_.str.3:                               ; @.str.3
	.asciz	"mv_spi"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
l_.str.4:                               ; @.str.4
	.asciz	"spibus"

	.comm	_bus_generic_attach,8,3         ; @bus_generic_attach
	.no_dead_strip	_mv_spi_attach
.subsections_via_symbols
