	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath9k_beacon_choose_slot
_ath9k_beacon_choose_slot:              ## @ath9k_beacon_choose_slot
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	callq	_ath9k_hw_common
	movq	%rax, %r14
	movq	(%rbx), %rdi
	movq	(%rdi), %rax
	movq	_NL80211_IFTYPE_AP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.1:
	movq	_NL80211_IFTYPE_MESH_POINT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.2:
	movq	_BEACON@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	callq	_ath9k_hw_gettsf64
	leaq	L_.str(%rip), %rdx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	jmp	LBB0_6
LBB0_3:
	movq	8(%rbx), %rax
	movq	(%rax), %r12
	testq	%r12, %r12
	jne	LBB0_5
## %bb.4:
	movq	_ATH_DEFAULT_BINTVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_5:
	callq	_ath9k_hw_gettsf64
	movl	%eax, %r15d
	movq	(%rbx), %rax
	movl	8(%rax), %edi
	callq	_TU_TO_USEC
	addl	%eax, %r15d
	movq	_ATH_BCBUF@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	imull	%r15d, %esi
	callq	_TSF_TO_TU
	movl	%eax, %ecx
	movl	(%rbx), %edi
	movl	%edi, %esi
	imull	%r12d, %esi
	cltd
	idivl	%esi
	movl	%edx, %eax
	cltd
	idivl	%r12d
	movl	%eax, %ebx
	movq	_BEACON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ecx, %eax
	cltd
	idivl	%edi
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	movl	%ebx, %ecx
	movl	%r15d, %r8d
	movl	%eax, %r9d
	xorl	%eax, %eax
	callq	_ath_dbg
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_IFTYPE_AP,8,3          ## @NL80211_IFTYPE_AP
	.comm	_NL80211_IFTYPE_MESH_POINT,8,3  ## @NL80211_IFTYPE_MESH_POINT
	.comm	_BEACON,4,2                     ## @BEACON
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"slot 0, tsf: %llu\n"

	.comm	_ATH_DEFAULT_BINTVAL,4,2        ## @ATH_DEFAULT_BINTVAL
	.comm	_ATH_BCBUF,4,2                  ## @ATH_BCBUF
L_.str.1:                               ## @.str.1
	.asciz	"slot: %d tsf: %llu tsftu: %u\n"

	.no_dead_strip	_ath9k_beacon_choose_slot
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath9k_beacon_choose_slot
_ath9k_beacon_choose_slot:              ; @ath9k_beacon_choose_slot
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x0
	ldr	x0, [x0]
	bl	_ath9k_hw_common
	mov	x19, x0
	ldr	x0, [x20]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _NL80211_IFTYPE_AP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NL80211_IFTYPE_AP@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _NL80211_IFTYPE_MESH_POINT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _NL80211_IFTYPE_MESH_POINT@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
Lloh6:
	adrp	x9, _ATH_DEFAULT_BINTVAL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ATH_DEFAULT_BINTVAL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w22, w9, w8, eq
	bl	_ath9k_hw_gettsf64
	mov	x21, x0
	ldr	x8, [x20]
	ldr	w0, [x8, #8]
	bl	_TU_TO_USEC
	add	w21, w21, w0
Lloh9:
	adrp	x20, _ATH_BCBUF@GOTPAGE
Lloh10:
	ldr	x20, [x20, _ATH_BCBUF@GOTPAGEOFF]
	ldr	w8, [x20]
	mul	w1, w21, w8
	bl	_TSF_TO_TU
	ldr	w8, [x20]
	mul	w9, w8, w22
	sdiv	w10, w0, w9
	msub	w9, w10, w9, w0
	sdiv	w20, w9, w22
Lloh11:
	adrp	x9, _BEACON@GOTPAGE
Lloh12:
	ldr	x9, [x9, _BEACON@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x9]
	sdiv	w8, w0, w8
	stp	x21, x8, [sp]
Lloh14:
	adrp	x2, l_.str.1@PAGE
Lloh15:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	bl	_ath_dbg
	b	LBB0_3
LBB0_2:
Lloh16:
	adrp	x8, _BEACON@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BEACON@GOTPAGEOFF]
Lloh18:
	ldr	w20, [x8]
	bl	_ath9k_hw_gettsf64
	mov	x3, x0
Lloh19:
	adrp	x2, l_.str@PAGE
Lloh20:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	bl	_ath_dbg
	mov	w20, #0
LBB0_3:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_NL80211_IFTYPE_AP,8,3          ; @NL80211_IFTYPE_AP
	.comm	_NL80211_IFTYPE_MESH_POINT,8,3  ; @NL80211_IFTYPE_MESH_POINT
	.comm	_BEACON,4,2                     ; @BEACON
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"slot 0, tsf: %llu\n"

	.comm	_ATH_DEFAULT_BINTVAL,4,2        ; @ATH_DEFAULT_BINTVAL
	.comm	_ATH_BCBUF,4,2                  ; @ATH_BCBUF
l_.str.1:                               ; @.str.1
	.asciz	"slot: %d tsf: %llu tsftu: %u\n"

	.no_dead_strip	_ath9k_beacon_choose_slot
.subsections_via_symbols
