	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl1251_ps_set_mode             ## -- Begin function wl1251_ps_set_mode
	.p2align	4, 0x90
_wl1251_ps_set_mode:                    ## @wl1251_ps_set_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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_DEBUG_PSM@GOTPCREL(%rip), %rax
	cmpl	$129, %esi
	je	LBB0_7
## %bb.1:
	cmpl	$128, %r14d
	jne	LBB0_9
## %bb.2:
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_wl1251_debug
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_wl1251_acx_beacon_filter_opt
	testl	%eax, %eax
	js	LBB0_16
## %bb.3:
	movq	_WAKE_UP_EVENT_DTIM_BITMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%rbx), %edx
	movq	%rbx, %rdi
	callq	_wl1251_acx_wake_up_conditions
	testl	%eax, %eax
	js	LBB0_16
## %bb.4:
	movq	_WL1251_ACX_BET_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_WL1251_DEFAULT_BET_CONSECUTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_wl1251_acx_bet_enable
	testl	%eax, %eax
	js	LBB0_16
## %bb.5:
	movq	_CHIP_POWER_SAVE_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_wl1251_cmd_ps_mode
	testl	%eax, %eax
	js	LBB0_16
## %bb.6:
	movq	_WL1251_PSM_ELP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_wl1251_acx_sleep_auth
	testl	%eax, %eax
	jns	LBB0_15
	jmp	LBB0_16
LBB0_7:
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_wl1251_debug
	movq	_WL1251_PSM_ELP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_wl1251_acx_sleep_auth
	testl	%eax, %eax
	js	LBB0_16
## %bb.8:
	movq	_CMD_DISCONNECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_wl1251_cmd_template_set
	testl	%eax, %eax
	js	LBB0_16
LBB0_15:
	movl	%r14d, (%rbx)
	jmp	LBB0_16
LBB0_9:
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_wl1251_debug
	movq	_WL1251_PSM_CAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_wl1251_acx_sleep_auth
	testl	%eax, %eax
	js	LBB0_16
## %bb.10:
	movq	_WL1251_ACX_BET_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_WL1251_DEFAULT_BET_CONSECUTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_wl1251_acx_bet_enable
	testl	%eax, %eax
	js	LBB0_16
## %bb.11:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_wl1251_acx_beacon_filter_opt
	testl	%eax, %eax
	js	LBB0_16
## %bb.12:
	movq	_WAKE_UP_EVENT_DTIM_BITMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%rbx), %edx
	movq	%rbx, %rdi
	callq	_wl1251_acx_wake_up_conditions
	testl	%eax, %eax
	js	LBB0_16
## %bb.13:
	movq	_CHIP_ACTIVE_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_wl1251_cmd_ps_mode
	testl	%eax, %eax
	jns	LBB0_15
LBB0_16:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DEBUG_PSM,4,2                  ## @DEBUG_PSM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"entering psm"

	.comm	_WAKE_UP_EVENT_DTIM_BITMAP,4,2  ## @WAKE_UP_EVENT_DTIM_BITMAP
	.comm	_WL1251_ACX_BET_ENABLE,4,2      ## @WL1251_ACX_BET_ENABLE
	.comm	_WL1251_DEFAULT_BET_CONSECUTIVE,4,2 ## @WL1251_DEFAULT_BET_CONSECUTIVE
	.comm	_CHIP_POWER_SAVE_MODE,4,2       ## @CHIP_POWER_SAVE_MODE
	.comm	_WL1251_PSM_ELP,4,2             ## @WL1251_PSM_ELP
L_.str.1:                               ## @.str.1
	.asciz	"entering idle"

	.comm	_CMD_DISCONNECT,4,2             ## @CMD_DISCONNECT
L_.str.2:                               ## @.str.2
	.asciz	"leaving psm"

	.comm	_WL1251_PSM_CAM,4,2             ## @WL1251_PSM_CAM
	.comm	_WL1251_ACX_BET_DISABLE,4,2     ## @WL1251_ACX_BET_DISABLE
	.comm	_CHIP_ACTIVE_MODE,4,2           ## @CHIP_ACTIVE_MODE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl1251_ps_set_mode             ; -- Begin function wl1251_ps_set_mode
	.p2align	2
_wl1251_ps_set_mode:                    ; @wl1251_ps_set_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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _DEBUG_PSM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEBUG_PSM@GOTPAGEOFF]
	cmp	w1, #129
	b.eq	LBB0_7
; %bb.1:
	cmp	w19, #128
	b.ne	LBB0_10
