	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gx_set_cpuspeed
_gx_set_cpuspeed:                       ## @gx_set_cpuspeed
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	$0, -40(%rbp)
	xorl	%edi, %edi
	callq	_gx_get_cpuspeed
	movl	%eax, -44(%rbp)
	movq	_gx_params@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	leaq	4(%rsi), %rdx
	movl	%ebx, %edi
	callq	_gx_validate_speed
	movl	%eax, %ebx
	movl	%eax, -48(%rbp)
	movq	_CPUFREQ_PRECHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdi
	callq	_cpufreq_notify_transition
	callq	_local_irq_save
	movq	_stock_freq@GOTPCREL(%rip), %rcx
	movq	(%r14), %rax
	cmpl	(%rcx), %ebx
	jne	LBB0_2
## %bb.1:
	movq	_SUSMOD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	12(%rax), %ecx
	movl	%ecx, -28(%rbp)
	movq	$0, (%rax)
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
	movq	(%r14), %rax
	movl	-28(%rbp), %r15d
	jmp	LBB0_10
LBB0_2:
	movq	16(%rax), %rcx
	movl	(%rcx), %ecx
	leal	-129(%rcx), %edx
	cmpl	$2, %edx
	jae	LBB0_4
## %bb.3:
	movq	_SUSMOD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	orl	12(%rax), %r15d
	jmp	LBB0_9
LBB0_4:
	cmpl	$128, %ecx
	jne	LBB0_7
## %bb.5:
	movq	_IRQ_SPDUP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	8(%rax), %ebx
	movq	_VID_SPDUP@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_PCI_IRQTC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$4, %esi
	callq	_gx_write_byte
	movq	_PCI_VIDTC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$100, %esi
	callq	_gx_write_byte
	movq	_PCI_PMER1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_gx_write_byte
	movq	(%r14), %rax
	movq	16(%rax), %rcx
	movq	_SUSMOD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r15d
	orl	12(%rax), %r15d
	cmpl	$15, 4(%rcx)
	jle	LBB0_9
## %bb.8:
	movq	_PWRSVE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r15d
LBB0_9:
	movl	%r15d, -28(%rbp)
LBB0_10:
	movq	_PCI_MODOFF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	4(%rax), %esi
	callq	_gx_write_byte
	movq	_PCI_MODON@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rax
	movl	(%rax), %esi
	callq	_gx_write_byte
	movq	_PCI_SUSCFG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movl	%r15d, %esi
	callq	_gx_write_byte
	movq	(%r14), %rax
	movq	16(%rax), %rdi
	movl	(%rbx), %esi
	leaq	-28(%rbp), %rdx
	callq	_pci_read_config_byte
	callq	_local_irq_restore
	movl	-28(%rbp), %eax
	movq	(%r14), %rcx
	movl	%eax, 12(%rcx)
	movq	_CPUFREQ_POSTCHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdi
	callq	_cpufreq_notify_transition
	movq	(%r14), %rax
	movl	(%rax), %esi
	movl	4(%rax), %edx
	shll	$5, %esi
	shll	$5, %edx
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
	movl	-48(%rbp), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	_local_irq_restore
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_dprintk
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_gx_params,8,3                  ## @gx_params
	.comm	_CPUFREQ_PRECHANGE,4,2          ## @CPUFREQ_PRECHANGE
	.comm	_stock_freq,4,2                 ## @stock_freq
	.comm	_IRQ_SPDUP,4,2                  ## @IRQ_SPDUP
	.comm	_VID_SPDUP,4,2                  ## @VID_SPDUP
	.comm	_PCI_IRQTC,4,2                  ## @PCI_IRQTC
	.comm	_PCI_VIDTC,4,2                  ## @PCI_VIDTC
	.comm	_PCI_PMER1,4,2                  ## @PCI_PMER1
	.comm	_SUSMOD,4,2                     ## @SUSMOD
	.comm	_PWRSVE,4,2                     ## @PWRSVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fatal: try to set unknown chipset.\n"

