	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_hw_pin_field_lookup
_mtk_hw_pin_field_lookup:               ## @mtk_hw_pin_field_lookup
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.1:
	movq	%rcx, %r8
	movslq	%edx, %rcx
	shlq	$4, %rcx
	movq	8(%rax,%rcx), %r9
	testq	%r9, %r9
	je	LBB0_17
## %bb.2:
	movslq	(%rax,%rcx), %rax
	movq	(%rsi), %rcx
	testq	%rax, %rax
	jle	LBB0_7
## %bb.3:
	imulq	$56, %rax, %rax
	addq	%r9, %rax
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	addq	$56, %r9
	cmpq	%rax, %r9
	jae	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %r11
	subq	(%r9), %r11
	jl	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	8(%r9), %rcx
	jg	LBB0_6
## %bb.10:
	movl	16(%r9), %r10d
	cmpl	(%rdi), %r10d
	jge	LBB0_11
## %bb.12:
	cmpq	$0, 48(%r9)
	movl	20(%r9), %eax
	je	LBB0_14
## %bb.13:
	movl	24(%r9), %ecx
	jmp	LBB0_15
LBB0_17:
	movl	4(%rdi), %edi
	movq	(%rsi), %rcx
	movl	8(%rsi), %r8d
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_8
LBB0_7:
	movl	4(%rdi), %edi
	movl	8(%rsi), %r8d
	leaq	L_.str.1(%rip), %rsi
LBB0_8:
	callq	_dev_dbg
	movq	_ENOTSUPP@GOTPCREL(%rip), %rcx
LBB0_9:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbp
	retq
LBB0_11:
	movl	4(%rdi), %edi
	movl	8(%rsi), %r8d
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_14:
	movl	24(%r9), %ecx
	imulq	%rcx, %r11
	addq	%r11, %rax
LBB0_15:
	movl	%r10d, (%r8)
	movl	28(%r9), %esi
	movl	32(%r9), %edi
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%edi
	imull	%esi, %eax
	cltq
	addq	40(%r9), %rax
	movq	%rax, 16(%r8)
	movl	%edx, 4(%r8)
	movl	$-1, %eax
	shll	%cl, %eax
	notl	%eax
	movl	%eax, 8(%r8)
	addl	%edx, %ecx
	xorl	%eax, %eax
	cmpl	%edi, %ecx
	cmovlel	%eax, %esi
	movl	%esi, 12(%r8)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Not support field %d for pin %d (%s)\n"

	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
L_.str.1:                               ## @.str.1
	.asciz	"Not support field %d for pin = %d (%s)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Invalid base for field %d for pin = %d (%s)\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_hw_pin_field_lookup
_mtk_hw_pin_field_lookup:               ; @mtk_hw_pin_field_lookup
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
                                        ; kill: def $w2 killed $w2 def $x2
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.1:
	add	x9, x8, w2, sxtw #4
	ldr	x9, [x9, #8]
	cbz	x9, LBB0_10
; %bb.2:
	sxtw	x10, w2
	lsl	x10, x10, #4
	ldrsw	x10, [x8, x10]
	ldr	x8, [x1]
	cmp	w10, #1
	b.lt	LBB0_11
; %bb.3:
	mov	w11, #56
	madd	x10, x10, x11, x9
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x9, x9, #56
	cmp	x9, x10
	b.hs	LBB0_11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9]
	subs	x12, x8, x11
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x11, [x9, #8]
	cmp	x8, x11
	b.gt	LBB0_4
; %bb.7:
	ldr	w10, [x9, #16]
	ldr	w11, [x0]
	cmp	w10, w11
	b.ge	LBB0_14
; %bb.8:
	ldr	x11, [x9, #48]
	ldr	w8, [x9, #20]
	cbz	x11, LBB0_15
; %bb.9:
	ldr	w11, [x9, #24]
	b	LBB0_16
LBB0_10:
	ldr	w0, [x0, #4]
	ldr	x3, [x1]
	ldr	w4, [x1, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
                                        ; kill: def $w2 killed $w2 killed $x2
	b	LBB0_12
LBB0_11:
	ldr	w0, [x0, #4]
	ldr	w4, [x1, #8]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	x3, x8
LBB0_12:
	bl	_dev_dbg
Lloh4:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_14:
	ldr	w0, [x0, #4]
	ldr	w4, [x1, #8]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	x3, x8
	bl	_dev_err
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_13
LBB0_15:
	ldr	w11, [x9, #24]
	madd	x8, x12, x11, x8
LBB0_16:
	mov	w0, #0
	ldr	x12, [x9, #40]
	ldp	w13, w9, [x9, #28]
	sdiv	w14, w8, w9
	mul	w15, w14, w13
	add	x12, x12, w15, sxtw
	str	x12, [x3, #16]
	msub	w8, w14, w9, w8
	stp	w10, w8, [x3]
	mov	w10, #-1
	lsl	w10, w10, w11
	mvn	w10, w10
	add	w8, w11, w8
	cmp	w8, w9
	csel	w8, w13, wzr, gt
	stp	w10, w8, [x3, #8]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Not support field %d for pin %d (%s)\n"

	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
l_.str.1:                               ; @.str.1
	.asciz	"Not support field %d for pin = %d (%s)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Invalid base for field %d for pin = %d (%s)\n"

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