	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cuda_attach
_cuda_attach:                           ## @cuda_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_device_get_softc
	movq	%rax, %r15
	movl	%r14d, 124(%rax)
	leaq	112(%rax), %rdx
	movq	$0, 112(%rax)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 104(%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	leaq	96(%r15), %rdx
	movq	$0, 96(%r15)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	(%rbx), %ecx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 88(%r15)
	testq	%rax, %rax
	je	LBB0_3
## %bb.6:
	movq	_INTR_TYPE_MISC@GOTPCREL(%rip), %rcx
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_INTR_ENTROPY@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	_cuda_intr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	leaq	120(%r15), %rcx
	movq	%rcx, (%rsp)
	movl	%r14d, %edi
	movq	%rax, %rsi
	xorl	%ecx, %ecx
	movl	%r14d, %r9d
	callq	_bus_setup_intr
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movl	(%r13), %esi
	movq	104(%r15), %rcx
	movq	112(%r15), %rdx
	movl	%r14d, %edi
	callq	_bus_release_resource
	movl	(%r12), %esi
	movq	88(%r15), %rcx
	movq	96(%r15), %rdx
	jmp	LBB0_4
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movl	(%r13), %esi
	movq	104(%r15), %rcx
	movq	112(%r15), %rdx
LBB0_4:
	movl	%r14d, %edi
	callq	_bus_release_resource
LBB0_5:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_19:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_21
## %bb.20:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	leaq	80(%r15), %rdi
	movq	_MTX_DEF@GOTPCREL(%rip), %rax
	movq	_MTX_RECURSE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	leaq	L_.str.3(%rip), %rsi
	xorl	%edx, %edx
	callq	_mtx_init
	xorps	%xmm0, %xmm0
	movups	%xmm0, 48(%r15)
	movups	%xmm0, 64(%r15)
	movq	_CUDA_NOTREADY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	$0, 40(%r15)
	movl	$-1, (%r15)
	leaq	32(%r15), %rdi
	callq	_STAILQ_INIT
	leaq	28(%r15), %rdi
	callq	_STAILQ_INIT
	movq	%r15, %rbx
	addq	$24, %rbx
	movq	%rbx, %rdi
	callq	_STAILQ_INIT
	movl	$0, -84(%rbp)
	movl	-84(%rbp), %eax
	movq	_CUDA_MAXPACKETS@GOTPCREL(%rip), %r12
	cmpl	(%r12), %eax
	jge	LBB0_11
## %bb.9:
	movq	_pkt_q@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rax
	movslq	-84(%rbp), %rcx
	leaq	(%rax,%rcx,4), %rsi
	movl	(%r13), %edx
	movq	%rbx, %rdi
	callq	_STAILQ_INSERT_TAIL
	incl	-84(%rbp)
	movl	-84(%rbp), %eax
	cmpl	(%r12), %eax
	jl	LBB0_10
LBB0_11:
	movq	_vDirB@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_cuda_read_reg
	orl	$48, %eax
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_cuda_write_reg
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_cuda_read_reg
	andl	$247, %eax
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_cuda_write_reg
	movq	_vACR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_cuda_read_reg
	movq	_vSR_OUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_cuda_write_reg
	movl	(%rbx), %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_cuda_read_reg
                                        ## kill: def $eax killed $eax def $rax
	andl	$-29, %eax
	leal	12(%rax), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_cuda_write_reg
	movq	_CUDA_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	_vIER@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	$132, %edx
	callq	_cuda_write_reg
	movq	%r15, %rdi
	callq	_cuda_idle
	movq	_vSR@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_cuda_read_reg
	movl	%eax, -84(%rbp)
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	$4, %edx
	callq	_cuda_write_reg
	movq	%r15, %rdi
	callq	_cuda_idle
	movl	$150, %edi
	callq	_DELAY
	movq	%r15, %rdi
	callq	_cuda_tip
	movl	$150, %edi
	callq	_DELAY
	movq	%r15, %rdi
	callq	_cuda_toggle_ack
	movl	$150, %edi
	callq	_DELAY
	movq	%r15, %rdi
	callq	_cuda_clear_tip
	movl	$150, %edi
	callq	_DELAY
	movq	%r15, %rdi
	callq	_cuda_idle
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_cuda_read_reg
	movl	%eax, -84(%rbp)
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	$132, %edx
	callq	_cuda_write_reg
	movl	%r14d, %edi
	callq	_ofw_bus_get_node
	movq	%rax, %rdi
	callq	_OF_child
	testq	%rax, %rax
	je	LBB0_18
## %bb.12:
	movq	%rax, %rbx
	leaq	-80(%rbp), %r12
	leaq	L_.str.6(%rip), %r13
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%rbx, %rdi
	callq	_OF_peer
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_18
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	%rbx, %rdi
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdx
	movl	$32, %ecx
	callq	_OF_getprop
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%r14d, %edi
	leaq	L_.str.5(%rip), %rsi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_device_printf
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	$4, %edx
	callq	_strncmp
	testq	%rax, %rax
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%r14d, %edi
	movq	%r13, %rsi
	movl	$-1, %edx
	callq	_device_add_child
	movl	%eax, 4(%r15)
	jmp	LBB0_17
LBB0_18:
	movl	%r14d, %edi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_clock_register
	movq	_shutdown_final@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_cuda_shutdown@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SHUTDOWN_PRI_LAST@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdx
	callq	_EVENTHANDLER_REGISTER
	movl	%r14d, %edi
	callq	_bus_generic_attach
	jmp	LBB0_19
LBB0_21:
	callq	___stack_chk_fail
	.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	"Could not alloc mem resource!\n"

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

	.comm	_INTR_TYPE_MISC,4,2             ## @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_INTR_ENTROPY,4,2               ## @INTR_ENTROPY
	.comm	_cuda_intr,4,2                  ## @cuda_intr
L_.str.2:                               ## @.str.2
	.asciz	"could not setup interrupt\n"

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

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
	.comm	_MTX_RECURSE,4,2                ## @MTX_RECURSE
	.comm	_CUDA_NOTREADY,4,2              ## @CUDA_NOTREADY
	.comm	_CUDA_MAXPACKETS,4,2            ## @CUDA_MAXPACKETS
	.comm	_pkt_q,4,2                      ## @pkt_q
	.comm	_vDirB,4,2                      ## @vDirB
	.comm	_vACR,4,2                       ## @vACR
	.comm	_vSR_OUT,4,2                    ## @vSR_OUT
	.comm	_CUDA_IDLE,4,2                  ## @CUDA_IDLE
	.comm	_vIER,4,2                       ## @vIER
	.comm	_vSR,4,2                        ## @vSR
L_.str.4:                               ## @.str.4
	.asciz	"name"

	.comm	_bootverbose,8,3                ## @bootverbose
L_.str.5:                               ## @.str.5
	.asciz	"CUDA child <%s>\n"

L_.str.6:                               ## @.str.6
	.asciz	"adb"

	.comm	_shutdown_final,4,2             ## @shutdown_final
	.comm	_cuda_shutdown,4,2              ## @cuda_shutdown
	.comm	_SHUTDOWN_PRI_LAST,4,2          ## @SHUTDOWN_PRI_LAST
	.no_dead_strip	_cuda_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cuda_attach
_cuda_attach:                           ; @cuda_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	bl	_device_get_softc
	mov	x20, x0
	str	w19, [x0, #124]
	mov	x2, x0
	str	xzr, [x2, #112]!
Lloh3:
	adrp	x22, _SYS_RES_MEMORY@GOTPAGE
Lloh4:
	ldr	x22, [x22, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh5:
	adrp	x24, _RF_ACTIVE@GOTPAGE
Lloh6:
	ldr	x24, [x24, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w3, [x24]
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20, #104]
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x20
	str	xzr, [x21, #96]!
Lloh7:
	adrp	x23, _SYS_RES_IRQ@GOTPAGE
Lloh8:
	ldr	x23, [x23, _SYS_RES_IRQ@GOTPAGEOFF]
	ldr	w1, [x23]
	ldr	w3, [x24]
	mov	x0, x19
	mov	x2, x21
	bl	_bus_alloc_resource_any
	stur	x0, [x21, #-8]
	cbz	x0, LBB0_5
; %bb.2:
	mov	x1, x0
Lloh9:
	adrp	x8, _INTR_TYPE_MISC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _INTR_TYPE_MISC@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _INTR_MPSAFE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _INTR_MPSAFE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _INTR_ENTROPY@GOTPAGE
Lloh16:
	ldr	x9, [x9, _INTR_ENTROPY@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w2, w8, w9
Lloh18:
	adrp	x8, _cuda_intr@GOTPAGE
Lloh19:
	ldr	x8, [x8, _cuda_intr@GOTPAGEOFF]
Lloh20:
	ldr	w4, [x8]
	add	x6, x20, #120
	mov	x0, x19
	mov	x3, #0
	mov	x5, x19
	bl	_bus_setup_intr
	cbz	x0, LBB0_10
; %bb.3:
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	ldr	w1, [x22]
	ldp	x3, x2, [x20, #104]
	mov	x0, x19
	bl	_bus_release_resource
	ldr	w1, [x23]
	ldp	x3, x2, [x20, #88]
	b	LBB0_6
LBB0_4:
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	b	LBB0_7
LBB0_5:
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	ldr	w1, [x22]
	ldp	x3, x2, [x20, #104]
LBB0_6:
	mov	x0, x19
	bl	_bus_release_resource
LBB0_7:
Lloh27:
	adrp	x8, _ENXIO@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
LBB0_8:
	ldr	x8, [sp, #56]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.9:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_10:
Lloh33:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
	add	x0, x20, #80
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x9, _MTX_RECURSE@GOTPAGE
Lloh37:
	ldr	x9, [x9, _MTX_RECURSE@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w3, w9, w8
Lloh39:
	adrp	x1, l_.str.3@PAGE
Lloh40:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, #0
	bl	_mtx_init
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x20, #48]
Lloh41:
	adrp	x8, _CUDA_NOTREADY@GOTPAGE
Lloh42:
	ldr	x8, [x8, _CUDA_NOTREADY@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	str	w8, [x20, #8]
	str	xzr, [x20, #40]
	mov	w8, #-1
	str	w8, [x20]
	add	x0, x20, #32
	bl	_STAILQ_INIT
	add	x0, x20, #28
	bl	_STAILQ_INIT
	add	x21, x20, #24
	mov	x0, x21
	bl	_STAILQ_INIT
	str	wzr, [sp, #20]
	ldr	w8, [sp, #20]
Lloh44:
	adrp	x22, _CUDA_MAXPACKETS@GOTPAGE
Lloh45:
	ldr	x22, [x22, _CUDA_MAXPACKETS@GOTPAGEOFF]
	ldr	w9, [x22]
	cmp	w8, w9
	b.ge	LBB0_13
; %bb.11:
Lloh46:
	adrp	x23, _pkt_q@GOTPAGE
Lloh47:
	ldr	x23, [x23, _pkt_q@GOTPAGEOFF]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	ldrsw	x9, [sp, #20]
	add	x1, x8, x9, lsl #2
	ldr	w2, [x23]
	mov	x0, x21
	bl	_STAILQ_INSERT_TAIL
	ldr	w8, [sp, #20]
	add	w8, w8, #1
	str	w8, [sp, #20]
	ldr	w8, [sp, #20]
	ldr	w9, [x22]
	cmp	w8, w9
	b.lt	LBB0_12
LBB0_13:
Lloh48:
	adrp	x21, _vDirB@GOTPAGE
Lloh49:
	ldr	x21, [x21, _vDirB@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_cuda_read_reg
	orr	w2, w0, #0x30
	ldr	w1, [x21]
	mov	x0, x20
	bl	_cuda_write_reg
	ldr	w1, [x21]
	mov	x0, x20
	bl	_cuda_read_reg
	mov	w8, #247
	and	w2, w0, w8
	ldr	w1, [x21]
	mov	x0, x20
	bl	_cuda_write_reg
Lloh50:
	adrp	x21, _vACR@GOTPAGE
Lloh51:
	ldr	x21, [x21, _vACR@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_cuda_read_reg
Lloh52:
	adrp	x8, _vSR_OUT@GOTPAGE
Lloh53:
	ldr	x8, [x8, _vSR_OUT@GOTPAGEOFF]
Lloh54:
	ldr	w8, [x8]
	bic	w2, w0, w8
	ldr	w1, [x21]
	mov	x0, x20
	bl	_cuda_write_reg
	ldr	w21, [x21]
	mov	x0, x20
	mov	x1, x21
	bl	_cuda_read_reg
	and	w8, w0, #0xffffffe3
	orr	w2, w8, #0xc
	mov	x0, x20
	mov	x1, x21
	bl	_cuda_write_reg
Lloh55:
	adrp	x8, _CUDA_IDLE@GOTPAGE
Lloh56:
	ldr	x8, [x8, _CUDA_IDLE@GOTPAGEOFF]
Lloh57:
	ldr	w8, [x8]
	str	w8, [x20, #8]
Lloh58:
	adrp	x21, _vIER@GOTPAGE
Lloh59:
	ldr	x21, [x21, _vIER@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	mov	w2, #132
	bl	_cuda_write_reg
	mov	x0, x20
	bl	_cuda_idle
Lloh60:
	adrp	x22, _vSR@GOTPAGE
Lloh61:
	ldr	x22, [x22, _vSR@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_cuda_read_reg
	str	w0, [sp, #20]
	ldr	w1, [x21]
	mov	x0, x20
	mov	w2, #4
	bl	_cuda_write_reg
	mov	x0, x20
	bl	_cuda_idle
	mov	w0, #150
	bl	_DELAY
	mov	x0, x20
	bl	_cuda_tip
	mov	w0, #150
	bl	_DELAY
	mov	x0, x20
	bl	_cuda_toggle_ack
	mov	w0, #150
	bl	_DELAY
	mov	x0, x20
	bl	_cuda_clear_tip
	mov	w0, #150
	bl	_DELAY
	mov	x0, x20
	bl	_cuda_idle
	ldr	w1, [x22]
	mov	x0, x20
	bl	_cuda_read_reg
	str	w0, [sp, #20]
	ldr	w1, [x21]
	mov	x0, x20
	mov	w2, #132
	bl	_cuda_write_reg
	mov	x0, x19
	bl	_ofw_bus_get_node
	bl	_OF_child
	cbz	x0, LBB0_20
; %bb.14:
	mov	x21, x0
	add	x25, sp, #24
Lloh62:
	adrp	x22, l_.str.4@PAGE
Lloh63:
	add	x22, x22, l_.str.4@PAGEOFF
Lloh64:
	adrp	x26, _bootverbose@GOTPAGE
Lloh65:
	ldr	x26, [x26, _bootverbose@GOTPAGEOFF]
Lloh66:
	adrp	x23, l_.str.6@PAGE
Lloh67:
	add	x23, x23, l_.str.6@PAGEOFF
Lloh68:
	adrp	x24, l_.str.5@PAGE
Lloh69:
	add	x24, x24, l_.str.5@PAGEOFF
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x21
	bl	_OF_peer
	mov	x21, x0
	cbz	x0, LBB0_20
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	add	x2, sp, #24
	mov	x0, x21
	mov	x1, x22
	mov	w3, #32
	bl	_OF_getprop
	ldr	x8, [x26]
	cbz	x8, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	str	x25, [sp]
	mov	x0, x19
	mov	x1, x24
	bl	_device_printf
LBB0_18:                                ;   in Loop: Header=BB0_16 Depth=1
	add	x0, sp, #24
	mov	x1, x23
	mov	w2, #4
	bl	_strncmp
	cbnz	x0, LBB0_15
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x19
	mov	x1, x23
	mov	w2, #-1
	bl	_device_add_child
	str	w0, [x20, #4]
	b	LBB0_15
LBB0_20:
	mov	x0, x19
	mov	w1, #1000
	bl	_clock_register
Lloh70:
	adrp	x8, _shutdown_final@GOTPAGE
Lloh71:
	ldr	x8, [x8, _shutdown_final@GOTPAGEOFF]
Lloh72:
	ldr	w0, [x8]
Lloh73:
	adrp	x8, _cuda_shutdown@GOTPAGE
Lloh74:
	ldr	x8, [x8, _cuda_shutdown@GOTPAGEOFF]
Lloh75:
	ldr	w1, [x8]
Lloh76:
	adrp	x8, _SHUTDOWN_PRI_LAST@GOTPAGE
Lloh77:
	ldr	x8, [x8, _SHUTDOWN_PRI_LAST@GOTPAGEOFF]
Lloh78:
	ldr	w3, [x8]
	mov	x2, x20
	bl	_EVENTHANDLER_REGISTER
	mov	x0, x19
	bl	_bus_generic_attach
	b	LBB0_8
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh60, Lloh61
	.loh AdrpLdrGot	Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGot	Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpAdd	Lloh68, Lloh69
	.loh AdrpAdd	Lloh66, Lloh67
	.loh AdrpLdrGot	Lloh64, Lloh65
	.loh AdrpAdd	Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh76, Lloh77, Lloh78
	.loh AdrpLdrGotLdr	Lloh73, Lloh74, Lloh75
	.loh AdrpLdrGotLdr	Lloh70, Lloh71, Lloh72
	.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	"Could not alloc mem resource!\n"

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

	.comm	_INTR_TYPE_MISC,4,2             ; @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_INTR_ENTROPY,4,2               ; @INTR_ENTROPY
	.comm	_cuda_intr,4,2                  ; @cuda_intr
l_.str.2:                               ; @.str.2
	.asciz	"could not setup interrupt\n"

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

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
	.comm	_MTX_RECURSE,4,2                ; @MTX_RECURSE
	.comm	_CUDA_NOTREADY,4,2              ; @CUDA_NOTREADY
	.comm	_CUDA_MAXPACKETS,4,2            ; @CUDA_MAXPACKETS
	.comm	_pkt_q,4,2                      ; @pkt_q
	.comm	_vDirB,4,2                      ; @vDirB
	.comm	_vACR,4,2                       ; @vACR
	.comm	_vSR_OUT,4,2                    ; @vSR_OUT
	.comm	_CUDA_IDLE,4,2                  ; @CUDA_IDLE
	.comm	_vIER,4,2                       ; @vIER
	.comm	_vSR,4,2                        ; @vSR
l_.str.4:                               ; @.str.4
	.asciz	"name"

	.comm	_bootverbose,8,3                ; @bootverbose
l_.str.5:                               ; @.str.5
	.asciz	"CUDA child <%s>\n"

l_.str.6:                               ; @.str.6
	.asciz	"adb"

	.comm	_shutdown_final,4,2             ; @shutdown_final
	.comm	_cuda_shutdown,4,2              ; @cuda_shutdown
	.comm	_SHUTDOWN_PRI_LAST,4,2          ; @SHUTDOWN_PRI_LAST
	.no_dead_strip	_cuda_attach
.subsections_via_symbols
