	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r852_engine_enable
_r852_engine_enable:                    ## @r852_engine_enable
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_R852_HW@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	callq	_r852_read_reg_dword
	movq	_R852_HW_UNKNOWN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movq	_R852_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_R852_CTL_RESET@GOTPCREL(%rip), %rax
	movq	_R852_CTL_ON@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_r852_write_reg
	movl	(%r14), %esi
	movq	_R852_HW_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_r852_write_reg_dword
	jmp	LBB0_3
LBB0_2:
	movl	(%r14), %esi
	movq	_R852_HW_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_r852_write_reg_dword
	movq	_R852_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_R852_CTL_RESET@GOTPCREL(%rip), %rax
	movq	_R852_CTL_ON@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_r852_write_reg
LBB0_3:
	movl	$300, %edi                      ## imm = 0x12C
	callq	_msleep
	movq	_R852_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_r852_write_reg                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_R852_HW,4,2                    ## @R852_HW
	.comm	_R852_HW_UNKNOWN,4,2            ## @R852_HW_UNKNOWN
	.comm	_R852_CTL,4,2                   ## @R852_CTL
	.comm	_R852_CTL_RESET,4,2             ## @R852_CTL_RESET
	.comm	_R852_CTL_ON,4,2                ## @R852_CTL_ON
	.comm	_R852_HW_ENABLED,4,2            ## @R852_HW_ENABLED
	.no_dead_strip	_r852_engine_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r852_engine_enable
_r852_engine_enable:                    ; @r852_engine_enable
	.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	x19, x0
Lloh0:
	adrp	x21, _R852_HW@GOTPAGE
Lloh1:
	ldr	x21, [x21, _R852_HW@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_r852_read_reg_dword
Lloh2:
	adrp	x8, _R852_HW_UNKNOWN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _R852_HW_UNKNOWN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x20, _R852_CTL@GOTPAGE
Lloh6:
	ldr	x20, [x20, _R852_CTL@GOTPAGEOFF]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
Lloh7:
	adrp	x8, _R852_CTL_RESET@GOTPAGE
Lloh8:
	ldr	x8, [x8, _R852_CTL_RESET@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _R852_CTL_ON@GOTPAGE
Lloh11:
	ldr	x9, [x9, _R852_CTL_ON@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_r852_write_reg
	ldr	w1, [x21]
Lloh13:
	adrp	x8, _R852_HW_ENABLED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _R852_HW_ENABLED@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_r852_write_reg_dword
	b	LBB0_3
LBB0_2:
	ldr	w1, [x21]
Lloh16:
	adrp	x8, _R852_HW_ENABLED@GOTPAGE
Lloh17:
	ldr	x8, [x8, _R852_HW_ENABLED@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_r852_write_reg_dword
Lloh19:
	adrp	x8, _R852_CTL_RESET@GOTPAGE
Lloh20:
	ldr	x8, [x8, _R852_CTL_RESET@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	adrp	x9, _R852_CTL_ON@GOTPAGE
Lloh23:
	ldr	x9, [x9, _R852_CTL_ON@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_r852_write_reg
LBB0_3:
	mov	w0, #300
	bl	_msleep
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	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	_r852_write_reg
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_R852_HW,4,2                    ; @R852_HW
	.comm	_R852_HW_UNKNOWN,4,2            ; @R852_HW_UNKNOWN
	.comm	_R852_CTL,4,2                   ; @R852_CTL
	.comm	_R852_CTL_RESET,4,2             ; @R852_CTL_RESET
	.comm	_R852_CTL_ON,4,2                ; @R852_CTL_ON
	.comm	_R852_HW_ENABLED,4,2            ; @R852_HW_ENABLED
	.no_dead_strip	_r852_engine_enable
.subsections_via_symbols
