	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt312_sleep
_mt312_sleep:                           ## @mt312_sleep
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %rbx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_mt312_reset
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	movq	(%rbx), %rax
	movq	_ID_ZL10313@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.2:
	movq	_GPP_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mt312_writereg
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	movq	_HW_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$13, %edx
	callq	_mt312_writereg
	testl	%eax, %eax
	js	LBB0_6
LBB0_4:
	movq	_CONFIG@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	-20(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_mt312_readreg
	testl	%eax, %eax
	js	LBB0_6
## %bb.5:
	movl	(%r14), %esi
	movl	-20(%rbp), %edx
	andl	$127, %edx
	movq	%rbx, %rdi
	callq	_mt312_writereg
	movl	%eax, %ecx
	sarl	$31, %eax
	andl	%ecx, %eax
LBB0_6:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ID_ZL10313,8,3                 ## @ID_ZL10313
	.comm	_GPP_CTRL,4,2                   ## @GPP_CTRL
	.comm	_HW_CTRL,4,2                    ## @HW_CTRL
	.comm	_CONFIG,4,2                     ## @CONFIG
	.no_dead_strip	_mt312_sleep
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt312_sleep
_mt312_sleep:                           ; @mt312_sleep
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	ldr	x19, [x0]
	mov	x0, x19
	mov	w1, #1
	bl	_mt312_reset
	tbnz	w0, #31, LBB0_6
; %bb.1:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _ID_ZL10313@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ID_ZL10313@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _GPP_CTRL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GPP_CTRL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_mt312_writereg
	tbnz	w0, #31, LBB0_6
; %bb.3:
Lloh6:
	adrp	x8, _HW_CTRL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HW_CTRL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #13
	bl	_mt312_writereg
	tbnz	w0, #31, LBB0_6
LBB0_4:
Lloh9:
	adrp	x20, _CONFIG@GOTPAGE
Lloh10:
	ldr	x20, [x20, _CONFIG@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	mov	x0, x19
	bl	_mt312_readreg
	tbnz	w0, #31, LBB0_6
; %bb.5:
	ldr	w1, [x20]
	ldr	w8, [sp, #12]
	and	w2, w8, #0x7f
	mov	x0, x19
	bl	_mt312_writereg
	cmp	w0, #0
	csel	w0, w0, wzr, lt
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ID_ZL10313,8,3                 ; @ID_ZL10313
	.comm	_GPP_CTRL,4,2                   ; @GPP_CTRL
	.comm	_HW_CTRL,4,2                    ; @HW_CTRL
	.comm	_CONFIG,4,2                     ; @CONFIG
	.no_dead_strip	_mt312_sleep
.subsections_via_symbols
