	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2400pci_set_state
_rt2400pci_set_state:                   ## @rt2400pci_set_state
	.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	%esi, %ebx
	movq	_STATE_AWAKE@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	cmpl	%esi, (%rax)
	movq	%rdi, %r12
	setne	%r14b
	movq	_PWRCSR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_rt2x00mmio_register_read
	movl	%eax, -44(%rbp)
	movq	_PWRCSR1_SET_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %r15
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field32
	movq	_PWRCSR1_BBP_DESIRE_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movsbl	%bl, %r13d
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_rt2x00_set_field32
	movq	_PWRCSR1_RF_DESIRE_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_rt2x00_set_field32
	movq	_PWRCSR1_PUT_TO_SLEEP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	movq	_PWRCSR1@GOTPCREL(%rip), %rbx
	callq	_rt2x00_set_field32
	movl	(%rbx), %esi
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	callq	_rt2x00mmio_register_write
	movq	_REGISTER_BUSY_COUNT@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_6
## %bb.1:
	xorl	%r15d, %r15d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rbx
	movl	(%r14), %esi
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	callq	_rt2x00mmio_register_write
	movl	$10, %edi
	callq	_msleep
	incl	%r15d
	movq	_REGISTER_BUSY_COUNT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jae	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %r14
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_rt2x00mmio_register_read
	movl	%eax, %ebx
	movq	_PWRCSR1_BBP_CURR_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_rt2x00_get_field32
	movl	%eax, %r13d
	movq	_PWRCSR1_RF_CURR_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_rt2x00_get_field32
	movsbl	%r13b, %ecx
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	cmpl	%edx, %ecx
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movsbl	%al, %eax
	cmpl	%edx, %eax
	jne	LBB0_5
## %bb.4:
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_6:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STATE_AWAKE,4,2                ## @STATE_AWAKE
	.comm	_PWRCSR1,4,2                    ## @PWRCSR1
	.comm	_PWRCSR1_SET_STATE,4,2          ## @PWRCSR1_SET_STATE
	.comm	_PWRCSR1_BBP_DESIRE_STATE,4,2   ## @PWRCSR1_BBP_DESIRE_STATE
	.comm	_PWRCSR1_RF_DESIRE_STATE,4,2    ## @PWRCSR1_RF_DESIRE_STATE
	.comm	_PWRCSR1_PUT_TO_SLEEP,4,2       ## @PWRCSR1_PUT_TO_SLEEP
	.comm	_REGISTER_BUSY_COUNT,4,2        ## @REGISTER_BUSY_COUNT
	.comm	_PWRCSR1_BBP_CURR_STATE,4,2     ## @PWRCSR1_BBP_CURR_STATE
	.comm	_PWRCSR1_RF_CURR_STATE,4,2      ## @PWRCSR1_RF_CURR_STATE
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_rt2400pci_set_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2400pci_set_state
_rt2400pci_set_state:                   ; @rt2400pci_set_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _STATE_AWAKE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STATE_AWAKE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	cset	w21, ne
Lloh3:
	adrp	x23, _PWRCSR1@GOTPAGE
Lloh4:
	ldr	x23, [x23, _PWRCSR1@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_rt2x00mmio_register_read
	str	w0, [sp, #12]
Lloh5:
	adrp	x8, _PWRCSR1_SET_STATE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PWRCSR1_SET_STATE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	w2, #1
	bl	_rt2x00_set_field32
Lloh8:
	adrp	x8, _PWRCSR1_BBP_DESIRE_STATE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PWRCSR1_BBP_DESIRE_STATE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	sxtb	w22, w19
	add	x0, sp, #12
	mov	x2, x22
	bl	_rt2x00_set_field32
Lloh11:
	adrp	x8, _PWRCSR1_RF_DESIRE_STATE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PWRCSR1_RF_DESIRE_STATE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x22
	bl	_rt2x00_set_field32
Lloh14:
	adrp	x8, _PWRCSR1_PUT_TO_SLEEP@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PWRCSR1_PUT_TO_SLEEP@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	x2, x21
	bl	_rt2x00_set_field32
	ldr	w1, [x23]
	ldr	w2, [sp, #12]
	mov	x0, x20
	bl	_rt2x00mmio_register_write
Lloh17:
	adrp	x24, _REGISTER_BUSY_COUNT@GOTPAGE
Lloh18:
	ldr	x24, [x24, _REGISTER_BUSY_COUNT@GOTPAGEOFF]
	ldr	w8, [x24]
	cbz	w8, LBB0_4
; %bb.1:
	mov	w25, #0
Lloh19:
	adrp	x26, _PWRCSR1_BBP_CURR_STATE@GOTPAGE
Lloh20:
	ldr	x26, [x26, _PWRCSR1_BBP_CURR_STATE@GOTPAGEOFF]
Lloh21:
	adrp	x27, _PWRCSR1_RF_CURR_STATE@GOTPAGE
Lloh22:
	ldr	x27, [x27, _PWRCSR1_RF_CURR_STATE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x20
	bl	_rt2x00mmio_register_read
	mov	x21, x0
	ldr	w1, [x26]
	bl	_rt2x00_get_field32
	mov	x22, x0
	ldr	w1, [x27]
	mov	x0, x21
	bl	_rt2x00_get_field32
	cmp	w22, w19
	ccmp	w0, w19, #0, eq
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x23]
	ldr	w2, [sp, #12]
	mov	x0, x20
	bl	_rt2x00mmio_register_write
	mov	w0, #10
	bl	_msleep
	add	w25, w25, #1
	ldr	w8, [x24]
	cmp	w25, w8
	b.lo	LBB0_2
LBB0_4:
Lloh23:
	adrp	x8, _EBUSY@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_STATE_AWAKE,4,2                ; @STATE_AWAKE
	.comm	_PWRCSR1,4,2                    ; @PWRCSR1
	.comm	_PWRCSR1_SET_STATE,4,2          ; @PWRCSR1_SET_STATE
	.comm	_PWRCSR1_BBP_DESIRE_STATE,4,2   ; @PWRCSR1_BBP_DESIRE_STATE
	.comm	_PWRCSR1_RF_DESIRE_STATE,4,2    ; @PWRCSR1_RF_DESIRE_STATE
	.comm	_PWRCSR1_PUT_TO_SLEEP,4,2       ; @PWRCSR1_PUT_TO_SLEEP
	.comm	_REGISTER_BUSY_COUNT,4,2        ; @REGISTER_BUSY_COUNT
	.comm	_PWRCSR1_BBP_CURR_STATE,4,2     ; @PWRCSR1_BBP_CURR_STATE
	.comm	_PWRCSR1_RF_CURR_STATE,4,2      ; @PWRCSR1_RF_CURR_STATE
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_rt2400pci_set_state
.subsections_via_symbols
