	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun8i_phy_clk_determine_rate
_sun8i_phy_clk_determine_rate:          ## @sun8i_phy_clk_determine_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %r14
	callq	_clk_hw_get_num_parents
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rcx
LBB0_20:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	cmpq	%r14, %rax
	je	LBB0_22
LBB0_21:                                ##   in Loop: Header=BB0_3 Depth=1
	incl	%ebx
	movq	%r15, %rdi
	callq	_clk_hw_get_num_parents
	cmpl	%eax, %ebx
	jge	LBB0_22
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_clk_hw_get_parent_by_index
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_21
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movl	$1, %r15d
	movq	%r14, %r13
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movq	%r12, %rbx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=2
	movl	%r15d, %r8d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, %rbx
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=2
	incq	%r15
	addq	%r14, %r13
	cmpq	$17, %r15
	je	LBB0_17
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r8d, %r12d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_clk_hw_round_rate
	cmpq	%rax, %r13
	je	LBB0_16
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	%rax, %rcx
	testq	%rbx, %rbx
	je	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=2
	movl	%r12d, %r8d
	movq	%rcx, %rax
	orq	%r15, %rax
	shrq	$32, %rax
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	%rcx, %rax
	xorl	%edx, %edx
	divq	%r15
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=2
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%r15d
                                        ## kill: def $eax killed $eax def $rax
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=2
	movq	%r14, %rdx
	subq	%rax, %rdx
	movq	%rdx, %rsi
	negq	%rsi
	cmovsq	%rdx, %rsi
	movslq	%r8d, %rdi
	movq	%rbx, %rax
	orq	%rdi, %rax
	shrq	$32, %rax
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rdi
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=2
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%r8d
                                        ## kill: def $eax killed $eax def $rax
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=2
	movq	%r14, %rdx
	subq	%rax, %rdx
	movq	%rdx, %rax
	negq	%rax
	cmovsq	%rdx, %rax
	cmpq	%rax, %rsi
	jb	LBB0_14
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	%r15d, %r8d
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rbx
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	movslq	%r8d, %rcx
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, %r12
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%r8d
                                        ## kill: def $eax killed $eax def $rax
	jmp	LBB0_20
LBB0_1:
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
LBB0_22:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movslq	%esi, %rcx
	movq	%r12, %rdi
	movq	%r12, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_23
## %bb.24:
	movq	%rdi, %rax
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_25
LBB0_23:
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_25:
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	%rdi, 8(%rcx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%rcx)
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_sun8i_phy_clk_determine_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun8i_phy_clk_determine_rate
_sun8i_phy_clk_determine_rate:          ; @sun8i_phy_clk_determine_rate
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
	ldr	x25, [x1]
	bl	_clk_hw_get_num_parents
	cmp	w0, #1
	b.lt	LBB0_12
; %bb.1:
	mov	x26, #0
	mov	x24, #0
	mov	w21, #0
	mov	w27, #1
                                        ; kill: def $w27 killed $w27 killed $x27 def $x27
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, x28
	mov	x24, x22
	mov	x26, x23
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x8, x27
	sxtw	x8, w8
	udiv	x8, x26, x8
	cmp	x8, x25
	b.eq	LBB0_13
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w21, w21, #1
	mov	x0, x20
	bl	_clk_hw_get_num_parents
	cmp	w21, w0
	b.ge	LBB0_13
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	mov	x0, x20
	mov	x1, x21
	bl	_clk_hw_get_parent_by_index
	cbz	x0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x22, x0
	mov	x23, x25
	mov	w28, #1
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=2
	mov	x27, x28
	mov	x24, x22
	mov	x26, x0
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	add	x28, x28, #1
	add	x23, x23, x25
	cmp	x28, #17
	b.eq	LBB0_3
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x22
	mov	x1, x23
	bl	_clk_hw_round_rate
	cmp	x23, x0
	b.eq	LBB0_2
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	cbz	x26, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	udiv	x8, x0, x28
	subs	x8, x25, x8
	cneg	x8, x8, mi
	sxtw	x9, w27
	udiv	x9, x26, x9
	subs	x9, x25, x9
	cneg	x9, x9, mi
	cmp	x8, x9
	b.lo	LBB0_7
	b	LBB0_8
LBB0_12:
	mov	x24, #0
	mov	x26, #0
	mov	w27, #1
LBB0_13:
                                        ; kill: def $w27 killed $w27 killed $x27 def $x27
	sxtw	x8, w27
	udiv	x8, x26, x8
	stp	x8, x26, [x19]
	str	x24, [x19, #16]
	mov	w0, #0
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_sun8i_phy_clk_determine_rate
.subsections_via_symbols