L_.str.1:                               ## @.str.1
	.asciz	"suspend modulation disabled: cpu runs 100%% speed.\n"

	.comm	_PCI_MODOFF,4,2                 ## @PCI_MODOFF
	.comm	_PCI_MODON,4,2                  ## @PCI_MODON
	.comm	_PCI_SUSCFG,4,2                 ## @PCI_SUSCFG
	.comm	_CPUFREQ_POSTCHANGE,4,2         ## @CPUFREQ_POSTCHANGE
L_.str.2:                               ## @.str.2
	.asciz	"suspend modulation w/ duration of ON:%d us, OFF:%d us\n"

L_.str.3:                               ## @.str.3
	.asciz	"suspend modulation w/ clock speed: %d kHz.\n"

	.no_dead_strip	_gx_set_cpuspeed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gx_set_cpuspeed
_gx_set_cpuspeed:                       ; @gx_set_cpuspeed
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
	str	xzr, [sp, #32]
	mov	w0, #0
	bl	_gx_get_cpuspeed
	str	w0, [sp, #28]
Lloh0:
	adrp	x20, _gx_params@GOTPAGE
Lloh1:
	ldr	x20, [x20, _gx_params@GOTPAGEOFF]
	ldr	x1, [x20]
	add	x2, x1, #4
	mov	x0, x19
	bl	_gx_validate_speed
	mov	x19, x0
	str	w0, [sp, #24]
Lloh2:
	adrp	x8, _CPUFREQ_PRECHANGE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CPUFREQ_PRECHANGE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x0, sp, #24
	bl	_cpufreq_notify_transition
	bl	_local_irq_save
Lloh5:
	adrp	x8, _stock_freq@GOTPAGE
Lloh6:
	ldr	x8, [x8, _stock_freq@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x8]
	ldr	x8, [x20]
	cmp	w19, w9
	b.ne	LBB0_2
; %bb.1:
Lloh8:
	adrp	x9, _SUSMOD@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SUSMOD@GOTPAGEOFF]
	ldr	w10, [x8, #12]
Lloh10:
	ldr	w9, [x9]
	bic	w9, w10, w9
	stur	w9, [x29, #-36]
	str	xzr, [x8]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dprintk
	ldr	x8, [x20]
	ldur	w19, [x29, #-36]
	b	LBB0_8
LBB0_2:
	ldr	x9, [x8, #16]
	ldr	w9, [x9]
	sub	w10, w9, #129
	cmp	w10, #2
	b.hs	LBB0_4
; %bb.3:
	ldr	w9, [x8, #12]
Lloh13:
	adrp	x10, _SUSMOD@GOTPAGE
Lloh14:
	ldr	x10, [x10, _SUSMOD@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	orr	w19, w10, w9
	b	LBB0_7
LBB0_4:
	cmp	w9, #128
	b.ne	LBB0_10
; %bb.5:
	ldr	w8, [x8, #8]
Lloh16:
	adrp	x9, _IRQ_SPDUP@GOTPAGE
Lloh17:
	ldr	x9, [x9, _IRQ_SPDUP@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x10, _VID_SPDUP@GOTPAGE
Lloh20:
	ldr	x10, [x10, _VID_SPDUP@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh21:
	ldr	w9, [x10]
	orr	w19, w8, w9
Lloh22:
	adrp	x8, _PCI_IRQTC@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PCI_IRQTC@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	mov	w1, #4
	bl	_gx_write_byte
Lloh25:
	adrp	x8, _PCI_VIDTC@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PCI_VIDTC@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	mov	w1, #100
	bl	_gx_write_byte
Lloh28:
	adrp	x8, _PCI_PMER1@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PCI_PMER1@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_gx_write_byte
	ldr	x8, [x20]
	ldr	x9, [x8, #16]
	ldr	w9, [x9, #4]
	ldr	w10, [x8, #12]
Lloh31:
	adrp	x11, _SUSMOD@GOTPAGE
Lloh32:
	ldr	x11, [x11, _SUSMOD@GOTPAGEOFF]
Lloh33:
	ldr	w11, [x11]
	orr	w19, w11, w10
	cmp	w9, #15
	b.le	LBB0_7
; %bb.6:
Lloh34:
	adrp	x9, _PWRSVE@GOTPAGE
Lloh35:
	ldr	x9, [x9, _PWRSVE@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	orr	w19, w19, w9
LBB0_7:
	stur	w19, [x29, #-36]
LBB0_8:
Lloh37:
	adrp	x9, _PCI_MODOFF@GOTPAGE
Lloh38:
	ldr	x9, [x9, _PCI_MODOFF@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x9]
	ldr	w1, [x8, #4]
	bl	_gx_write_byte
Lloh40:
	adrp	x8, _PCI_MODON@GOTPAGE
Lloh41:
	ldr	x8, [x8, _PCI_MODON@GOTPAGEOFF]
Lloh42:
	ldr	w0, [x8]
	ldr	x8, [x20]
	ldr	w1, [x8]
	bl	_gx_write_byte
Lloh43:
	adrp	x21, _PCI_SUSCFG@GOTPAGE
Lloh44:
	ldr	x21, [x21, _PCI_SUSCFG@GOTPAGEOFF]
	ldr	w0, [x21]
	mov	x1, x19
	bl	_gx_write_byte
	ldr	x8, [x20]
	ldr	x0, [x8, #16]
	ldr	w1, [x21]
	sub	x2, x29, #36
	bl	_pci_read_config_byte
	bl	_local_irq_restore
	ldur	w8, [x29, #-36]
	ldr	x9, [x20]
	str	w8, [x9, #12]
Lloh45:
	adrp	x8, _CPUFREQ_POSTCHANGE@GOTPAGE
Lloh46:
	ldr	x8, [x8, _CPUFREQ_POSTCHANGE@GOTPAGEOFF]
Lloh47:
	ldr	w1, [x8]
	add	x0, sp, #24
	bl	_cpufreq_notify_transition
	ldr	x8, [x20]
	ldp	w9, w8, [x8]
	lsl	w9, w9, #5
	lsl	w8, w8, #5
	stp	x9, x8, [sp]
Lloh48:
	adrp	x0, l_.str.2@PAGE
Lloh49:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_dprintk
	ldr	w8, [sp, #24]
	str	x8, [sp]
Lloh50:
	adrp	x0, l_.str.3@PAGE
Lloh51:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_9:
	bl	_dprintk
	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
	add	sp, sp, #96
	ret
LBB0_10:
	bl	_local_irq_restore
Lloh52:
	adrp	x0, l_.str@PAGE
Lloh53:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh52, Lloh53
	.cfi_endproc
                                        ; -- End function
	.comm	_gx_params,8,3                  ; @gx_params
	.comm	_CPUFREQ_PRECHANGE,4,2          ; @CPUFREQ_PRECHANGE
	.comm	_stock_freq,4,2                 ; @stock_freq
	.comm	_IRQ_SPDUP,4,2                  ; @IRQ_SPDUP
	.comm	_VID_SPDUP,4,2                  ; @VID_SPDUP
	.comm	_PCI_IRQTC,4,2                  ; @PCI_IRQTC
	.comm	_PCI_VIDTC,4,2                  ; @PCI_VIDTC
	.comm	_PCI_PMER1,4,2                  ; @PCI_PMER1
	.comm	_SUSMOD,4,2                     ; @SUSMOD
	.comm	_PWRSVE,4,2                     ; @PWRSVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fatal: try to set unknown chipset.\n"

l_.str.1:                               ; @.str.1
	.asciz	"suspend modulation disabled: cpu runs 100%% speed.\n"

	.comm	_PCI_MODOFF,4,2                 ; @PCI_MODOFF
	.comm	_PCI_MODON,4,2                  ; @PCI_MODON
	.comm	_PCI_SUSCFG,4,2                 ; @PCI_SUSCFG
	.comm	_CPUFREQ_POSTCHANGE,4,2         ; @CPUFREQ_POSTCHANGE
l_.str.2:                               ; @.str.2
	.asciz	"suspend modulation w/ duration of ON:%d us, OFF:%d us\n"

l_.str.3:                               ; @.str.3
	.asciz	"suspend modulation w/ clock speed: %d kHz.\n"

	.no_dead_strip	_gx_set_cpuspeed
.subsections_via_symbols
