	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun4i_tmds_determine_rate
_sun4i_tmds_determine_rate:             ## @sun4i_tmds_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	%rsi, %r14
	movq	%rdi, %r13
	callq	_hw_to_tmds
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	(%r14), %r15
	movq	%r13, %rdi
	callq	_clk_hw_get_num_parents
	testl	%eax, %eax
	jle	LBB0_43
## %bb.1:
	leaq	(%r15,%r15), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	movl	$1, %r14d
	xorl	%r12d, %r12d
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_41:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	incl	%ebx
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_clk_hw_get_num_parents
	cmpl	%eax, %ebx
	jge	LBB0_42
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##     Child Loop BB0_26 Depth 2
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_clk_hw_get_parent_by_index
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	je	LBB0_41
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	testl	%eax, %eax
	movl	%eax, %edx
	movl	$1, %ecx
	cmovel	%ecx, %edx
	leal	16(%rax), %ecx
	cmpl	%ecx, %edx
	jge	LBB0_24
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	%edx, %r13
	movq	%r15, %rbx
	imulq	%r13, %rbx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_5 Depth=2
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%rcx, %r12
	movl	%r13d, %r14d
LBB0_22:                                ##   in Loop: Header=BB0_5 Depth=2
	leaq	1(%r13), %rcx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movslq	(%rax), %rax
	leaq	15(%rax), %rdx
	addq	%r15, %rbx
	cmpq	%rdx, %r13
	movq	%rcx, %r13
	jge	LBB0_23
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_clk_hw_round_rate
	cmpq	%rax, %rbx
	je	LBB0_6
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%rax, %rcx
	testq	%r12, %r12
	je	LBB0_21
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%rcx, %rax
	orq	%r13, %rax
	shrq	$32, %rax
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%rcx, %rax
	xorl	%edx, %edx
	divq	%r13
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=2
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%r13d
                                        ## kill: def $eax killed $eax def $rax
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=2
	movq	%r15, %rdx
	subq	%rax, %rdx
	movq	%rdx, %rsi
	negq	%rsi
	cmovsq	%rdx, %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%r12, %rax
	shrq	$32, %rax
	je	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%r12, %rax
	xorl	%edx, %edx
	divq	%rdi
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=2
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%edi
                                        ## kill: def $eax killed $eax def $rax
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=2
	movslq	%r14d, %rdi
	movq	%rax, %rdx
	orq	%rdi, %rdx
	shrq	$32, %rdx
	je	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_5 Depth=2
	xorl	%edx, %edx
	divq	%rdi
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_5 Depth=2
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r14d
                                        ## kill: def $eax killed $eax def $rax
LBB0_20:                                ##   in Loop: Header=BB0_5 Depth=2
	movq	%r15, %rdx
	subq	%rax, %rdx
	movq	%rdx, %rax
	negq	%rax
	cmovsq	%rdx, %rax
	cmpq	%rax, %rsi
	jb	LBB0_21
	jmp	LBB0_22
LBB0_23:                                ##   in Loop: Header=BB0_2 Depth=1
	leal	16(%rax), %ecx
LBB0_24:                                ##   in Loop: Header=BB0_2 Depth=1
	testl	%eax, %eax
	movl	$1, %edx
	cmovel	%edx, %eax
	cmpl	%ecx, %eax
	jge	LBB0_41
## %bb.25:                              ##   in Loop: Header=BB0_2 Depth=1
	movslq	%eax, %r13
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	imulq	%r13, %rbx
	jmp	LBB0_26
	.p2align	4, 0x90
LBB0_39:                                ##   in Loop: Header=BB0_26 Depth=2
	movl	$2, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%rcx, %r12
	movl	%r13d, %r14d
LBB0_40:                                ##   in Loop: Header=BB0_26 Depth=2
	leaq	1(%r13), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movslq	(%rcx), %rcx
	addq	$15, %rcx
	addq	-80(%rbp), %rbx                 ## 8-byte Folded Reload
	cmpq	%rcx, %r13
	movq	%rax, %r13
	jge	LBB0_41
LBB0_26:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_clk_hw_round_rate
	cmpq	%rax, %rbx
	je	LBB0_27
## %bb.28:                              ##   in Loop: Header=BB0_26 Depth=2
	movq	%rax, %rcx
	testq	%r12, %r12
	je	LBB0_39
## %bb.29:                              ##   in Loop: Header=BB0_26 Depth=2
	movq	%rcx, %rax
	shrq	%rax
	movq	%rax, %rdx
	orq	%r13, %rdx
	shrq	$32, %rdx
	je	LBB0_30
## %bb.31:                              ##   in Loop: Header=BB0_26 Depth=2
	xorl	%edx, %edx
	divq	%r13
	jmp	LBB0_32
	.p2align	4, 0x90
LBB0_30:                                ##   in Loop: Header=BB0_26 Depth=2
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r13d
                                        ## kill: def $eax killed $eax def $rax
LBB0_32:                                ##   in Loop: Header=BB0_26 Depth=2
	movq	%r15, %rdx
	subq	%rax, %rdx
	movq	%rdx, %rsi
	negq	%rsi
	cmovsq	%rdx, %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%r12, %rax
	shrq	$32, %rax
	je	LBB0_33
## %bb.34:                              ##   in Loop: Header=BB0_26 Depth=2
	movq	%r12, %rax
	xorl	%edx, %edx
	divq	%rdi
	jmp	LBB0_35
	.p2align	4, 0x90
LBB0_33:                                ##   in Loop: Header=BB0_26 Depth=2
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%edi
                                        ## kill: def $eax killed $eax def $rax
