	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iwl_power_set_mode             ## -- Begin function iwl_power_set_mode
	.p2align	4, 0x90
_iwl_power_set_mode:                    ## @iwl_power_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	%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
	movl	%edx, %r12d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	addq	$20, %rdi
	callq	_lockdep_assert_held
	movq	8(%rbx), %rax
	movq	_IWL_CHAIN_NOISE_DONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	-41(%rbp)                       ## 1-byte Folded Spill
	movq	_IWL_CHAIN_NOISE_ALIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%r13b
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	$4, %edx
	callq	_memcmp
	xorl	%r14d, %r14d
	orl	%r12d, %eax
	je	LBB0_16
## %bb.1:
	movq	%rbx, %rdi
	callq	_iwl_is_ready_rf
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	leaq	4(%rbx), %rdi
	movq	%r15, %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	_STATUS_SCANNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%rbx), %rsi
	callq	_test_bit
	testl	%r12d, %r12d
	jne	LBB0_6
## %bb.4:
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_IWL_DEBUG_INFO
	jmp	LBB0_16
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_16
LBB0_6:
	movq	_IWL_POWER_DRIVER_ALLOW_SLEEP_MSK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_iwl_dvm_set_pmi
LBB0_8:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_iwl_set_power
	testl	%eax, %eax
	je	LBB0_9
## %bb.15:
	movl	%eax, %r12d
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_IWL_ERR
	movl	%r12d, %r14d
	jmp	LBB0_16
LBB0_9:
	movb	-41(%rbp), %r12b                ## 1-byte Reload
	orb	%r13b, %r12b
	movq	_IWL_POWER_DRIVER_ALLOW_SLEEP_MSK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_10
## %bb.11:
	testb	%r12b, %r12b
	je	LBB0_13
LBB0_12:
	movq	%rbx, %rdi
	callq	_iwl_update_chain_flags
	jmp	LBB0_14
LBB0_10:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_iwl_dvm_set_pmi
	testb	%r12b, %r12b
	jne	LBB0_12
LBB0_13:
	movq	8(%rbx), %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_IWL_DEBUG_POWER
LBB0_14:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	$4, %edx
	callq	_memcpy
LBB0_16:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IWL_CHAIN_NOISE_DONE,8,3       ## @IWL_CHAIN_NOISE_DONE
	.comm	_IWL_CHAIN_NOISE_ALIVE,8,3      ## @IWL_CHAIN_NOISE_ALIVE
	.comm	_EIO,4,2                        ## @EIO
	.comm	_STATUS_SCANNING,4,2            ## @STATUS_SCANNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Defer power set mode while scanning\n"

	.comm	_IWL_POWER_DRIVER_ALLOW_SLEEP_MSK,4,2 ## @IWL_POWER_DRIVER_ALLOW_SLEEP_MSK
L_.str.1:                               ## @.str.1
	.asciz	"Cannot update the power, chain noise calibration running: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"set power fail, ret = %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iwl_power_set_mode             ; -- Begin function iwl_power_set_mode
	.p2align	2
_iwl_power_set_mode:                    ; @iwl_power_set_mode
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	add	x0, x0, #20
	bl	_lockdep_assert_held
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, _IWL_CHAIN_NOISE_DONE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IWL_CHAIN_NOISE_DONE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
Lloh3:
	adrp	x9, _IWL_CHAIN_NOISE_ALIVE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IWL_CHAIN_NOISE_ALIVE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ccmp	x8, x9, #4, ne
	cset	w22, eq
	mov	x0, x19
	mov	x1, x20
	mov	w2, #4
	bl	_memcmp
	orr	w8, w0, w21
	cbz	w8, LBB0_16
; %bb.1:
	mov	x0, x19
	bl	_iwl_is_ready_rf
	cbz	w0, LBB0_5
; %bb.2:
	add	x0, x19, #4
	mov	x1, x20
	mov	w2, #4
	bl	_memcpy
Lloh6:
	adrp	x8, _STATUS_SCANNING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _STATUS_SCANNING@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	add	x1, x19, #16
	bl	_test_bit
	cbnz	w21, LBB0_6
; %bb.3:
	cbz	x0, LBB0_6
; %bb.4:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_IWL_DEBUG_INFO
	b	LBB0_16
LBB0_5:
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_17
LBB0_6:
	ldr	w8, [x20]
Lloh14:
	adrp	x23, _IWL_POWER_DRIVER_ALLOW_SLEEP_MSK@GOTPAGE
Lloh15:
	ldr	x23, [x23, _IWL_POWER_DRIVER_ALLOW_SLEEP_MSK@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x19
	mov	w1, #1
	bl	_iwl_dvm_set_pmi
LBB0_8:
	mov	x0, x19
	mov	x1, x20
	bl	_iwl_set_power
	cbz	w0, LBB0_10
; %bb.9:
	mov	x21, x0
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_IWL_ERR
	b	LBB0_17
LBB0_10:
	ldr	w8, [x20]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.11:
	cbz	w22, LBB0_14
LBB0_12:
	mov	x0, x19
	bl	_iwl_update_chain_flags
	b	LBB0_15
LBB0_13:
	mov	x0, x19
	mov	w1, #0
	bl	_iwl_dvm_set_pmi
	cbnz	w22, LBB0_12
LBB0_14:
	ldr	x2, [x19, #8]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_IWL_DEBUG_POWER
LBB0_15:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #4
	bl	_memcpy
LBB0_16:
	mov	w21, #0
LBB0_17:
	mov	x0, x21
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_IWL_CHAIN_NOISE_DONE,8,3       ; @IWL_CHAIN_NOISE_DONE
	.comm	_IWL_CHAIN_NOISE_ALIVE,8,3      ; @IWL_CHAIN_NOISE_ALIVE
	.comm	_EIO,4,2                        ; @EIO
	.comm	_STATUS_SCANNING,4,2            ; @STATUS_SCANNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Defer power set mode while scanning\n"

	.comm	_IWL_POWER_DRIVER_ALLOW_SLEEP_MSK,4,2 ; @IWL_POWER_DRIVER_ALLOW_SLEEP_MSK
l_.str.1:                               ; @.str.1
	.asciz	"Cannot update the power, chain noise calibration running: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"set power fail, ret = %d\n"

.subsections_via_symbols
