	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rk3399_calc_drv_reg_and_bit
_rk3399_calc_drv_reg_and_bit:           ## @rk3399_calc_drv_reg_and_bit
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
                                        ## kill: def $esi killed $esi def $rsi
	movq	16(%rdi), %r9
	xorl	%eax, %eax
	cmpl	$2, (%rdi)
	setb	%al
	movq	(%r9,%rax,8), %rax
	movq	%rax, (%rdx)
	movq	8(%rdi), %r9
	leal	7(%rsi), %edx
	testl	%esi, %esi
	cmovnsl	%esi, %edx
	movl	%edx, %edi
	sarl	$3, %edi
	movslq	%edi, %rdi
	shlq	$4, %rdi
	movl	(%r9,%rdi), %eax
	movl	%eax, (%rcx)
	movq	8(%r9,%rdi), %rax
	movq	_DRV_TYPE_IO_1V8_3V0_AUTO@GOTPCREL(%rip), %rcx
	movq	_DRV_TYPE_IO_3V3_ONLY@GOTPCREL(%rip), %rdi
	andl	$-8, %edx
	subl	%edx, %esi
	leal	(%rsi,%rsi), %edx
	cmpq	(%rdi), %rax
	leal	(%rsi,%rsi,2), %esi
	cmovel	%esi, %edx
	cmpq	(%rcx), %rax
	cmovel	%esi, %edx
	movl	%edx, (%r8)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRV_TYPE_IO_1V8_3V0_AUTO,8,3   ## @DRV_TYPE_IO_1V8_3V0_AUTO
	.comm	_DRV_TYPE_IO_3V3_ONLY,8,3       ## @DRV_TYPE_IO_3V3_ONLY
	.no_dead_strip	_rk3399_calc_drv_reg_and_bit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rk3399_calc_drv_reg_and_bit
_rk3399_calc_drv_reg_and_bit:           ; @rk3399_calc_drv_reg_and_bit
	.cfi_startproc
; %bb.0:
	ldr	x8, [x0, #16]
	add	w9, w1, #7
	cmp	w1, #0
	csel	w9, w9, w1, lt
	asr	w10, w9, #3
	ldr	w11, [x0]
	cmp	w11, #2
	cset	w11, lo
	ldr	x8, [x8, w11, uxtw #3]
	str	x8, [x2]
	ldr	x8, [x0, #8]
	add	x8, x8, w10, sxtw #4
	ldr	w10, [x8]
	str	w10, [x3]
	ldr	x8, [x8, #8]
Lloh0:
	adrp	x10, _DRV_TYPE_IO_1V8_3V0_AUTO@GOTPAGE
Lloh1:
	ldr	x10, [x10, _DRV_TYPE_IO_1V8_3V0_AUTO@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
Lloh3:
	adrp	x11, _DRV_TYPE_IO_3V3_ONLY@GOTPAGE
Lloh4:
	ldr	x11, [x11, _DRV_TYPE_IO_3V3_ONLY@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
	and	w9, w9, #0xfffffff8
	cmp	x8, x11
	ccmp	x8, x10, #4, ne
	sub	w8, w1, w9
	lsl	w9, w8, #1
	add	w8, w9, w8
	csel	w8, w8, w9, eq
	str	w8, [x4]
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DRV_TYPE_IO_1V8_3V0_AUTO,8,3   ; @DRV_TYPE_IO_1V8_3V0_AUTO
	.comm	_DRV_TYPE_IO_3V3_ONLY,8,3       ; @DRV_TYPE_IO_3V3_ONLY
	.no_dead_strip	_rk3399_calc_drv_reg_and_bit
.subsections_via_symbols
