	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpufreq_gx_cpu_init
_cpufreq_gx_cpu_init:                   ## @cpufreq_gx_cpu_init
	.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
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rdi, %rbx
	cmpq	$0, (%rdi)
	je	LBB0_3
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_3:
	movq	_pci_busclk@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	testl	%r14d, %r14d
	je	LBB0_4
LBB0_6:
	movq	_gx_freq_mult@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_CX86_DIR1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_getCx86
                                        ## kill: def $eax killed $eax def $rax
	andl	$15, %eax
	imull	(%r15,%rax,4), %r14d
	jmp	LBB0_7
LBB0_4:
	movq	_cpu_khz@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	testl	%r14d, %r14d
	je	LBB0_5
LBB0_7:
	movq	_stock_freq@GOTPCREL(%rip), %rax
	movl	%r14d, (%rax)
	xorl	%edi, %edi
	callq	_gx_get_cpuspeed
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	callq	_dprintk
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	callq	_dprintk
	movq	$0, (%rbx)
	movq	_max_duration@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_POLICY_MIN_DIV@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r14d, %eax
	xorl	%edx, %edx
	cmpl	%ecx, %esi
	jae	LBB0_9
## %bb.8:
	divl	%esi
	movl	%eax, %ecx
	jmp	LBB0_10
LBB0_9:
	divl	%ecx
	movl	%eax, %ecx
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%esi
LBB0_10:
	movl	%ecx, 8(%rbx)
	movl	%r14d, 12(%rbx)
	movl	%r15d, 16(%rbx)
	movl	%eax, 20(%rbx)
	movl	%r14d, 24(%rbx)
	movq	_CPUFREQ_ETERNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	xorl	%eax, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	$30000, %r14d                   ## imm = 0x7530
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_pci_busclk,4,2                 ## @pci_busclk
	.comm	_gx_freq_mult,8,3               ## @gx_freq_mult
	.comm	_CX86_DIR1,4,2                  ## @CX86_DIR1
	.comm	_cpu_khz,4,2                    ## @cpu_khz
	.comm	_stock_freq,4,2                 ## @stock_freq
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cpu max frequency is %d.\n"

L_.str.1:                               ## @.str.1
	.asciz	"cpu current frequency is %dkHz.\n"

	.comm	_max_duration,4,2               ## @max_duration
	.comm	_POLICY_MIN_DIV,4,2             ## @POLICY_MIN_DIV
	.comm	_CPUFREQ_ETERNAL,4,2            ## @CPUFREQ_ETERNAL
	.no_dead_strip	_cpufreq_gx_cpu_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpufreq_gx_cpu_init
_cpufreq_gx_cpu_init:                   ; @cpufreq_gx_cpu_init
	.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
	cbz	x0, LBB0_2
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_3:
Lloh3:
	adrp	x8, _pci_busclk@GOTPAGE
Lloh4:
	ldr	x8, [x8, _pci_busclk@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x8]
	cbz	w20, LBB0_5
LBB0_4:
Lloh6:
	adrp	x8, _gx_freq_mult@GOTPAGE
Lloh7:
	ldr	x8, [x8, _gx_freq_mult@GOTPAGEOFF]
Lloh8:
	ldr	x21, [x8]
Lloh9:
	adrp	x8, _CX86_DIR1@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CX86_DIR1@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_getCx86
	and	w8, w0, #0xf
	ldr	w8, [x21, w8, uxtw #2]
	mul	w20, w8, w20
	b	LBB0_6
LBB0_5:
Lloh12:
	adrp	x8, _cpu_khz@GOTPAGE
Lloh13:
	ldr	x8, [x8, _cpu_khz@GOTPAGEOFF]
Lloh14:
	ldr	w20, [x8]
	cbz	w20, LBB0_11
LBB0_6:
Lloh15:
	adrp	x8, _stock_freq@GOTPAGE
Lloh16:
	ldr	x8, [x8, _stock_freq@GOTPAGEOFF]
Lloh17:
	str	w20, [x8]
	mov	w0, #0
	bl	_gx_get_cpuspeed
	mov	x21, x0
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_dprintk
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_dprintk
Lloh22:
	adrp	x8, _max_duration@GOTPAGE
Lloh23:
	ldr	x8, [x8, _max_duration@GOTPAGEOFF]
	str	xzr, [x19]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _POLICY_MIN_DIV@GOTPAGE
Lloh26:
	ldr	x9, [x9, _POLICY_MIN_DIV@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	cmp	w8, w9
	b.hs	LBB0_8
; %bb.7:
	udiv	w8, w20, w8
	mov	x9, x8
	b	LBB0_9
LBB0_8:
	udiv	w9, w20, w9
	udiv	w8, w20, w8
LBB0_9:
	mov	w0, #0
	stp	w9, w20, [x19, #8]
	stp	w21, w8, [x19, #16]
Lloh28:
	adrp	x8, _CPUFREQ_ETERNAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _CPUFREQ_ETERNAL@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	stp	w20, w8, [x19, #24]
LBB0_10:
	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
LBB0_11:
	mov	w20, #30000
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_pci_busclk,4,2                 ; @pci_busclk
	.comm	_gx_freq_mult,8,3               ; @gx_freq_mult
	.comm	_CX86_DIR1,4,2                  ; @CX86_DIR1
	.comm	_cpu_khz,4,2                    ; @cpu_khz
	.comm	_stock_freq,4,2                 ; @stock_freq
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cpu max frequency is %d.\n"

l_.str.1:                               ; @.str.1
	.asciz	"cpu current frequency is %dkHz.\n"

	.comm	_max_duration,4,2               ; @max_duration
	.comm	_POLICY_MIN_DIV,4,2             ; @POLICY_MIN_DIV
	.comm	_CPUFREQ_ETERNAL,4,2            ; @CPUFREQ_ETERNAL
	.no_dead_strip	_cpufreq_gx_cpu_init
.subsections_via_symbols
