	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_busy_940
_wait_busy_940:                         ## @wait_busy_940
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ecx
	decb	%cl
	movl	$1, %r14d
	shll	%cl, %r14d
	movq	_memregs@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	30348(%rax), %eax
	movzbl	%cl, %ecx
	btl	%ecx, %eax
	jae	LBB0_10
## %bb.1:
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%eax, %ebx
	movl	$8192, %edi                     ## imm = 0x2000
	callq	_spend_cycles
	movq	(%r15), %rax
	testl	%r14d, 30348(%rax)
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	1(%rbx), %eax
	cmpl	$65535, %ebx                    ## imm = 0xFFFF
	jb	LBB0_2
LBB0_4:
	cmpl	$65535, %ebx                    ## imm = 0xFFFF
	jb	LBB0_10
## %bb.5:
	movq	_shared_ctl@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_printf
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %r14
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movl	4(%rax), %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movl	8(%rax), %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movl	12(%rax), %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movl	16(%rax), %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movl	20(%rax), %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movl	24(%rax), %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movl	28(%rax), %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_printf
	leaq	L_str(%rip), %rdi
	callq	_puts
	movq	(%r15), %rax
	movl	30348(%rax), %esi
	movq	_memregl@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	17664(%rax), %edx
	movl	17680(%rax), %ecx
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	(%r12), %rax
	movl	16(%rax), %esi
	movl	20(%rax), %edx
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	leaq	L_str.8(%rip), %rdi
	callq	_puts
	movq	(%r15), %rax
	movl	$65535, 30332(%rax)             ## imm = 0xFFFF
	cmpl	$0, 30348(%rax)
	je	LBB0_9
## %bb.6:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	$8192, %edi                     ## imm = 0x2000
	callq	_spend_cycles
	leal	1(%rbx), %r13d
	movq	(%r15), %rax
	cmpl	$0, 30348(%rax)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$65535, %ebx                    ## imm = 0xFFFF
	movl	%r13d, %ebx
	jb	LBB0_7
