	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function il3945_hw_reg_get_matched_power_idx
_il3945_hw_reg_get_matched_power_idx:   ## @il3945_hw_reg_get_matched_power_idx
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	(%rdi), %rdi
	addl	%esi, %esi
	movslq	%esi, %rax
	movq	(%rdi), %rsi
	movq	(%rsi,%rdx,8), %rsi
	xorl	%edx, %edx
	cmpq	%rax, (%rsi)
	jne	LBB0_3
## %bb.1:
	xorl	%edi, %edi
	jmp	LBB0_2
LBB0_3:
	movq	16(%rsi), %r8
	movl	$1, %edi
	cmpq	%rax, %r8
	je	LBB0_2
## %bb.4:
	movq	32(%rsi), %r9
	movl	$2, %edi
	cmpq	%rax, %r9
	je	LBB0_2
## %bb.5:
	movq	48(%rsi), %r10
	movl	$3, %edi
	cmpq	%rax, %r10
	je	LBB0_2
## %bb.6:
	movl	$4, %edi
	cmpq	%rax, 64(%rsi)
	jne	LBB0_7
LBB0_2:
	shlq	$4, %rdi
	movq	8(%rsi,%rdi), %rax
	movq	%rax, (%rcx)
LBB0_18:
	movl	%edx, %eax
	popq	%rbp
	retq
LBB0_7:
	cmpq	%rax, %r8
	jae	LBB0_9
## %bb.8:
	movl	$1, %edi
	xorl	%edx, %edx
	jmp	LBB0_12
LBB0_9:
	cmpq	%rax, %r9
	jae	LBB0_11
## %bb.10:
	movl	$1, %edx
	movl	$2, %edi
	jmp	LBB0_12
LBB0_11:
	xorl	%edx, %edx
	cmpq	%rax, %r10
	setb	%dl
	movl	$4, %edi
	subq	%rdx, %rdi
	xorq	$3, %rdx
LBB0_12:
	shlq	$4, %rdi
	movq	(%rsi,%rdi), %r8
	shlq	$4, %rdx
	movq	(%rsi,%rdx), %r10
	subq	%r10, %r8
	jne	LBB0_14
## %bb.13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	subl	(%rax), %edx
	jmp	LBB0_18
LBB0_14:
	movq	8(%rsi,%rdx), %r9
	movq	8(%rsi,%rdi), %rdx
	subq	%r9, %rdx
	shlq	$19, %r9
	subq	%r10, %rax
	imulq	%rdx, %rax
	shlq	$19, %rax
	movq	%rax, %rdx
	orq	%r8, %rdx
	shrq	$32, %rdx
	je	LBB0_15
## %bb.16:
	xorl	%edx, %edx
	divq	%r8
	jmp	LBB0_17
LBB0_15:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r8d
                                        ## kill: def $eax killed $eax def $rax
LBB0_17:
	orq	$262144, %r9                    ## imm = 0x40000
	addq	%rax, %r9
	shrq	$19, %r9
	movq	%r9, (%rcx)
	xorl	%edx, %edx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_il3945_hw_reg_get_matched_power_idx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function il3945_hw_reg_get_matched_power_idx
_il3945_hw_reg_get_matched_power_idx:   ; @il3945_hw_reg_get_matched_power_idx
	.cfi_startproc
; %bb.0:
	ldr	x8, [x0]
	lsl	w9, w1, #1
	sxtw	x9, w9
	ldr	x8, [x8]
	ldr	x8, [x8, x2, lsl #3]
	ldr	x10, [x8]
	cmp	x10, x9
	b.ne	LBB0_2
; %bb.1:
	mov	x9, #0
	b	LBB0_10
LBB0_2:
	ldr	x11, [x8, #16]
	cmp	x11, x9
	b.ne	LBB0_4
; %bb.3:
	mov	w9, #1
	b	LBB0_10
LBB0_4:
	ldr	x10, [x8, #32]
	cmp	x10, x9
	b.ne	LBB0_6
; %bb.5:
	mov	w9, #2
	b	LBB0_10
LBB0_6:
	ldr	x12, [x8, #48]
	cmp	x12, x9
	b.ne	LBB0_8
; %bb.7:
	mov	w9, #3
	b	LBB0_10
LBB0_8:
	ldr	x13, [x8, #64]
	cmp	x13, x9
	b.ne	LBB0_11
; %bb.9:
	mov	w9, #4
LBB0_10:
	mov	w0, #0
	add	x8, x8, x9, lsl #4
	ldr	x8, [x8, #8]
	str	x8, [x3]
	ret
LBB0_11:
	cmp	x11, x9
	b.hs	LBB0_13
; %bb.12:
	mov	x11, #0
	mov	w10, #1
	b	LBB0_14
LBB0_13:
	mov	w11, #1
	mov	w13, #2
	cmp	x12, x9
	mov	w12, #3
	cinc	x12, x12, hs
	mov	w14, #2
	cinc	x14, x14, hs
	cmp	x10, x9
	csel	x10, x13, x12, lo
	csel	x11, x11, x14, lo
LBB0_14:
	lsl	x12, x10, #4
	ldr	x12, [x8, x12]
	lsl	x13, x11, #4
	ldr	x13, [x8, x13]
	subs	x12, x12, x13
	b.ne	LBB0_16
; %bb.15:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	ret
LBB0_16:
	mov	w0, #0
	add	x11, x8, x11, lsl #4
	ldr	x11, [x11, #8]
	add	x8, x8, x10, lsl #4
	ldr	x8, [x8, #8]
	sub	x8, x8, x11
	sub	x9, x9, x13
	mul	x8, x9, x8
	lsl	x8, x8, #19
	udiv	x8, x8, x12
	add	x8, x8, x11, lsl #19
	add	x8, x8, #64, lsl #12            ; =262144
	lsr	x8, x8, #19
	str	x8, [x3]
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_il3945_hw_reg_get_matched_power_idx
.subsections_via_symbols
