	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rockchip_get_mux
_rockchip_get_mux:                      ## @rockchip_get_mux
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$32, %esi
	jge	LBB0_1
## %bb.2:
	movl	%esi, %ebx
	movq	%rdi, %r14
	leal	7(%rbx), %r9d
	testl	%esi, %esi
	movl	%esi, %ecx
	cmovsl	%r9d, %ecx
	movq	16(%rdi), %r8
	movl	%ecx, %edx
	sarl	$3, %edx
	movq	8(%rdi), %rdi
	movslq	%edx, %rsi
	movl	(%rdi,%rsi,8), %edx
	movq	_IOMUX_UNROUTED@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_4
## %bb.3:
	movl	16(%r8), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_IOMUX_GPIO_ONLY@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_6
## %bb.5:
	movq	_RK_FUNC_GPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_19
LBB0_6:
	movq	_IOMUX_SOURCE_PMU@GOTPCREL(%rip), %r10
	xorl	%r11d, %r11d
	movl	(%r10), %eax
	andl	%edx, %eax
	setne	%r11b
	movq	(%r8,%r11,8), %r15
	movl	4(%rdi,%rsi,8), %r12d
	movl	%r12d, -52(%rbp)
	movq	_IOMUX_WIDTH_4BIT@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_10
## %bb.7:
	testl	%ebx, %ebx
	cmovnsl	%ebx, %r9d
	andl	$-8, %r9d
	movl	%ebx, %eax
	subl	%r9d, %eax
	cmpl	$4, %eax
	jl	LBB0_9
## %bb.8:
	addl	$4, %r12d
	movl	%r12d, -52(%rbp)
LBB0_9:
	leal	3(%rbx), %eax
	testl	%ebx, %ebx
	cmovnsl	%ebx, %eax
	andl	$1073741820, %eax               ## imm = 0x3FFFFFFC
	movl	%ebx, %ecx
	subl	%eax, %ecx
	shll	$2, %ecx
	movl	%ecx, -44(%rbp)
	movl	$15, -48(%rbp)
	jmp	LBB0_15
LBB0_10:
	andl	$-8, %ecx
	movl	%ebx, %eax
	subl	%ecx, %eax
	movq	_IOMUX_WIDTH_3BIT@GOTPCREL(%rip), %rcx
	testl	%edx, (%rcx)
	je	LBB0_14
## %bb.11:
	cmpl	$5, %eax
	jl	LBB0_13
## %bb.12:
	addl	$4, %r12d
	movl	%r12d, -52(%rbp)
LBB0_13:
	movsbl	%al, %ecx
	imull	$103, %ecx, %ecx
	movzwl	%cx, %ecx
	movswl	%cx, %edx
	shrl	$15, %ecx
	shrl	$9, %edx
	addb	%cl, %dl
	movzbl	%dl, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subb	%cl, %al
	movzbl	%al, %eax
	leal	(%rax,%rax,2), %eax
	movsbl	%al, %eax
	movl	%eax, -44(%rbp)
	movl	$7, -48(%rbp)
	jmp	LBB0_15
LBB0_14:
	addl	%eax, %eax
	movl	%eax, -44(%rbp)
	movl	$3, -48(%rbp)
LBB0_15:
	movl	(%r14), %r13d
	movl	%ebx, %edi
	callq	_BIT
	testl	%r13d, %eax
	je	LBB0_17