; %bb.2:
	ldr	w0, [x8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wl1251_debug
	mov	x0, x20
	mov	w1, #1
	bl	_wl1251_acx_beacon_filter_opt
	tbnz	w0, #31, LBB0_15
; %bb.3:
Lloh4:
	adrp	x8, _WAKE_UP_EVENT_DTIM_BITMAP@GOTPAGE
Lloh5:
	ldr	x8, [x8, _WAKE_UP_EVENT_DTIM_BITMAP@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	w2, [x20, #4]
	mov	x0, x20
	bl	_wl1251_acx_wake_up_conditions
	tbnz	w0, #31, LBB0_15
; %bb.4:
Lloh7:
	adrp	x8, _WL1251_ACX_BET_ENABLE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _WL1251_ACX_BET_ENABLE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x8, _WL1251_DEFAULT_BET_CONSECUTIVE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WL1251_DEFAULT_BET_CONSECUTIVE@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_wl1251_acx_bet_enable
	tbnz	w0, #31, LBB0_15
; %bb.5:
Lloh13:
	adrp	x8, _CHIP_POWER_SAVE_MODE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CHIP_POWER_SAVE_MODE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wl1251_cmd_ps_mode
	tbnz	w0, #31, LBB0_15
; %bb.6:
Lloh16:
	adrp	x8, _WL1251_PSM_ELP@GOTPAGE
Lloh17:
	ldr	x8, [x8, _WL1251_PSM_ELP@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wl1251_acx_sleep_auth
	tbz	w0, #31, LBB0_9
	b	LBB0_15
LBB0_7:
	ldr	w0, [x8]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wl1251_debug
Lloh21:
	adrp	x8, _WL1251_PSM_ELP@GOTPAGE
Lloh22:
	ldr	x8, [x8, _WL1251_PSM_ELP@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wl1251_acx_sleep_auth
	tbnz	w0, #31, LBB0_15
; %bb.8:
Lloh24:
	adrp	x8, _CMD_DISCONNECT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CMD_DISCONNECT@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, #0
	mov	w3, #0
	bl	_wl1251_cmd_template_set
	tbnz	w0, #31, LBB0_15
LBB0_9:
	str	w19, [x20]
	b	LBB0_15
LBB0_10:
	ldr	w0, [x8]
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_wl1251_debug
Lloh29:
	adrp	x8, _WL1251_PSM_CAM@GOTPAGE
Lloh30:
	ldr	x8, [x8, _WL1251_PSM_CAM@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wl1251_acx_sleep_auth
	tbnz	w0, #31, LBB0_15
; %bb.11:
Lloh32:
	adrp	x8, _WL1251_ACX_BET_DISABLE@GOTPAGE
Lloh33:
	ldr	x8, [x8, _WL1251_ACX_BET_DISABLE@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
Lloh35:
	adrp	x8, _WL1251_DEFAULT_BET_CONSECUTIVE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _WL1251_DEFAULT_BET_CONSECUTIVE@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_wl1251_acx_bet_enable
	tbnz	w0, #31, LBB0_15
; %bb.12:
	mov	x0, x20
	mov	w1, #0
	bl	_wl1251_acx_beacon_filter_opt
	tbnz	w0, #31, LBB0_15
; %bb.13:
Lloh38:
	adrp	x8, _WAKE_UP_EVENT_DTIM_BITMAP@GOTPAGE
Lloh39:
	ldr	x8, [x8, _WAKE_UP_EVENT_DTIM_BITMAP@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	ldr	w2, [x20, #4]
	mov	x0, x20
	bl	_wl1251_acx_wake_up_conditions
	tbnz	w0, #31, LBB0_15
; %bb.14:
Lloh41:
	adrp	x8, _CHIP_ACTIVE_MODE@GOTPAGE
Lloh42:
	ldr	x8, [x8, _CHIP_ACTIVE_MODE@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wl1251_cmd_ps_mode
	tbz	w0, #31, LBB0_9
LBB0_15:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_DEBUG_PSM,4,2                  ; @DEBUG_PSM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"entering psm"

	.comm	_WAKE_UP_EVENT_DTIM_BITMAP,4,2  ; @WAKE_UP_EVENT_DTIM_BITMAP
	.comm	_WL1251_ACX_BET_ENABLE,4,2      ; @WL1251_ACX_BET_ENABLE
	.comm	_WL1251_DEFAULT_BET_CONSECUTIVE,4,2 ; @WL1251_DEFAULT_BET_CONSECUTIVE
	.comm	_CHIP_POWER_SAVE_MODE,4,2       ; @CHIP_POWER_SAVE_MODE
	.comm	_WL1251_PSM_ELP,4,2             ; @WL1251_PSM_ELP
l_.str.1:                               ; @.str.1
	.asciz	"entering idle"

	.comm	_CMD_DISCONNECT,4,2             ; @CMD_DISCONNECT
l_.str.2:                               ; @.str.2
	.asciz	"leaving psm"

	.comm	_WL1251_PSM_CAM,4,2             ; @WL1251_PSM_CAM
	.comm	_WL1251_ACX_BET_DISABLE,4,2     ; @WL1251_ACX_BET_DISABLE
	.comm	_CHIP_ACTIVE_MODE,4,2           ; @CHIP_ACTIVE_MODE
.subsections_via_symbols
