	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun4i_dclk_round_rate
_sun4i_dclk_round_rate:                 ## @sun4i_dclk_round_rate
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	callq	_hw_to_dclk
	movq	(%rax), %rax
	movslq	(%rax), %r10
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	cmpl	4(%rax), %r10d
	jle	LBB0_2
## %bb.1:
	movl	$1, %r13d
	xorl	%r8d, %r8d
	jmp	LBB0_16
LBB0_2:
	movslq	%ebx, %rax
	movq	%r10, %rsi
	shlq	$32, %rsi
	movq	%r10, %r15
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	imulq	%rax, %r15
	movl	$1, %edx
	xorl	%r12d, %r12d
	movq	%rbx, %rcx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	leaq	1(%r14), %r10
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movslq	4(%rdx), %rax
	movabsq	$4294967296, %rdi               ## imm = 0x100000000
	addq	%rdi, %rsi
	addq	-64(%rbp), %r15                 ## 8-byte Folded Reload
	movq	%r8, %r12
	movq	%r13, %rdx
	cmpq	%rax, %r14
	jge	LBB0_16
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_ULONG_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %r15
	jg	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r10, %rbx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rcx, %r14
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_clk_hw_get_parent
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_clk_hw_round_rate
	movq	%r15, %rcx
	cmpq	%rax, %r15
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %r8
	movq	%rbx, %rdi
	orq	%rbx, %rax
	shrq	$32, %rax
	movq	%r14, %rbx
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r8, %rax
	xorl	%edx, %edx
	divq	%rdi
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%r8d, %eax
	xorl	%edx, %edx
	divl	%edi
                                        ## kill: def $eax killed $eax def $rax
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rsi
	movq	-48(%rbp), %r11                 ## 8-byte Reload
	movq	%rdi, %r14
	movq	%rcx, %r15
	movq	%rbx, %rcx
	movq	%rbx, %rdx
	subq	%rax, %rdx
	movq	%rdx, %rdi
	negq	%rdi
	cmovsq	%rdx, %rdi
	movq	%r12, %rax
	orq	%r11, %rax
	shrq	$32, %rax
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rax
	xorl	%edx, %edx
	divq	%r11
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%r11d
                                        ## kill: def $eax killed $eax def $rax
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, %rdx
	subq	%rax, %rdx
	movq	%rdx, %rax
	negq	%rax
	cmovsq	%rdx, %rax
	movq	%r14, %r13
	cmpq	%rax, %rdi
	jb	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r11, %r13
	movq	%r12, %r8
	jmp	LBB0_15
LBB0_4:
	movq	%rdx, %r13
	movq	%r12, %r8
	jmp	LBB0_16
LBB0_6:
	sarq	$32, %r13
	movq	%rcx, %r8
LBB0_16:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%r8, (%rax)
	movq	%r8, %rax
	orq	%r13, %rax
	shrq	$32, %rax
	je	LBB0_17
## %bb.18:
	movq	%r8, %rax
	xorl	%edx, %edx
	divq	%r13
	jmp	LBB0_19
LBB0_17:
	movl	%r8d, %eax
	xorl	%edx, %edx
	divl	%r13d
                                        ## kill: def $eax killed $eax def $rax
LBB0_19:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ULONG_MAX,4,2                  ## @ULONG_MAX
	.no_dead_strip	_sun4i_dclk_round_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun4i_dclk_round_rate
_sun4i_dclk_round_rate:                 ; @sun4i_dclk_round_rate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	x2, [sp, #8]                    ; 8-byte Folded Spill
	mov	x20, x1
	mov	x21, x0
	bl	_hw_to_dclk
	ldr	x25, [x0]
	ldp	w26, w8, [x25]
                                        ; kill: def $w26 killed $w26 def $x26
	sxtw	x26, w26
	cmp	w26, w8
	b.le	LBB0_2
; %bb.1:
	mov	x23, #0
	mov	w24, #1
	b	LBB0_7
LBB0_2:
	mov	x23, #0
	sxtw	x28, w20
	lsl	x27, x26, #32
	mul	x22, x26, x28
	mov	w24, #1
Lloh0:
	adrp	x19, _ULONG_MAX@GOTPAGE
Lloh1:
	ldr	x19, [x19, _ULONG_MAX@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x8, [x19]
	cmp	x22, x8
	b.gt	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	bl	_clk_hw_get_parent
	mov	x1, x22
	bl	_clk_hw_round_rate
	cmp	x22, x0
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	udiv	x8, x0, x26
	subs	x8, x20, x8
	cneg	x8, x8, mi
	udiv	x9, x23, x24
	subs	x9, x20, x9
	cneg	x9, x9, mi
	cmp	x8, x9
	csel	x24, x26, x24, lo
	csel	x23, x0, x23, lo
	add	x8, x26, #1
	ldrsw	x9, [x25, #4]
	mov	x10, #4294967296
	add	x27, x27, x10
	add	x22, x22, x28
	cmp	x26, x9
	mov	x26, x8
	b.lt	LBB0_3
	b	LBB0_7
LBB0_6:
	asr	x24, x27, #32
	mov	x23, x22
LBB0_7:
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	str	x23, [x8]
	udiv	x0, x23, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_ULONG_MAX,4,2                  ; @ULONG_MAX
	.no_dead_strip	_sun4i_dclk_round_rate
.subsections_via_symbols