LBB0_35:                                ##   in Loop: Header=BB0_26 Depth=2
	movslq	%r14d, %rdi
	movq	%rax, %rdx
	orq	%rdi, %rdx
	shrq	$32, %rdx
	je	LBB0_36
## %bb.37:                              ##   in Loop: Header=BB0_26 Depth=2
	xorl	%edx, %edx
	divq	%rdi
	jmp	LBB0_38
	.p2align	4, 0x90
LBB0_36:                                ##   in Loop: Header=BB0_26 Depth=2
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r14d
                                        ## kill: def $eax killed $eax def $rax
LBB0_38:                                ##   in Loop: Header=BB0_26 Depth=2
	movq	%r15, %rdx
	subq	%rax, %rdx
	movq	%rdx, %rax
	negq	%rax
	cmovsq	%rdx, %rax
	cmpq	%rax, %rsi
	jb	LBB0_39
	jmp	LBB0_40
LBB0_6:
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_7
LBB0_27:
	movl	$2, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_7:
	movq	%rbx, %r12
	movl	%r13d, %r14d
LBB0_8:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	%r12, %rax
	shrq	$32, %rax
	je	LBB0_9
## %bb.44:
	movq	%r12, %rax
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_45
LBB0_9:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_45:
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movslq	%r14d, %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_46
## %bb.47:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_48
LBB0_46:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r14d
                                        ## kill: def $eax killed $eax def $rax
LBB0_48:
	movq	%rax, (%rsi)
	movq	%r12, 8(%rsi)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%rsi)
	xorl	%eax, %eax
	jmp	LBB0_49
LBB0_42:
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	jne	LBB0_8
LBB0_43:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_49:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_sun4i_tmds_determine_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun4i_tmds_determine_rate
_sun4i_tmds_determine_rate:             ; @sun4i_tmds_determine_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
	mov	x19, x1
	mov	x24, x0
	bl	_hw_to_tmds
	mov	x22, x0
	ldr	x26, [x19]
	mov	x0, x24
	bl	_clk_hw_get_num_parents
	cmp	w0, #1
	b.lt	LBB0_24
; %bb.1:
	stp	x19, x24, [sp]                  ; 16-byte Folded Spill
	mov	w23, #0
	mov	x27, #0
	lsl	x28, x26, #1
	mov	w25, #1
	mov	w21, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w23, w23, #1
	ldr	x24, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x24
	bl	_clk_hw_get_num_parents
	cmp	w23, w0
	b.ge	LBB0_23
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;     Child Loop BB0_16 Depth 2
	mov	x0, x24
	mov	x1, x23
	bl	_clk_hw_get_parent_by_index
	mov	x20, x0
	cbz	x0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x22]
	cmp	w8, #0
	csinc	w10, w8, wzr, ne
	add	w9, w8, #16
	cmp	w10, w9
	b.ge	LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	sxtw	x19, w10
	mul	x24, x26, x19
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=2
	mov	w25, #1
	mov	x27, x0
	mov	x21, x19
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	add	x9, x19, #1
	ldrsw	x8, [x22]
	add	x10, x8, #15
	add	x24, x24, x26
	cmp	x19, x10
	mov	x19, x9
	b.ge	LBB0_11
LBB0_8:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	mov	x1, x24
	bl	_clk_hw_round_rate
	cmp	x24, x0
	b.eq	LBB0_19
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	cbz	x27, LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=2
	udiv	x8, x0, x19
	subs	x8, x26, x8
	cneg	x8, x8, mi
	mov	w9, w25
	udiv	x9, x27, x9
	sxtw	x10, w21
	udiv	x9, x9, x10
	subs	x9, x26, x9
	cneg	x9, x9, mi
	cmp	x8, x9
	b.lo	LBB0_6
	b	LBB0_7
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w9, w8, #16
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w8, #0
	csinc	w8, w8, wzr, ne
	cmp	w8, w9
	b.ge	LBB0_2
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
	sxtw	x19, w8
	mul	x24, x28, x19
	b	LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_16 Depth=2
	mov	w25, #2
	mov	x27, x0
	mov	x21, x19
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=2
	add	x8, x19, #1
	ldrsw	x9, [x22]
	add	x9, x9, #15
	add	x24, x24, x28
	cmp	x19, x9
	mov	x19, x8
	b.ge	LBB0_2
LBB0_16:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	mov	x1, x24
	bl	_clk_hw_round_rate
	cmp	x24, x0
	b.eq	LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=2
	cbz	x27, LBB0_14
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=2
	lsr	x8, x0, #1
	udiv	x8, x8, x19
	subs	x8, x26, x8
	cneg	x8, x8, mi
	mov	w9, w25
	udiv	x9, x27, x9
	sxtw	x10, w21
	udiv	x9, x9, x10
	subs	x9, x26, x9
	cneg	x9, x9, mi
	cmp	x8, x9
	b.lo	LBB0_14
	b	LBB0_15
LBB0_19:
	mov	w25, #1
	b	LBB0_21
LBB0_20:
	mov	w25, #2
LBB0_21:
	ldr	x10, [sp]                       ; 8-byte Folded Reload
	mov	x27, x24
	mov	x21, x19
LBB0_22:
	mov	w0, #0
	mov	w8, w25
	udiv	x8, x27, x8
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	sxtw	x9, w21
	udiv	x8, x8, x9
	stp	x8, x27, [x10]
	str	x20, [x10, #16]
	b	LBB0_25
LBB0_23:
	ldr	x10, [sp]                       ; 8-byte Folded Reload
	cbnz	x20, LBB0_22
LBB0_24:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_25:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_sun4i_tmds_determine_rate
.subsections_via_symbols
