	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_tmu_enable
_sh_tmu_enable:                         ## @sh_tmu_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %r15
	movl	4(%rdi), %edi
	callq	_clk_enable
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%r15), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_sh_tmu_start_stop_ch
	movq	_TCOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-1, %edx
	callq	_sh_tmu_write
	movq	_TCNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$-1, %edx
	callq	_sh_tmu_write
	movl	4(%rbx), %edi
	callq	_clk_get_rate
                                        ## kill: def $eax killed $eax def $rax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	movl	%ecx, (%rbx)
	movq	_TCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_sh_tmu_write
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_sh_tmu_start_stop_ch
LBB0_3:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sh_tmu: cannot enable clock \"%s\"\n"

	.comm	_TCOR,4,2                       ## @TCOR
	.comm	_TCNT,4,2                       ## @TCNT
	.comm	_TCR,4,2                        ## @TCR
	.no_dead_strip	_sh_tmu_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh_tmu_enable
_sh_tmu_enable:                         ; @sh_tmu_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	x20, x0
	ldr	x8, [x0, #8]
	ldr	x21, [x8]
	ldr	w0, [x0, #4]
	bl	_clk_enable
	mov	x19, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w1, [x21]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_3
LBB0_2:
	mov	x0, x20
	mov	w1, #0
	bl	_sh_tmu_start_stop_ch
Lloh2:
	adrp	x8, _TCOR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TCOR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #-1
	bl	_sh_tmu_write
Lloh5:
	adrp	x8, _TCNT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TCNT@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #-1
	bl	_sh_tmu_write
	ldr	w0, [x20, #4]
	bl	_clk_get_rate
	add	w8, w0, #3
	cmp	w0, #0
	csel	w8, w8, w0, lt
	asr	w8, w8, #2
	str	w8, [x20]
Lloh8:
	adrp	x8, _TCR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TCR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_sh_tmu_write
	mov	x0, x20
	mov	w1, #1
	bl	_sh_tmu_start_stop_ch
LBB0_3:
	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
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sh_tmu: cannot enable clock \"%s\"\n"

	.comm	_TCOR,4,2                       ; @TCOR
	.comm	_TCNT,4,2                       ; @TCNT
	.comm	_TCR,4,2                        ; @TCR
	.no_dead_strip	_sh_tmu_enable
.subsections_via_symbols
