	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath9k_cmn_beacon_config_sta    ## -- Begin function ath9k_cmn_beacon_config_sta
	.p2align	4, 0x90
_ath9k_cmn_beacon_config_sta:           ## @ath9k_cmn_beacon_config_sta
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r12
	callq	_ath9k_hw_common
	movq	%rax, %rbx
	movq	_ATH_OP_PRIM_STA_VIF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movl	4(%r13), %ebx
	movl	8(%r13), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, (%r13)
	movq	%r12, %rdi
	callq	_ath9k_hw_gettsf64
	movl	%eax, %r14d
	movl	(%r13), %edx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_ath9k_get_next_tbtt
	movq	%rax, 16(%r13)
	movl	(%r13), %edi
	callq	_TU_TO_USEC
	movl	%eax, (%r15)
	movl	8(%r13), %ecx
	imull	%ecx, %eax
	movl	%eax, 4(%r15)
	movq	16(%r13), %rax
	movq	%rax, 32(%r15)
	movq	%rax, 24(%r15)
	cmpl	$2, %ecx
	jl	LBB0_4
## %bb.3:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	imull	%ebx, %edx
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_ath9k_get_next_tbtt
	movq	%rax, 24(%r15)
LBB0_4:
	movl	(%r13), %esi
	movl	12(%r13), %edi
	callq	_DIV_ROUND_UP
	movl	%eax, 8(%r15)
	movl	$15, %ecx
	cmpl	$15, %eax
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jg	LBB0_7
## %bb.5:
	testl	%eax, %eax
	jg	LBB0_8
## %bb.6:
	movl	$1, %ecx
LBB0_7:
	movl	%ecx, 8(%r15)
LBB0_8:
	movl	$100, %edi
	callq	_IEEE80211_MS_TO_TU
	movl	(%r13), %esi
	movl	%eax, %edi
	callq	_roundup
	movl	%eax, %edi
	callq	_TU_TO_USEC
	movl	4(%r15), %r8d
	movl	8(%r15), %ecx
	cmpl	%eax, %r8d
	cmovgel	%eax, %r8d
	movl	%r8d, 12(%r15)
	movq	_ATH9K_TSFOOR_THRESHOLD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r15)
	movq	_BEACON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ath_dbg
	jmp	LBB0_9
LBB0_1:
	movq	_BEACON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	_EPERM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_9:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH_OP_PRIM_STA_VIF,4,2        ## @ATH_OP_PRIM_STA_VIF
	.comm	_BEACON,4,2                     ## @BEACON
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"STA is not yet associated..skipping beacon config\n"

	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_ATH9K_TSFOOR_THRESHOLD,4,2     ## @ATH9K_TSFOOR_THRESHOLD
L_.str.1:                               ## @.str.1
	.asciz	"bmiss: %u sleep: %u\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath9k_cmn_beacon_config_sta    ; -- Begin function ath9k_cmn_beacon_config_sta
	.p2align	2
_ath9k_cmn_beacon_config_sta:           ; @ath9k_cmn_beacon_config_sta
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	bl	_ath9k_hw_common
	mov	x19, x0
Lloh0:
	adrp	x8, _ATH_OP_PRIM_STA_VIF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATH_OP_PRIM_STA_VIF@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_test_bit
	cbz	w0, LBB0_5
; %bb.1:
	mov	x0, x20
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	ldp	w24, w25, [x21, #4]
	str	w24, [x21]
	mov	x0, x22
	bl	_ath9k_hw_gettsf64
	mov	x23, x0
	ldr	w2, [x21]
	mov	x0, x22
	mov	x1, x23
	bl	_ath9k_get_next_tbtt
	str	x0, [x21, #16]
	ldr	w0, [x21]
	bl	_TU_TO_USEC
	ldr	w8, [x21, #8]
	mul	w9, w8, w0
	stp	w0, w9, [x20]
	ldr	x9, [x21, #16]
	stp	x9, x9, [x20, #24]
	cmp	w8, #2
	b.lt	LBB0_3
; %bb.2:
	mul	w2, w25, w24
	mov	x0, x22
	mov	x1, x23
	bl	_ath9k_get_next_tbtt
	str	x0, [x20, #24]
LBB0_3:
	ldr	w0, [x21, #12]
	ldr	w1, [x21]
	bl	_DIV_ROUND_UP
	str	w0, [x20, #8]
	cmp	w0, #15
	b.le	LBB0_6
; %bb.4:
	mov	w8, #15
	b	LBB0_8
LBB0_5:
Lloh3:
	adrp	x8, _BEACON@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BEACON@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ath_dbg
Lloh8:
	adrp	x8, _EPERM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_6:
	cmp	w0, #0
	b.gt	LBB0_9
; %bb.7:
	mov	w8, #1
LBB0_8:
	str	w8, [x20, #8]
LBB0_9:
	mov	w0, #100
	bl	_IEEE80211_MS_TO_TU
	ldr	w1, [x21]
	bl	_roundup
	bl	_TU_TO_USEC
	ldp	w8, w9, [x20, #4]
	cmp	w8, w0
	csel	w8, w8, w0, lt
Lloh11:
	adrp	x10, _ATH9K_TSFOOR_THRESHOLD@GOTPAGE
Lloh12:
	ldr	x10, [x10, _ATH9K_TSFOOR_THRESHOLD@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	stp	w8, w10, [x20, #12]
Lloh14:
	adrp	x10, _BEACON@GOTPAGE
Lloh15:
	ldr	x10, [x10, _BEACON@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x10]
	stp	x9, x8, [sp]
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ath_dbg
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH_OP_PRIM_STA_VIF,4,2        ; @ATH_OP_PRIM_STA_VIF
	.comm	_BEACON,4,2                     ; @BEACON
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"STA is not yet associated..skipping beacon config\n"

	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_ATH9K_TSFOOR_THRESHOLD,4,2     ; @ATH9K_TSFOOR_THRESHOLD
l_.str.1:                               ; @.str.1
	.asciz	"bmiss: %u sleep: %u\n"

.subsections_via_symbols
