	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipw2100_wx_set_powermode
_ipw2100_wx_set_powermode:              ## @ipw2100_wx_set_powermode
	.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	%rcx, %rbx
	callq	_libipw_priv
	movq	%rax, %r15
	movl	(%rbx), %r12d
	leaq	4(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_STATUS_INITIALIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_1
## %bb.2:
	movq	_POWER_MODES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	movq	_IPW_POWER_AUTO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r12d, %ebx
	cmovgl	%eax, %ebx
	testl	%r12d, %r12d
	cmovsl	%eax, %ebx
	movl	8(%r15), %edi
	callq	_IPW_POWER_LEVEL
	xorl	%r12d, %r12d
	cmpl	%ebx, %eax
	je	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ipw2100_set_power_mode
	movl	%eax, %r12d
	jmp	LBB0_4
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_4:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STATUS_INITIALIZED,4,2         ## @STATUS_INITIALIZED
	.comm	_EIO,4,2                        ## @EIO
	.comm	_POWER_MODES,4,2                ## @POWER_MODES
	.comm	_IPW_POWER_AUTO,4,2             ## @IPW_POWER_AUTO
	.no_dead_strip	_ipw2100_wx_set_powermode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipw2100_wx_set_powermode
_ipw2100_wx_set_powermode:              ; @ipw2100_wx_set_powermode
	.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	x19, x3
	bl	_libipw_priv
	mov	x20, x0
	ldr	w21, [x19]
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _STATUS_INITIALIZED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _STATUS_INITIALIZED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _POWER_MODES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _POWER_MODES@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w21, w8
	ccmp	w21, #0, #8, le
Lloh6:
	adrp	x8, _IPW_POWER_AUTO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IPW_POWER_AUTO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	csel	w21, w8, w21, lt
	ldr	w0, [x20, #8]
	bl	_IPW_POWER_LEVEL
	cmp	w0, w21
	b.ne	LBB0_4
; %bb.2:
	mov	w20, #0
	b	LBB0_5
LBB0_3:
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_4:
	mov	x0, x20
	mov	x1, x21
	bl	_ipw2100_set_power_mode
	mov	x20, x0
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_STATUS_INITIALIZED,4,2         ; @STATUS_INITIALIZED
	.comm	_EIO,4,2                        ; @EIO
	.comm	_POWER_MODES,4,2                ; @POWER_MODES
	.comm	_IPW_POWER_AUTO,4,2             ; @IPW_POWER_AUTO
	.no_dead_strip	_ipw2100_wx_set_powermode
.subsections_via_symbols