LBB0_9:
	leaq	L_.str.6(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_printf
	movq	(%r15), %rax
	movl	30348(%rax), %esi
	movq	(%r14), %rax
	movl	17664(%rax), %edx
	movl	17680(%rax), %ecx
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	(%r12), %rax
	movl	16(%rax), %esi
	movl	20(%rax), %edx
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	leaq	L_.str.7(%rip), %rdi
	callq	_menu_update_msg
	movq	_PGS_Menu@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_engineState@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_crashed_940@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_memregs,8,3                    ## @memregs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"940 crashed (cnt: %i, ve: "

	.comm	_shared_ctl,8,3                 ## @shared_ctl
L_.str.1:                               ## @.str.1
	.asciz	"%i "

L_.str.3:                               ## @.str.3
	.asciz	"irq pending flags: DUALCPU %04x, SRCPND %08x (see 26), INTPND %08x\n"

	.comm	_memregl,8,3                    ## @memregl
L_.str.4:                               ## @.str.4
	.asciz	"last lr: %08x, lastjob: %i\n"

L_.str.6:                               ## @.str.6
	.asciz	"i = 0x%x\n"

L_.str.7:                               ## @.str.7
	.asciz	"940 crashed, too much overclock?"

	.comm	_PGS_Menu,4,2                   ## @PGS_Menu
	.comm	_engineState,4,2                ## @engineState
	.comm	_crashed_940,4,2                ## @crashed_940
L_str:                                  ## @str
	.asciz	")"

L_str.8:                                ## @str.8
	.asciz	"trying to interrupt.."

	.no_dead_strip	_wait_busy_940
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_busy_940
_wait_busy_940:                         ; @wait_busy_940
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	w8, w0, #1
	mov	w9, #1
Lloh0:
	adrp	x20, _memregs@GOTPAGE
Lloh1:
	ldr	x20, [x20, _memregs@GOTPAGEOFF]
	lsl	w19, w9, w8
	ldr	x8, [x20]
	mov	w9, #30348
	ldr	w8, [x8, x9]
	tst	w8, w19
	b.eq	LBB0_8
; %bb.1:
	mov	w8, #0
	mov	w21, #30348
	mov	w22, #65535
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x23, x8
	mov	w0, #8192
	bl	_spend_cycles
	add	w8, w23, #1
	ldr	x9, [x20]
	ldr	w9, [x9, x21]
	and	w9, w9, w19
	cmp	w9, #0
	ccmp	w23, w22, #2, ne
	b.lo	LBB0_2
; %bb.3:
	mov	w22, #65535
	cmp	w23, w22
	b.lo	LBB0_8
; %bb.4:
Lloh2:
	adrp	x21, _shared_ctl@GOTPAGE
Lloh3:
	ldr	x21, [x21, _shared_ctl@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	w8, [x8]
	str	x8, [sp]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	w8, [x8]
	str	x8, [sp]
Lloh6:
	adrp	x19, l_.str.1@PAGE
Lloh7:
	add	x19, x19, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_printf
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	w8, [x8, #4]
	str	x8, [sp]
	mov	x0, x19
	bl	_printf
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	w8, [x8, #8]
	str	x8, [sp]
	mov	x0, x19
	bl	_printf
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	w8, [x8, #12]
	str	x8, [sp]
	mov	x0, x19
	bl	_printf
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	w8, [x8, #16]
	str	x8, [sp]
	mov	x0, x19
	bl	_printf
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	w8, [x8, #20]
	str	x8, [sp]
	mov	x0, x19
	bl	_printf
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	w8, [x8, #24]
	str	x8, [sp]
	mov	x0, x19
	bl	_printf
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	w8, [x8, #28]
	str	x8, [sp]
	mov	x0, x19
	bl	_printf
Lloh8:
	adrp	x0, l_str@PAGE
Lloh9:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	ldr	x8, [x20]
Lloh10:
	adrp	x19, _memregl@GOTPAGE
Lloh11:
	ldr	x19, [x19, _memregl@GOTPAGEOFF]
	ldr	x9, [x19]
	mov	w10, #17664
	add	x9, x9, x10
	mov	w10, #30348
	ldr	w8, [x8, x10]
	ldr	w10, [x9]
	ldr	w9, [x9, #16]
	stp	x10, x9, [sp, #8]
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
	ldr	x8, [x21]
	ldp	w9, w8, [x8, #16]
	stp	x9, x8, [sp]
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
Lloh16:
	adrp	x0, l_str.8@PAGE
Lloh17:
	add	x0, x0, l_str.8@PAGEOFF
	bl	_puts
	ldr	x8, [x20]
	mov	w9, #30332
	add	x8, x8, x9
	str	w22, [x8]
	ldr	w8, [x8, #16]
	cbz	w8, LBB0_7
; %bb.5:
	mov	w22, #0
	mov	w23, #30348
	mov	w24, #65535
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #8192
	bl	_spend_cycles
	add	w8, w22, #1
	ldr	x9, [x20]
	ldr	w9, [x9, x23]
	cmp	w9, #0
	ccmp	w22, w24, #2, ne
	mov	x22, x8
	b.lo	LBB0_6
LBB0_7:
	str	x8, [sp]
Lloh18:
	adrp	x0, l_.str.6@PAGE
Lloh19:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_printf
	ldr	x8, [x20]
	ldr	x9, [x19]
	mov	w10, #17664
	add	x9, x9, x10
	mov	w10, #30348
	ldr	w8, [x8, x10]
	ldr	w10, [x9]
	ldr	w9, [x9, #16]
	stp	x10, x9, [sp, #8]
	str	x8, [sp]
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printf
	ldr	x8, [x21]
	ldp	w9, w8, [x8, #16]
	stp	x9, x8, [sp]
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
Lloh24:
	adrp	x0, l_.str.7@PAGE
Lloh25:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_menu_update_msg
Lloh26:
	adrp	x8, _PGS_Menu@GOTPAGE
Lloh27:
	ldr	x8, [x8, _PGS_Menu@GOTPAGEOFF]
Lloh28:
	adrp	x9, _engineState@GOTPAGE
Lloh29:
	ldr	x9, [x9, _engineState@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
Lloh31:
	str	w8, [x9]
Lloh32:
	adrp	x8, _crashed_940@GOTPAGE
Lloh33:
	ldr	x8, [x8, _crashed_940@GOTPAGEOFF]
	mov	w9, #1
Lloh34:
	str	w9, [x8]
LBB0_8:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotStr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotStr	Lloh28, Lloh29, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh30
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_memregs,8,3                    ; @memregs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"940 crashed (cnt: %i, ve: "

	.comm	_shared_ctl,8,3                 ; @shared_ctl
l_.str.1:                               ; @.str.1
	.asciz	"%i "

l_.str.3:                               ; @.str.3
	.asciz	"irq pending flags: DUALCPU %04x, SRCPND %08x (see 26), INTPND %08x\n"

	.comm	_memregl,8,3                    ; @memregl
l_.str.4:                               ; @.str.4
	.asciz	"last lr: %08x, lastjob: %i\n"

l_.str.6:                               ; @.str.6
	.asciz	"i = 0x%x\n"

l_.str.7:                               ; @.str.7
	.asciz	"940 crashed, too much overclock?"

	.comm	_PGS_Menu,4,2                   ; @PGS_Menu
	.comm	_engineState,4,2                ; @engineState
	.comm	_crashed_940,4,2                ; @crashed_940
l_str:                                  ; @str
	.asciz	")"

l_str.8:                                ; @str.8
	.asciz	"trying to interrupt.."

	.no_dead_strip	_wait_busy_940
.subsections_via_symbols
