	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtw_mac_power_switch
_rtw_mac_power_switch:                  ## @rtw_mac_power_switch
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	(%rdi), %rsi
	movq	8(%rdi), %r12
	callq	_rtw_read8
	movl	%eax, %ebx
	movq	_REG_MCUFW_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rtw_read16
	cmpl	$49272, %eax                    ## imm = 0xC078
	jne	LBB0_2
## %bb.1:
	movq	_BIT_RPWM_TOGGLE@GOTPCREL(%rip), %rax
	notl	%ebx
	andl	(%rax), %ebx
	movq	(%r15), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_rtw_write8
LBB0_2:
	movq	_REG_CR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_rtw_read8
	cmpl	$234, %eax
	je	LBB0_8
## %bb.3:
	movq	%r15, %rdi
	callq	_rtw_hci_type
	movq	_RTW_HCI_TYPE_USB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	movq	_REG_SYS_STATUS1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	incq	%rsi
	movq	%r15, %rdi
	callq	_rtw_read8
	movl	%eax, %ebx
	xorl	%edi, %edi
	callq	_BIT
	testl	%ebx, %eax
	je	LBB0_5
LBB0_8:
	leaq	8(%r12), %rax
	testl	%r14d, %r14d
	cmoveq	%r12, %rax
LBB0_9:
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_rtw_pwr_seq_parser
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
LBB0_5:
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.7:
	movq	_EALREADY@GOTPCREL(%rip), %rcx
LBB0_12:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_13
LBB0_10:
	xorl	%eax, %eax
LBB0_13:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r12, %rax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_MCUFW_CTRL,4,2             ## @REG_MCUFW_CTRL
	.comm	_BIT_RPWM_TOGGLE,4,2            ## @BIT_RPWM_TOGGLE
	.comm	_REG_CR,8,3                     ## @REG_CR
	.comm	_RTW_HCI_TYPE_USB,8,3           ## @RTW_HCI_TYPE_USB
	.comm	_REG_SYS_STATUS1,8,3            ## @REG_SYS_STATUS1
	.comm	_EALREADY,4,2                   ## @EALREADY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_rtw_mac_power_switch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtw_mac_power_switch
_rtw_mac_power_switch:                  ; @rtw_mac_power_switch
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x1
	mov	x19, x0
	ldp	x1, x22, [x0]
	bl	_rtw_read8
	mov	x21, x0
Lloh0:
	adrp	x8, _REG_MCUFW_CTRL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_MCUFW_CTRL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rtw_read16
	mov	w8, #49272
	cmp	w0, w8
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _BIT_RPWM_TOGGLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BIT_RPWM_TOGGLE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	bic	w2, w8, w21
	ldr	x1, [x19]
	mov	x0, x19
	bl	_rtw_write8
LBB0_2:
Lloh6:
	adrp	x8, _REG_CR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_CR@GOTPAGEOFF]
Lloh8:
	ldr	x1, [x8]
	mov	x0, x19
	bl	_rtw_read8
	cmp	w0, #234
	b.eq	LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_rtw_hci_type
Lloh9:
	adrp	x8, _RTW_HCI_TYPE_USB@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RTW_HCI_TYPE_USB@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.4:
Lloh12:
	adrp	x8, _REG_SYS_STATUS1@GOTPAGE
Lloh13:
	ldr	x8, [x8, _REG_SYS_STATUS1@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	add	x1, x8, #1
	mov	x0, x19
	bl	_rtw_read8
	mov	x21, x0
	mov	w0, #0
	bl	_BIT
	tst	w0, w21
	b.eq	LBB0_8
LBB0_5:
	add	x8, x22, #8
	cmp	w20, #0
	csel	x22, x22, x8, eq
LBB0_6:
	ldr	x1, [x22]
	mov	x0, x19
	bl	_rtw_pwr_seq_parser
	cbz	x0, LBB0_11
; %bb.7:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
	cbz	w20, LBB0_6
; %bb.9:
Lloh17:
	adrp	x8, _EALREADY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EALREADY@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_MCUFW_CTRL,4,2             ; @REG_MCUFW_CTRL
	.comm	_BIT_RPWM_TOGGLE,4,2            ; @BIT_RPWM_TOGGLE
	.comm	_REG_CR,8,3                     ; @REG_CR
	.comm	_RTW_HCI_TYPE_USB,8,3           ; @RTW_HCI_TYPE_USB
	.comm	_REG_SYS_STATUS1,8,3            ; @REG_SYS_STATUS1
	.comm	_EALREADY,4,2                   ; @EALREADY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_rtw_mac_power_switch
.subsections_via_symbols
