	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath5k_get_max_ctl_power
_ath5k_get_max_ctl_power:               ## @ath5k_get_max_ctl_power
	.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	%rsi, %rbx
	movq	%rdi, %r15
	callq	_ath5k_hw_regulatory
	movq	24(%r15), %r12
	movq	8(%r15), %r13
	movl	(%r15), %ecx
	leal	3(%rcx), %r14d
	testl	%ecx, %ecx
	cmovnsl	%ecx, %r14d
	movq	(%rbx), %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	12(%rbx), %esi
	movq	%rax, %rdi
	callq	_ath_regd_get_band_ctl
	movl	8(%rbx), %ecx
	cmpl	$128, %ecx
	je	LBB0_7
## %bb.1:
	cmpl	$129, %ecx
	je	LBB0_2
## %bb.3:
	cmpl	$130, %ecx
	jne	LBB0_29
## %bb.4:
	movl	4(%r15), %ecx
	movq	_AR5K_BWMODE_40MHZ@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_5
## %bb.6:
	movq	_AR5K_CTL_TURBO@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_7:
	movl	4(%r15), %ecx
	movq	_AR5K_BWMODE_40MHZ@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_8
## %bb.9:
	movq	_AR5K_CTL_TURBOG@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_2:
	movq	_AR5K_CTL_11B@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_5:
	movq	_AR5K_CTL_11A@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_8:
	movq	_AR5K_CTL_11G@GOTPCREL(%rip), %rcx
LBB0_10:
	movq	16(%r15), %rdx
	testq	%rdx, %rdx
	je	LBB0_29
## %bb.11:
	sarl	$2, %r14d
	orq	(%rcx), %rax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rax, (%r13,%rcx,8)
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	incq	%rcx
	cmpq	%rcx, %rdx
	jne	LBB0_12
	jmp	LBB0_29
LBB0_14:
	cmpq	$255, %rcx
	je	LBB0_29
## %bb.15:
	movq	_AR5K_EEPROM_N_EDGES@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	testq	%r8, %r8
	je	LBB0_29
## %bb.16:
	imulq	%r8, %rcx
	cmpq	$1, %r8
	jne	LBB0_18
## %bb.17:
	xorl	%edi, %edi
	xorl	%edx, %edx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
LBB0_24:
	testb	$1, %r8b
	je	LBB0_27
## %bb.25:
	addq	%rcx, %rdx
	shlq	$4, %rdx
	cmpq	(%r12,%rdx), %rax
	jg	LBB0_27
## %bb.26:
	movl	8(%r12,%rdx), %edi
LBB0_27:
	testl	%edi, %edi
	je	LBB0_29
## %bb.28:
                                        ## kill: def $edi killed $edi killed $rdi
	movl	%r14d, %esi
	callq	_min
	shll	$2, %eax
	movl	%eax, (%r15)
LBB0_29:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	%r8, %rsi
	andq	$-2, %rsi
	xorl	%edi, %edi
	xorl	%edx, %edx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_19 Depth=1
	addq	$2, %rdx
	cmpq	%rdx, %rsi
	je	LBB0_24
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	addq	%rdx, %rcx
	movq	%rcx, %rbx
	shlq	$4, %rbx
	cmpq	(%r12,%rbx), %rax
	jg	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	8(%r12,%rbx), %edi
