	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar5523_get_wlan_mode
_ar5523_get_wlan_mode:                  ## @ar5523_get_wlan_mode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rax
	movq	(%rax), %rax
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %r14
	movl	8(%rdi), %edi
	movl	(%rsi), %esi
	callq	_ieee80211_find_sta
	testq	%rax, %rax
	je	LBB0_15
## %bb.1:
	movl	(%r14), %edx
	movq	_WLAN_MODE_11b@GOTPCREL(%rip), %rcx
	testl	%edx, %edx
	jle	LBB0_21
## %bb.2:
	movq	(%rax), %rax
	movq	(%rbx), %rsi
	movq	(%rsi), %rsi
	movq	(%rsi), %rsi
	movl	(%rax,%rsi,4), %esi
	xorl	%edi, %edi
	movq	_WLAN_MODE_11g@GOTPCREL(%rip), %r8
	movabsq	$1152921505680588801, %r9       ## imm = 0x1000000040000001
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$180, %eax
	je	LBB0_20
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	sarl	%esi
	incq	%rdi
	cmpq	%rdi, %rdx
	je	LBB0_21
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	testb	$1, %sil
	je	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%r14), %rax
	movl	(%rax,%rdi,4), %eax
	cmpl	$239, %eax
	jg	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	leal	-60(%rax), %ebx
	cmpl	$60, %ebx
	ja	LBB0_3
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	btq	%rbx, %r9
	jae	LBB0_3
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$479, %eax                      ## imm = 0x1DF
	jg	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$240, %eax
	je	LBB0_20
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$360, %eax                      ## imm = 0x168
	jne	LBB0_4
	jmp	LBB0_20
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$480, %eax                      ## imm = 0x1E0
	je	LBB0_20
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$540, %eax                      ## imm = 0x21C
	jne	LBB0_4
LBB0_20:
	movq	%r8, %rcx
	jmp	LBB0_21
LBB0_15:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_ar5523_info
	movq	_WLAN_MODE_11b@GOTPCREL(%rip), %rcx
LBB0_21:
	movl	(%rcx), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"STA not found!\n"

	.comm	_WLAN_MODE_11b,4,2              ## @WLAN_MODE_11b
	.comm	_WLAN_MODE_11g,4,2              ## @WLAN_MODE_11g
	.no_dead_strip	_ar5523_get_wlan_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar5523_get_wlan_mode
_ar5523_get_wlan_mode:                  ; @ar5523_get_wlan_mode
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0]
	ldp	x8, x9, [x8]
	ldr	x9, [x9]
	ldr	x8, [x8]
	ldr	x20, [x9, x8, lsl #3]
	ldr	w0, [x0, #8]
	ldr	w1, [x1]
	bl	_ieee80211_find_sta
	cbz	x0, LBB0_13
; %bb.1:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.2:
	mov	x9, #0
	ldr	x10, [x0]
	ldr	x11, [x19]
	ldr	x11, [x11]
	ldr	x11, [x11]
	ldr	w10, [x10, x11, lsl #2]
	lsl	x11, x8, #2
Lloh0:
	adrp	x12, _WLAN_MODE_11b@GOTPAGE
Lloh1:
	ldr	x12, [x12, _WLAN_MODE_11b@GOTPAGEOFF]
Lloh2:
	adrp	x8, _WLAN_MODE_11g@GOTPAGE
Lloh3:
	ldr	x8, [x8, _WLAN_MODE_11g@GOTPAGEOFF]
	mov	w13, #1
	mov	x14, #1
	movk	x14, #16384, lsl #16
	movk	x14, #4096, lsl #48
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	asr	w10, w10, #1
	add	x9, x9, #4
	cmp	x11, x9
	b.eq	LBB0_16
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	tbz	w10, #0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x15, [x20, #8]
	ldr	w15, [x15, x9]
	cmp	w15, #239
	b.gt	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w16, w15, #60
	cmp	w16, #60
	lsl	x16, x13, x16
	and	x16, x16, x14
	ccmp	x16, #0, #4, ls
	b.ne	LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w15, #180
	b.ne	LBB0_3
	b	LBB0_15
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	w15, #479
	b.gt	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w15, #240
	b.eq	LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	w15, #360
	b.ne	LBB0_3
	b	LBB0_15
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w15, #480
	b.eq	LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	w15, #540
	b.ne	LBB0_3
	b	LBB0_15
LBB0_13:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ar5523_info
LBB0_14:
Lloh6:
	adrp	x8, _WLAN_MODE_11b@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WLAN_MODE_11b@GOTPAGEOFF]
LBB0_15:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_16:
	mov	x8, x12
	b	LBB0_15
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"STA not found!\n"

	.comm	_WLAN_MODE_11b,4,2              ; @WLAN_MODE_11b
	.comm	_WLAN_MODE_11g,4,2              ; @WLAN_MODE_11g
	.no_dead_strip	_ar5523_get_wlan_mode
.subsections_via_symbols
