	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function devfreq_simple_ondemand_func
_devfreq_simple_ondemand_func:          ## @devfreq_simple_ondemand_func
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	_DFSO_UPTHRESHOLD@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_DFSO_DOWNDIFFERENCTIAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	16(%rdi), %rbx
	callq	_devfreq_update_stats
	testl	%eax, %eax
	jne	LBB0_18
## %bb.1:
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.2:
	movl	(%rbx), %eax
	testl	%eax, %eax
	cmovnel	%eax, %r15d
	movl	4(%rbx), %eax
	testl	%eax, %eax
	cmovnel	%eax, %r12d
LBB0_3:
	cmpl	$100, %r15d
	ja	LBB0_5
## %bb.4:
	movl	%r15d, %eax
	subl	%r12d, %eax
	jb	LBB0_5
## %bb.6:
	movl	(%r13), %esi
	testl	%esi, %esi
	je	LBB0_7
## %bb.8:
	movl	4(%r13), %ecx
	cmpl	$16777215, %ecx                 ## imm = 0xFFFFFF
	jg	LBB0_10
## %bb.9:
	cmpl	$16777216, %esi                 ## imm = 0x1000000
	jl	LBB0_11
LBB0_10:
	sarl	$7, %ecx
	movl	%ecx, 4(%r13)
	sarl	$7, %esi
	movl	%esi, (%r13)
LBB0_11:
	imull	$100, %ecx, %edx
	movl	%esi, %edi
	imull	%r15d, %edi
	cmpl	%edi, %edx
	ja	LBB0_7
## %bb.12:
	movq	8(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.13:
	imull	%esi, %eax
	cmpl	%eax, %edx
	jbe	LBB0_15
## %bb.14:
	movq	%rdi, (%r14)
	jmp	LBB0_17
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
LBB0_7:
	movq	_DEVFREQ_MAX_FREQ@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_16:
	movq	%rax, (%r14)
LBB0_17:
	xorl	%eax, %eax
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movslq	%ecx, %rax
	imulq	%rax, %rdi
	callq	_div_u64
	imulq	$100, %rax, %rdi
	shrl	%r12d
	subl	%r12d, %r15d
	movl	%r15d, %esi
	callq	_div_u64
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_DFSO_UPTHRESHOLD,4,2           ## @DFSO_UPTHRESHOLD
	.comm	_DFSO_DOWNDIFFERENCTIAL,4,2     ## @DFSO_DOWNDIFFERENCTIAL
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DEVFREQ_MAX_FREQ,8,3           ## @DEVFREQ_MAX_FREQ
	.no_dead_strip	_devfreq_simple_ondemand_func
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function devfreq_simple_ondemand_func
_devfreq_simple_ondemand_func:          ; @devfreq_simple_ondemand_func
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _DFSO_UPTHRESHOLD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DFSO_UPTHRESHOLD@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
Lloh3:
	adrp	x8, _DFSO_DOWNDIFFERENCTIAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DFSO_DOWNDIFFERENCTIAL@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	ldr	x23, [x0, #16]
	bl	_devfreq_update_stats
	cbnz	w0, LBB0_15
; %bb.1:
	cbz	x23, LBB0_3
; %bb.2:
	ldp	w8, w9, [x23]
	cmp	w8, #0
	csel	w21, w21, w8, eq
	cmp	w9, #0
	csel	w22, w22, w9, eq
LBB0_3:
	cmp	w21, #100
	ccmp	w21, w22, #0, ls
	b.hs	LBB0_5
; %bb.4:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_5:
	ldr	w1, [x20]
	cbz	w1, LBB0_13
; %bb.6:
	ldr	w8, [x20, #4]
	mov	w9, #16777215
	cmp	w8, w9
	b.gt	LBB0_8
; %bb.7:
	mov	w9, #16777216
	cmp	w1, w9
	b.lt	LBB0_9
LBB0_8:
	asr	w8, w8, #7
	asr	w1, w1, #7
	stp	w1, w8, [x20]
LBB0_9:
	mov	w9, #100
	mul	w10, w8, w9
	mul	w9, w1, w21
	cmp	w10, w9
	b.hi	LBB0_13
; %bb.10:
	ldr	x9, [x20, #8]
	cbz	x9, LBB0_13
; %bb.11:
	sub	w11, w21, w22
	mul	w11, w1, w11
	cmp	w10, w11
	b.ls	LBB0_16
; %bb.12:
	mov	w0, #0
	str	x9, [x19]
	b	LBB0_15
LBB0_13:
	mov	w0, #0
Lloh9:
	adrp	x8, _DEVFREQ_MAX_FREQ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DEVFREQ_MAX_FREQ@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
LBB0_14:
	str	x8, [x19]
LBB0_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_16:
	sxtw	x8, w8
	mul	x0, x9, x8
	bl	_div_u64
	mov	w8, #100
	mul	x0, x0, x8
	sub	w1, w21, w22, lsr #1
	bl	_div_u64
	mov	x8, x0
	mov	w0, #0
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_DFSO_UPTHRESHOLD,4,2           ; @DFSO_UPTHRESHOLD
	.comm	_DFSO_DOWNDIFFERENCTIAL,4,2     ; @DFSO_DOWNDIFFERENCTIAL
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DEVFREQ_MAX_FREQ,8,3           ; @DEVFREQ_MAX_FREQ
	.no_dead_strip	_devfreq_simple_ondemand_func
.subsections_via_symbols
