	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function serdes_am654_clk_mux_set_parent
_serdes_am654_clk_mux_set_parent:       ## @serdes_am654_clk_mux_set_parent
	.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
	movl	%esi, -64(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_to_serdes_am654_clk_mux
	movq	%rax, %rbx
	movq	8(%rax), %r14
	movq	%r15, %rdi
	callq	_clk_hw_get_name
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %r15d
	movslq	4(%rbx), %r13
	movq	_SERDES_NUM_CLOCKS@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	leaq	-56(%rbp), %rdx
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%r15d, -60(%rbp)                ## 4-byte Spill
	callq	_regmap_read
	movq	_AM654_SERDES_CTRL_CLKSEL_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_AM654_SERDES_CTRL_CLKSEL_SHIFT@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movl	(%r12), %r12d
	testl	%r12d, %r12d
	jle	LBB0_2
## %bb.1:
	movq	-56(%rbp), %rax
	andq	%r15, %rax
	movl	%r14d, %ecx
	shrq	%cl, %rax
	movq	_serdes_am654_mux_table@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	(%rdx,%rax,8), %rsi
	leaq	(,%r12,4), %rdx
	movq	%rbx, %rdi
	callq	_memcpy
LBB0_2:
	movl	-64(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rbx,%r13,4)
	movq	_SERDES_NUM_MUX_COMBINATIONS@GOTPCREL(%rip), %rax
	movq	(%rax), %r10
	testq	%r10, %r10
	je	LBB0_11
## %bb.3:
	movq	_serdes_am654_mux_table@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	xorl	%eax, %eax
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	testl	%r12d, %r12d
	jle	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r8,%rax,8), %rsi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rbx,%rdi,4), %edx
	cmpl	(%rsi,%rdi,4), %edx
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_9 Depth=2
	incq	%rdi
	cmpq	%rdi, %r12
	jne	LBB0_9
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	incq	%rax
	cmpq	%r10, %rax
	jne	LBB0_4
LBB0_11:
	movq	%r10, -56(%rbp)
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_WARN
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_5:
	xorl	%eax, %eax
LBB0_6:
	movl	%r14d, %ecx
	shlq	%cl, %rax
	movq	%rax, -56(%rbp)
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movq	%r15, %rdx
	movq	%rax, %rcx
	callq	_regmap_update_bits
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_14
## %bb.13:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SERDES_NUM_CLOCKS,4,2          ## @SERDES_NUM_CLOCKS
	.comm	_AM654_SERDES_CTRL_CLKSEL_MASK,8,3 ## @AM654_SERDES_CTRL_CLKSEL_MASK
	.comm	_AM654_SERDES_CTRL_CLKSEL_SHIFT,8,3 ## @AM654_SERDES_CTRL_CLKSEL_SHIFT
	.comm	_serdes_am654_mux_table,8,3     ## @serdes_am654_mux_table
	.comm	_SERDES_NUM_MUX_COMBINATIONS,8,3 ## @SERDES_NUM_MUX_COMBINATIONS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to find the parent of %s clock\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_serdes_am654_clk_mux_set_parent
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function serdes_am654_clk_mux_set_parent
_serdes_am654_clk_mux_set_parent:       ; @serdes_am654_clk_mux_set_parent
	.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
	sub	sp, sp, #16
	mov	x24, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	bl	_to_serdes_am654_clk_mux
	mov	x22, x0
	ldr	x19, [x0, #8]
	mov	x0, x20
	bl	_clk_hw_get_name
	mov	x21, x0
	ldp	w20, w27, [x22]
                                        ; kill: def $w27 killed $w27 def $x27
	sxtw	x27, w27
Lloh3:
	adrp	x26, _SERDES_NUM_CLOCKS@GOTPAGE
Lloh4:
	ldr	x26, [x26, _SERDES_NUM_CLOCKS@GOTPAGEOFF]
	ldr	w8, [x26]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x23, x9, x8
	mov	sp, x23
	sub	x2, x29, #96
	mov	x0, x19
	mov	x1, x20
	bl	_regmap_read
Lloh7:
	adrp	x8, _AM654_SERDES_CTRL_CLKSEL_MASK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AM654_SERDES_CTRL_CLKSEL_MASK@GOTPAGEOFF]
Lloh9:
	adrp	x9, _AM654_SERDES_CTRL_CLKSEL_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AM654_SERDES_CTRL_CLKSEL_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	x22, [x8]
Lloh12:
	ldr	x25, [x9]
	ldr	w26, [x26]
Lloh13:
	adrp	x28, _serdes_am654_mux_table@GOTPAGE
Lloh14:
	ldr	x28, [x28, _serdes_am654_mux_table@GOTPAGEOFF]
	cmp	w26, #1
	b.lt	LBB0_2
; %bb.1:
	ldur	x8, [x29, #-96]
	and	x8, x8, x22
	lsr	x8, x8, x25
	ldr	x9, [x28]
	ldr	x1, [x9, x8, lsl #3]
	lsl	x2, x26, #2
	mov	x0, x23
	bl	_memcpy
LBB0_2:
	str	w24, [x23, x27, lsl #2]
Lloh15:
	adrp	x8, _SERDES_NUM_MUX_COMBINATIONS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SERDES_NUM_MUX_COMBINATIONS@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x8]
	cbz	x9, LBB0_9
; %bb.3:
	mov	x8, #0
	ldr	x10, [x28]
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	cmp	w26, #1
	b.lt	LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x11, [x10, x8, lsl #3]
	mov	x12, x26
	mov	x13, x23
LBB0_6:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w14, [x13]
	ldr	w15, [x11]
	cmp	w14, w15
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	add	x11, x11, #4
	add	x13, x13, #4
	subs	x12, x12, #1
	b.ne	LBB0_6
	b	LBB0_11
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, #1
	cmp	x8, x9
	b.ne	LBB0_4
LBB0_9:
	stur	x9, [x29, #-96]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x21
	bl	_WARN
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_10:
	mov	x8, #0
LBB0_11:
	lsl	x3, x8, x25
	stur	x3, [x29, #-96]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_regmap_update_bits
LBB0_12:
	ldur	x8, [x29, #-88]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	sub	sp, x29, #80
	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
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh11
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_SERDES_NUM_CLOCKS,4,2          ; @SERDES_NUM_CLOCKS
	.comm	_AM654_SERDES_CTRL_CLKSEL_MASK,8,3 ; @AM654_SERDES_CTRL_CLKSEL_MASK
	.comm	_AM654_SERDES_CTRL_CLKSEL_SHIFT,8,3 ; @AM654_SERDES_CTRL_CLKSEL_SHIFT
	.comm	_serdes_am654_mux_table,8,3     ; @serdes_am654_mux_table
	.comm	_SERDES_NUM_MUX_COMBINATIONS,8,3 ; @SERDES_NUM_MUX_COMBINATIONS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to find the parent of %s clock\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_serdes_am654_clk_mux_set_parent
.subsections_via_symbols
