	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_pconf_set_driving
_mtk_pconf_set_driving:                 ## @mtk_pconf_set_driving
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	cmpl	%esi, (%rax)
	jbe	LBB0_6
## %bb.1:
	movl	%edx, %r12d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_mtk_find_pin_drv_grp_by_pin
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	(%rbx), %rcx
	cmpq	8(%rcx), %rax
	jg	LBB0_6
## %bb.3:
	movq	16(%rcx), %rdx
	leaq	(%rax,%rax,2), %r13
	cmpb	%r12b, (%rdx,%r13,4)
	ja	LBB0_6
## %bb.4:
	cmpb	%r12b, 1(%rdx,%r13,4)
	jb	LBB0_6
## %bb.5:
	movzbl	%r12b, %eax
	divb	2(%rdx,%r13,4)
	movzbl	%ah, %ecx
	testb	%cl, %cl
	je	LBB0_7
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movzbl	%al, %r12d
	decl	%r12d
	movl	4(%rdx,%r13,4), %edi
	subl	8(%rdx,%r13,4), %edi
	incl	%edi
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	callq	_BIT
                                        ## kill: def $eax killed $eax def $rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	8(%rcx,%r13,4), %ecx
	addl	8(%r15), %ecx
	leal	-1(%rax), %r13d
	shll	%cl, %r13d
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_mtk_get_regmap
	movl	12(%r15), %esi
	movl	%eax, %edi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_regmap_update_bits             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_mtk_pconf_set_driving
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_pconf_set_driving
_mtk_pconf_set_driving:                 ; @mtk_pconf_set_driving
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x0]
	ldr	w8, [x8]
	cmp	w8, w1
	b.ls	LBB0_6
; %bb.1:
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	bl	_mtk_find_pin_drv_grp_by_pin
	cbz	x0, LBB0_6
; %bb.2:
	mov	x21, x0
	ldr	x8, [x0]
	ldr	x9, [x20]
	ldr	x10, [x9, #8]
	cmp	x8, x10
	b.gt	LBB0_6
; %bb.3:
	ldr	x9, [x9, #16]
	mov	w10, #12
	mul	x10, x8, x10
	ldrb	w10, [x9, x10]
	cmp	w10, w22
	b.hi	LBB0_6
; %bb.4:
	mov	w10, #12
	madd	x10, x8, x10, x9
	ldrb	w10, [x10, #1]
	cmp	w10, w22
	b.lo	LBB0_6
; %bb.5:
	mov	w10, #12
	madd	x10, x8, x10, x9
	ldrb	w11, [x10, #2]
	and	w10, w11, #0xff
	udiv	w10, w22, w10
	msub	w11, w10, w11, w22
	tst	w11, #0xff
	b.eq	LBB0_7
LBB0_6:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_7:
	sub	w23, w10, #1
	mov	w10, #12
	madd	x22, x8, x10, x9
	ldp	w8, w9, [x22, #4]
	sub	w8, w8, w9
	add	w0, w8, #1
	bl	_BIT
	sub	w8, w0, #1
	ldr	w9, [x21, #8]
	ldr	w10, [x22, #8]
	add	w9, w10, w9
	lsl	w22, w8, w9
	lsl	w23, w23, w9
	mov	x0, x20
	mov	x1, x19
	bl	_mtk_get_regmap
	ldr	w1, [x21, #12]
	mov	x2, x22
	mov	x3, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_regmap_update_bits
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_mtk_pconf_set_driving
.subsections_via_symbols
