	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function carl9170_get_max_edge_power
_carl9170_get_max_edge_power:           ## @carl9170_get_max_edge_power
	.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	_AR5416_MAX_RATE_POWER@GOTPCREL(%rip), %rax
	cmpl	$2999, %esi                     ## imm = 0xBB7
	jg	LBB0_2
## %bb.1:
	addl	$-2300, %esi                    ## imm = 0xF704
	jmp	LBB0_3
LBB0_2:
	addl	$-4800, %esi                    ## imm = 0xED40
	movslq	%esi, %rcx
	imulq	$1717986919, %rcx, %rsi         ## imm = 0x66666667
	movq	%rsi, %rcx
	shrq	$63, %rcx
	sarq	$33, %rsi
	addl	%ecx, %esi
LBB0_3:
	movl	(%rax), %eax
	movq	_AR5416_NUM_BAND_EDGES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	xorl	%edi, %edi
	testl	%r8d, %r8d
	jg	LBB0_4
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	incq	%rdi
	cmpq	%rdi, %r8
	je	LBB0_14
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdx,%rdi,8), %ecx
	cmpl	$255, %ecx
	je	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%ecx, %esi
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%ecx, %esi
	jge	LBB0_13
## %bb.9:
	leal	-1(%rdi), %ecx
	cmpl	(%rdx,%rcx,8), %esi
	jle	LBB0_12
## %bb.10:
	movl	4(%rdx,%rcx,8), %r9d
	movq	_AR9170_CALCTL_EDGE_FLAGS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%r9d, %ecx
	je	LBB0_12
## %bb.11:
	notl	%ecx
	andl	%ecx, %r9d
	movl	%r9d, %eax
	jmp	LBB0_12
LBB0_6:
	movq	_AR9170_CALCTL_EDGE_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	4(%rdx,%rdi,8), %eax
LBB0_12:
	cmpl	%r8d, %edi
	jne	LBB0_17
LBB0_14:
	movslq	%r8d, %rcx
	cmpl	-8(%rdx,%rcx,8), %esi
	jle	LBB0_17
## %bb.15:
	decq	%rcx
	movl	4(%rdx,%rcx,8), %ecx
	movq	_AR9170_CALCTL_EDGE_FLAGS@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%ecx, %edx
	je	LBB0_17
## %bb.16:
	notl	%edx
	andl	%edx, %ecx
	movl	%ecx, %eax
LBB0_17:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR5416_MAX_RATE_POWER,4,2      ## @AR5416_MAX_RATE_POWER
	.comm	_AR5416_NUM_BAND_EDGES,4,2      ## @AR5416_NUM_BAND_EDGES
	.comm	_AR9170_CALCTL_EDGE_FLAGS,4,2   ## @AR9170_CALCTL_EDGE_FLAGS
	.no_dead_strip	_carl9170_get_max_edge_power
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function carl9170_get_max_edge_power
_carl9170_get_max_edge_power:           ; @carl9170_get_max_edge_power
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _AR5416_MAX_RATE_POWER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR5416_MAX_RATE_POWER@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	w8, #-4800
	add	w8, w1, w8
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #33
	add	w8, w8, w9
	sub	w9, w1, #2300
	cmp	w1, #2999
	csel	w8, w8, w9, gt
Lloh3:
	adrp	x9, _AR5416_NUM_BAND_EDGES@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AR5416_NUM_BAND_EDGES@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w9, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x11, #0
	add	x12, x2, #4
	neg	x10, x9
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	sub	x11, x11, #1
	add	x12, x12, #8
	cmp	x10, x11
	b.eq	LBB0_13
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w13, [x12, #-4]
	cmp	w13, #255
	b.eq	LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w8, w13
	b.eq	LBB0_16
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	x11, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w8, w13
	b.ge	LBB0_2
; %bb.7:
	neg	x10, x11
	mvn	w11, w11
	lsl	x12, x11, #3
	ldr	w12, [x2, x12]
	cmp	w8, w12
	b.le	LBB0_12
; %bb.8:
	add	x11, x2, x11, lsl #3
	ldr	w11, [x11, #4]
Lloh6:
	adrp	x12, _AR9170_CALCTL_EDGE_FLAGS@GOTPAGE
Lloh7:
	ldr	x12, [x12, _AR9170_CALCTL_EDGE_FLAGS@GOTPAGEOFF]
Lloh8:
	ldr	w12, [x12]
	tst	w12, w11
	b.ne	LBB0_17
	b	LBB0_12
LBB0_9:
	mov	w10, #0
	cmp	w10, w9
	b.eq	LBB0_13
LBB0_10:
	ret
LBB0_11:
	neg	w10, w11
LBB0_12:
	cmp	w10, w9
	b.ne	LBB0_10
LBB0_13:
	sxtw	x9, w9
	sub	x9, x9, #1
	lsl	x10, x9, #3
	ldr	w10, [x2, x10]
	cmp	w8, w10
	b.le	LBB0_10
; %bb.14:
	add	x8, x2, x9, lsl #3
	ldr	w8, [x8, #4]
Lloh9:
	adrp	x9, _AR9170_CALCTL_EDGE_FLAGS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AR9170_CALCTL_EDGE_FLAGS@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.15:
	bic	w0, w8, w9
	ret
LBB0_16:
	neg	w10, w11
	ldr	w11, [x12]
Lloh12:
	adrp	x12, _AR9170_CALCTL_EDGE_FLAGS@GOTPAGE
Lloh13:
	ldr	x12, [x12, _AR9170_CALCTL_EDGE_FLAGS@GOTPAGEOFF]
Lloh14:
	ldr	w12, [x12]
LBB0_17:
	bic	w0, w11, w12
	cmp	w10, w9
	b.eq	LBB0_13
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_AR5416_MAX_RATE_POWER,4,2      ; @AR5416_MAX_RATE_POWER
	.comm	_AR5416_NUM_BAND_EDGES,4,2      ; @AR5416_NUM_BAND_EDGES
	.comm	_AR9170_CALCTL_EDGE_FLAGS,4,2   ; @AR9170_CALCTL_EDGE_FLAGS
	.no_dead_strip	_carl9170_get_max_edge_power
.subsections_via_symbols