## %bb.16:
	leaq	-52(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	leaq	-48(%rbp), %r8
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_rockchip_get_recalced_mux
	movl	-52(%rbp), %r12d
LBB0_17:
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_regmap_read
	testl	%eax, %eax
	jne	LBB0_19
## %bb.18:
	movl	-56(%rbp), %eax
	movb	-44(%rbp), %cl
	shrl	%cl, %eax
	andl	-48(%rbp), %eax
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IOMUX_UNROUTED,4,2             ## @IOMUX_UNROUTED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pin %d is unrouted\n"

	.comm	_IOMUX_GPIO_ONLY,4,2            ## @IOMUX_GPIO_ONLY
	.comm	_RK_FUNC_GPIO,4,2               ## @RK_FUNC_GPIO
	.comm	_IOMUX_SOURCE_PMU,4,2           ## @IOMUX_SOURCE_PMU
	.comm	_IOMUX_WIDTH_4BIT,4,2           ## @IOMUX_WIDTH_4BIT
	.comm	_IOMUX_WIDTH_3BIT,4,2           ## @IOMUX_WIDTH_3BIT
	.no_dead_strip	_rockchip_get_mux
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rockchip_get_mux
_rockchip_get_mux:                      ; @rockchip_get_mux
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cmp	w1, #32
	b.ge	LBB0_3
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	add	w8, w1, #7
	cmp	w1, #0
	csel	w11, w8, w1, lt
	asr	w8, w11, #3
	ldp	x10, x9, [x0, #8]
	sbfiz	x8, x8, #3, #32
	ldr	w8, [x10, x8]
Lloh0:
	adrp	x12, _IOMUX_UNROUTED@GOTPAGE
Lloh1:
	ldr	x12, [x12, _IOMUX_UNROUTED@GOTPAGEOFF]
Lloh2:
	ldr	w12, [x12]
	tst	w12, w8
	b.eq	LBB0_5
; %bb.2:
	ldr	w0, [x9, #16]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_err
LBB0_3:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
Lloh8:
	adrp	x12, _IOMUX_GPIO_ONLY@GOTPAGE
Lloh9:
	ldr	x12, [x12, _IOMUX_GPIO_ONLY@GOTPAGEOFF]
Lloh10:
	ldr	w12, [x12]
	tst	w12, w8
	b.eq	LBB0_7
; %bb.6:
Lloh11:
	adrp	x8, _RK_FUNC_GPIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RK_FUNC_GPIO@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	b	LBB0_4
LBB0_7:
	sbfx	x11, x11, #3, #29
Lloh14:
	adrp	x12, _IOMUX_SOURCE_PMU@GOTPAGE
Lloh15:
	ldr	x12, [x12, _IOMUX_SOURCE_PMU@GOTPAGEOFF]
Lloh16:
	ldr	w12, [x12]
	tst	w12, w8
	cset	w12, ne
	ldr	x21, [x9, w12, uxtw #3]
	add	x9, x10, x11, lsl #3
	ldr	w22, [x9, #4]
	str	w22, [sp, #8]
Lloh17:
	adrp	x9, _IOMUX_WIDTH_4BIT@GOTPAGE
Lloh18:
	ldr	x9, [x9, _IOMUX_WIDTH_4BIT@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.8:
	negs	w8, w19
	and	w8, w8, #0x7
	and	w9, w19, #0x7
	csneg	w8, w9, w8, mi
	cmp	w8, #4
	b.lt	LBB0_10
; %bb.9:
	add	w22, w22, #4
	str	w22, [sp, #8]
LBB0_10:
	negs	w8, w19
	and	w8, w8, #0x3
	and	w9, w19, #0x3
	csneg	w8, w9, w8, mi
	lsl	w8, w8, #2
	str	w8, [sp]
	mov	w8, #15
	b	LBB0_16
LBB0_11:
Lloh20:
	adrp	x9, _IOMUX_WIDTH_3BIT@GOTPAGE
Lloh21:
	ldr	x9, [x9, _IOMUX_WIDTH_3BIT@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x9]
	sub	w9, w19, w11, lsl #3
	and	w8, w10, w8
	cbz	w8, LBB0_15
; %bb.12:
	cmp	w9, #5
	b.lt	LBB0_14
; %bb.13:
	add	w22, w22, #4
	str	w22, [sp, #8]
LBB0_14:
	sxtb	w8, w9
	mov	w10, #103
	mul	w8, w8, w10
	asr	w10, w8, #8
	ubfx	w8, w8, #15, #1
	add	w8, w8, w10, lsr #1
	add	w8, w8, w8, lsl #2
	sub	w8, w9, w8
	add	w8, w8, w8, lsl #1
	sxtb	w8, w8
	str	w8, [sp]
	mov	w8, #7
	b	LBB0_16
LBB0_15:
	lsl	w8, w9, #1
	str	w8, [sp]
	mov	w8, #3
LBB0_16:
	str	w8, [sp, #4]
	ldr	w23, [x20]
	mov	x0, x19
	bl	_BIT
	tst	w0, w23
	b.eq	LBB0_18
; %bb.17:
	add	x2, sp, #8
	mov	x3, sp
	add	x4, sp, #4
	mov	x0, x20
	mov	x1, x19
	bl	_rockchip_get_recalced_mux
	ldr	w22, [sp, #8]
LBB0_18:
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x22
	bl	_regmap_read
	cbnz	w0, LBB0_4
; %bb.19:
	ldr	w8, [sp, #12]
	ldr	w9, [sp]
	lsr	w8, w8, w9
	ldr	w9, [sp, #4]
	and	w0, w8, w9
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IOMUX_UNROUTED,4,2             ; @IOMUX_UNROUTED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pin %d is unrouted\n"

	.comm	_IOMUX_GPIO_ONLY,4,2            ; @IOMUX_GPIO_ONLY
	.comm	_RK_FUNC_GPIO,4,2               ; @RK_FUNC_GPIO
	.comm	_IOMUX_SOURCE_PMU,4,2           ; @IOMUX_SOURCE_PMU
	.comm	_IOMUX_WIDTH_4BIT,4,2           ; @IOMUX_WIDTH_4BIT
	.comm	_IOMUX_WIDTH_3BIT,4,2           ; @IOMUX_WIDTH_3BIT
	.no_dead_strip	_rockchip_get_mux
.subsections_via_symbols
