	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2800_config_ps
_rt2800_config_ps:                      ## @rt2800_config_ps
	.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, %r15
	movq	%rdi, %r14
	movq	(%rsi), %rax
	movq	_IEEE80211_CONF_PS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_STATE_SLEEP@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	movl	%ebx, %r12d
	andl	(%rax), %ecx
	jne	LBB0_2
## %bb.1:
	movq	_STATE_AWAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_2:
	movq	_AUTOWAKEUP_CFG@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r14, %rdi
	cmpl	%ebx, %r12d
	jne	LBB0_4
## %bb.3:
	xorl	%edx, %edx
	callq	_rt2800_register_write
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_rt2800_register_read
	movq	%rax, -48(%rbp)
	movq	_AUTOWAKEUP_CFG_AUTO_LEAD_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %r12
	movq	%r12, %rdi
	movl	$5, %edx
	callq	_rt2x00_set_field32
	movq	_AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r15), %rax
	movl	4(%rax), %edx
	decl	%edx
	movq	%r12, %rdi
	callq	_rt2x00_set_field32
	movq	_AUTOWAKEUP_CFG_AUTOWAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field32
	movl	(%r13), %esi
	movq	-48(%rbp), %rdx
	movq	%r14, %rdi
	callq	_rt2800_register_write
	jmp	LBB0_5
LBB0_4:
	callq	_rt2800_register_read
	movq	%rax, -48(%rbp)
	movq	_AUTOWAKEUP_CFG_AUTO_LEAD_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field32
	movq	_AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field32
	movq	_AUTOWAKEUP_CFG_AUTOWAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field32
	movl	(%r13), %esi
	movq	-48(%rbp), %rdx
	movq	%r14, %rdi
	callq	_rt2800_register_write
	movl	%r12d, %ebx
LBB0_5:
	movq	(%r14), %rax
	movq	(%rax), %rax
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	*(%rax)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IEEE80211_CONF_PS,4,2          ## @IEEE80211_CONF_PS
	.comm	_STATE_SLEEP,4,2                ## @STATE_SLEEP
	.comm	_STATE_AWAKE,4,2                ## @STATE_AWAKE
	.comm	_AUTOWAKEUP_CFG,4,2             ## @AUTOWAKEUP_CFG
	.comm	_AUTOWAKEUP_CFG_AUTO_LEAD_TIME,4,2 ## @AUTOWAKEUP_CFG_AUTO_LEAD_TIME
	.comm	_AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE,4,2 ## @AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE
	.comm	_AUTOWAKEUP_CFG_AUTOWAKE,4,2    ## @AUTOWAKEUP_CFG_AUTOWAKE
	.no_dead_strip	_rt2800_config_ps
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2800_config_ps
_rt2800_config_ps:                      ; @rt2800_config_ps
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x1
	mov	x19, x0
	ldr	x8, [x1]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _IEEE80211_CONF_PS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IEEE80211_CONF_PS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _STATE_SLEEP@GOTPAGE
Lloh4:
	ldr	x10, [x10, _STATE_SLEEP@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x10]
Lloh6:
	adrp	x10, _STATE_AWAKE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _STATE_AWAKE@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	tst	w9, w8
	csel	w23, w10, w20, eq
Lloh9:
	adrp	x22, _AUTOWAKEUP_CFG@GOTPAGE
Lloh10:
	ldr	x22, [x22, _AUTOWAKEUP_CFG@GOTPAGEOFF]
	ldr	w1, [x22]
	cmp	w23, w20
	b.ne	LBB0_2
; %bb.1:
	mov	x2, #0
	bl	_rt2800_register_write
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rt2800_register_read
	str	x0, [sp, #8]
Lloh11:
	adrp	x8, _AUTOWAKEUP_CFG_AUTO_LEAD_TIME@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AUTOWAKEUP_CFG_AUTO_LEAD_TIME@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #5
	bl	_rt2x00_set_field32
Lloh14:
	adrp	x8, _AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	ldr	x8, [x21]
	ldr	w8, [x8, #4]
	sub	w2, w8, #1
	add	x0, sp, #8
	bl	_rt2x00_set_field32
Lloh17:
	adrp	x8, _AUTOWAKEUP_CFG_AUTOWAKE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AUTOWAKEUP_CFG_AUTOWAKE@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #1
	bl	_rt2x00_set_field32
	ldr	w1, [x22]
	ldr	x2, [sp, #8]
	mov	x0, x19
	bl	_rt2800_register_write
	b	LBB0_3
LBB0_2:
	bl	_rt2800_register_read
	str	x0, [sp, #8]
Lloh20:
	adrp	x8, _AUTOWAKEUP_CFG_AUTO_LEAD_TIME@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AUTOWAKEUP_CFG_AUTO_LEAD_TIME@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #0
	bl	_rt2x00_set_field32
Lloh23:
	adrp	x8, _AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #0
	bl	_rt2x00_set_field32
Lloh26:
	adrp	x8, _AUTOWAKEUP_CFG_AUTOWAKE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AUTOWAKEUP_CFG_AUTOWAKE@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #0
	bl	_rt2x00_set_field32
	ldr	w1, [x22]
	ldr	x2, [sp, #8]
	mov	x0, x19
	bl	_rt2800_register_write
	mov	x20, x23
LBB0_3:
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x8, [x8]
	mov	x0, x19
	mov	x1, x20
	blr	x8
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_IEEE80211_CONF_PS,4,2          ; @IEEE80211_CONF_PS
	.comm	_STATE_SLEEP,4,2                ; @STATE_SLEEP
	.comm	_STATE_AWAKE,4,2                ; @STATE_AWAKE
	.comm	_AUTOWAKEUP_CFG,4,2             ; @AUTOWAKEUP_CFG
	.comm	_AUTOWAKEUP_CFG_AUTO_LEAD_TIME,4,2 ; @AUTOWAKEUP_CFG_AUTO_LEAD_TIME
	.comm	_AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE,4,2 ; @AUTOWAKEUP_CFG_TBCN_BEFORE_WAKE
	.comm	_AUTOWAKEUP_CFG_AUTOWAKE,4,2    ; @AUTOWAKEUP_CFG_AUTOWAKE
	.no_dead_strip	_rt2800_config_ps
.subsections_via_symbols