LBB0_21:                                ##   in Loop: Header=BB0_19 Depth=1
	addq	%rdx, %rcx
	incq	%rcx
	movq	%rcx, %rbx
	shlq	$4, %rbx
	cmpq	(%r12,%rbx), %rax
	jg	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	8(%r12,%rbx), %edi
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_AR5K_BWMODE_40MHZ,4,2          ## @AR5K_BWMODE_40MHZ
	.comm	_AR5K_CTL_TURBO,8,3             ## @AR5K_CTL_TURBO
	.comm	_AR5K_CTL_11A,8,3               ## @AR5K_CTL_11A
	.comm	_AR5K_CTL_TURBOG,8,3            ## @AR5K_CTL_TURBOG
	.comm	_AR5K_CTL_11G,8,3               ## @AR5K_CTL_11G
	.comm	_AR5K_CTL_11B,8,3               ## @AR5K_CTL_11B
	.comm	_AR5K_EEPROM_N_EDGES,8,3        ## @AR5K_EEPROM_N_EDGES
	.no_dead_strip	_ath5k_get_max_ctl_power
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath5k_get_max_ctl_power
_ath5k_get_max_ctl_power:               ; @ath5k_get_max_ctl_power
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_ath5k_hw_regulatory
	ldr	x21, [x19, #24]
	ldr	x23, [x19, #8]
	ldr	w8, [x19]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w24, w9, w8, lt
	ldr	x22, [x20]
	ldr	w1, [x20, #12]
	bl	_ath_regd_get_band_ctl
	ldr	w8, [x20, #8]
	cmp	w8, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #129
	b.eq	LBB0_6
; %bb.2:
	cmp	w8, #130
	b.ne	LBB0_18
; %bb.3:
	ldr	w8, [x19, #4]
Lloh0:
	adrp	x9, _AR5K_BWMODE_40MHZ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AR5K_BWMODE_40MHZ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _AR5K_CTL_11A@GOTPAGE
Lloh4:
	ldr	x10, [x10, _AR5K_CTL_11A@GOTPAGEOFF]
Lloh5:
	adrp	x11, _AR5K_CTL_TURBO@GOTPAGE
Lloh6:
	ldr	x11, [x11, _AR5K_CTL_TURBO@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
	ldr	w8, [x19, #4]
Lloh7:
	adrp	x9, _AR5K_BWMODE_40MHZ@GOTPAGE
Lloh8:
	ldr	x9, [x9, _AR5K_BWMODE_40MHZ@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x10, _AR5K_CTL_11G@GOTPAGE
Lloh11:
	ldr	x10, [x10, _AR5K_CTL_11G@GOTPAGEOFF]
Lloh12:
	adrp	x11, _AR5K_CTL_TURBOG@GOTPAGE
Lloh13:
	ldr	x11, [x11, _AR5K_CTL_TURBOG@GOTPAGEOFF]
LBB0_5:
	cmp	w8, w9
	csel	x9, x11, x10, eq
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_7
	b	LBB0_18
LBB0_6:
Lloh14:
	adrp	x9, _AR5K_CTL_11B@GOTPAGE
Lloh15:
	ldr	x9, [x9, _AR5K_CTL_11B@GOTPAGEOFF]
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_18
LBB0_7:
	mov	x10, #0
	asr	w1, w24, #2
	ldr	x9, [x9]
	orr	x9, x9, x0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x23, x10, lsl #3]
	cmp	x11, x9
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x10, x10, #1
	cmp	x8, x10
	b.ne	LBB0_8
	b	LBB0_18
LBB0_10:
	cmp	x10, #255
	b.eq	LBB0_18
; %bb.11:
Lloh16:
	adrp	x8, _AR5K_EEPROM_N_EDGES@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AR5K_EEPROM_N_EDGES@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	cbz	x8, LBB0_18
; %bb.12:
	mov	w0, #0
	mov	x9, #0
	mul	x10, x8, x10
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.eq	LBB0_16
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	add	x10, x9, x10
	lsl	x11, x10, #4
	ldr	x11, [x21, x11]
	cmp	x22, x11
	b.gt	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	add	x11, x21, x10, lsl #4
	ldr	w0, [x11, #8]
	b	LBB0_13
LBB0_16:
	cbz	w0, LBB0_18
; %bb.17:
	bl	_min
	lsl	w8, w0, #2
	str	w8, [x19]
LBB0_18:
	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
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_AR5K_BWMODE_40MHZ,4,2          ; @AR5K_BWMODE_40MHZ
	.comm	_AR5K_CTL_TURBO,8,3             ; @AR5K_CTL_TURBO
	.comm	_AR5K_CTL_11A,8,3               ; @AR5K_CTL_11A
	.comm	_AR5K_CTL_TURBOG,8,3            ; @AR5K_CTL_TURBOG
	.comm	_AR5K_CTL_11G,8,3               ; @AR5K_CTL_11G
	.comm	_AR5K_CTL_11B,8,3               ; @AR5K_CTL_11B
	.comm	_AR5K_EEPROM_N_EDGES,8,3        ; @AR5K_EEPROM_N_EDGES
	.no_dead_strip	_ath5k_get_max_ctl_power
.subsections_via_symbols
