	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goya_halt_engines
_goya_halt_engines:                     ## @goya_halt_engines
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movq	(%rbx), %rax
	movq	_GOYA_PLDM_RESET_WAIT_MSEC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	movl	%r15d, %r14d
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_GOYA_RESET_WAIT_MSEC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
LBB0_2:
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.3:
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	_GOYA_CPU_RESET_WAIT_MSEC@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_5:
	movq	_mmPSOC_GLOBAL_CONF_UBOOT_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_KMD_MSG_GOTO_WFE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WREG32
	movq	_mmGIC_DISTRIBUTOR__5_GICD_SETSPI_NSR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GOYA_ASYNC_EVENT_ID_HALT_MACHINE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WREG32
	movl	%r15d, %edi
	callq	_msleep
	movq	%rbx, %rdi
	callq	_goya_stop_external_queues
	movq	%rbx, %rdi
	callq	_goya_stop_internal_queues
	movl	%r14d, %edi
	callq	_msleep
	movq	%rbx, %rdi
	callq	_goya_dma_stall
	movq	%rbx, %rdi
	callq	_goya_tpc_stall
	movq	%rbx, %rdi
	callq	_goya_mme_stall
	movl	%r14d, %edi
	callq	_msleep
	movq	%rbx, %rdi
	callq	_goya_disable_external_queues
	movq	%rbx, %rdi
	callq	_goya_disable_internal_queues
	movq	%rbx, %rdi
	callq	_goya_disable_timestamp
	movq	%rbx, %rdi
	callq	_goya_disable_msix
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_goya_mmu_remove_device_cpu_mappings ## TAILCALL
LBB0_6:
	movq	%rbx, %rdi
	callq	_goya_stop_external_queues
	movq	%rbx, %rdi
	callq	_goya_stop_internal_queues
	movl	%r14d, %edi
	callq	_msleep
	movq	%rbx, %rdi
	callq	_goya_dma_stall
	movq	%rbx, %rdi
	callq	_goya_tpc_stall
	movq	%rbx, %rdi
	callq	_goya_mme_stall
	movl	%r14d, %edi
	callq	_msleep
	movq	%rbx, %rdi
	callq	_goya_disable_external_queues
	movq	%rbx, %rdi
	callq	_goya_disable_internal_queues
	movq	%rbx, %rdi
	callq	_goya_disable_timestamp
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_goya_sync_irqs                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Halting compute engines and disabling interrupts\n"

	.comm	_GOYA_PLDM_RESET_WAIT_MSEC,4,2  ## @GOYA_PLDM_RESET_WAIT_MSEC
	.comm	_GOYA_RESET_WAIT_MSEC,4,2       ## @GOYA_RESET_WAIT_MSEC
	.comm	_GOYA_CPU_RESET_WAIT_MSEC,4,2   ## @GOYA_CPU_RESET_WAIT_MSEC
	.comm	_mmPSOC_GLOBAL_CONF_UBOOT_MAGIC,4,2 ## @mmPSOC_GLOBAL_CONF_UBOOT_MAGIC
	.comm	_KMD_MSG_GOTO_WFE,4,2           ## @KMD_MSG_GOTO_WFE
	.comm	_mmGIC_DISTRIBUTOR__5_GICD_SETSPI_NSR,4,2 ## @mmGIC_DISTRIBUTOR__5_GICD_SETSPI_NSR
	.comm	_GOYA_ASYNC_EVENT_ID_HALT_MACHINE,4,2 ## @GOYA_ASYNC_EVENT_ID_HALT_MACHINE
	.no_dead_strip	_goya_halt_engines
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goya_halt_engines
_goya_halt_engines:                     ; @goya_halt_engines
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x1
	mov	x19, x0
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _GOYA_PLDM_RESET_WAIT_MSEC@GOTPAGE
Lloh3:
	ldr	x9, [x9, _GOYA_PLDM_RESET_WAIT_MSEC@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x10, _GOYA_RESET_WAIT_MSEC@GOTPAGE
Lloh6:
	ldr	x10, [x10, _GOYA_RESET_WAIT_MSEC@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	x8, #0
	csel	w20, w10, w9, eq
	cbz	w21, LBB0_2
; %bb.1:
Lloh8:
	adrp	x10, _GOYA_CPU_RESET_WAIT_MSEC@GOTPAGE
Lloh9:
	ldr	x10, [x10, _GOYA_CPU_RESET_WAIT_MSEC@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	cmp	x8, #0
	csel	w21, w10, w9, eq
Lloh11:
	adrp	x8, _mmPSOC_GLOBAL_CONF_UBOOT_MAGIC@GOTPAGE
Lloh12:
	ldr	x8, [x8, _mmPSOC_GLOBAL_CONF_UBOOT_MAGIC@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x8, _KMD_MSG_GOTO_WFE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _KMD_MSG_GOTO_WFE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_WREG32
Lloh17:
	adrp	x8, _mmGIC_DISTRIBUTOR__5_GICD_SETSPI_NSR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _mmGIC_DISTRIBUTOR__5_GICD_SETSPI_NSR@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x8, _GOYA_ASYNC_EVENT_ID_HALT_MACHINE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _GOYA_ASYNC_EVENT_ID_HALT_MACHINE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	bl	_WREG32
	mov	x0, x21
	bl	_msleep
	mov	x0, x19
	bl	_goya_stop_external_queues
	mov	x0, x19
	bl	_goya_stop_internal_queues
	mov	x0, x20
	bl	_msleep
	mov	x0, x19
	bl	_goya_dma_stall
	mov	x0, x19
	bl	_goya_tpc_stall
	mov	x0, x19
	bl	_goya_mme_stall
	mov	x0, x20
	bl	_msleep
	mov	x0, x19
	bl	_goya_disable_external_queues
	mov	x0, x19
	bl	_goya_disable_internal_queues
	mov	x0, x19
	bl	_goya_disable_timestamp
	mov	x0, x19
	bl	_goya_disable_msix
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_goya_mmu_remove_device_cpu_mappings
LBB0_2:
	mov	x0, x19
	bl	_goya_stop_external_queues
	mov	x0, x19
	bl	_goya_stop_internal_queues
	mov	x0, x20
	bl	_msleep
	mov	x0, x19
	bl	_goya_dma_stall
	mov	x0, x19
	bl	_goya_tpc_stall
	mov	x0, x19
	bl	_goya_mme_stall
	mov	x0, x20
	bl	_msleep
	mov	x0, x19
	bl	_goya_disable_external_queues
	mov	x0, x19
	bl	_goya_disable_internal_queues
	mov	x0, x19
	bl	_goya_disable_timestamp
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_goya_sync_irqs
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Halting compute engines and disabling interrupts\n"

	.comm	_GOYA_PLDM_RESET_WAIT_MSEC,4,2  ; @GOYA_PLDM_RESET_WAIT_MSEC
	.comm	_GOYA_RESET_WAIT_MSEC,4,2       ; @GOYA_RESET_WAIT_MSEC
	.comm	_GOYA_CPU_RESET_WAIT_MSEC,4,2   ; @GOYA_CPU_RESET_WAIT_MSEC
	.comm	_mmPSOC_GLOBAL_CONF_UBOOT_MAGIC,4,2 ; @mmPSOC_GLOBAL_CONF_UBOOT_MAGIC
	.comm	_KMD_MSG_GOTO_WFE,4,2           ; @KMD_MSG_GOTO_WFE
	.comm	_mmGIC_DISTRIBUTOR__5_GICD_SETSPI_NSR,4,2 ; @mmGIC_DISTRIBUTOR__5_GICD_SETSPI_NSR
	.comm	_GOYA_ASYNC_EVENT_ID_HALT_MACHINE,4,2 ; @GOYA_ASYNC_EVENT_ID_HALT_MACHINE
	.no_dead_strip	_goya_halt_engines
.subsections_via_symbols
