	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2800usb_init_registers
_rt2800usb_init_registers:              ## @rt2800usb_init_registers
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_rt2800_wait_csr_ready
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_3
LBB0_2:
	movq	_PBF_SYS_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_rt2x00usb_register_read
	movl	(%rbx), %esi
	andl	$-8193, %eax                    ## imm = 0xDFFF
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_rt2x00usb_register_write
	movl	$0, -28(%rbp)
	movq	_MAC_SYS_CTRL_RESET_CSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field32
	movq	_MAC_SYS_CTRL_RESET_BBP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field32
	movq	_MAC_SYS_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	-28(%rbp), %edx
	movq	%r14, %rdi
	callq	_rt2x00usb_register_write
	movq	_USB_DEVICE_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_USB_MODE_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_REGISTER_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_rt2x00usb_vendor_request_sw
	movl	(%r15), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_rt2x00usb_register_write
LBB0_3:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_PBF_SYS_CTRL,4,2               ## @PBF_SYS_CTRL
	.comm	_MAC_SYS_CTRL_RESET_CSR,4,2     ## @MAC_SYS_CTRL_RESET_CSR
	.comm	_MAC_SYS_CTRL_RESET_BBP,4,2     ## @MAC_SYS_CTRL_RESET_BBP
	.comm	_MAC_SYS_CTRL,4,2               ## @MAC_SYS_CTRL
	.comm	_USB_DEVICE_MODE,4,2            ## @USB_DEVICE_MODE
	.comm	_USB_MODE_RESET,4,2             ## @USB_MODE_RESET
	.comm	_REGISTER_TIMEOUT,4,2           ## @REGISTER_TIMEOUT
	.no_dead_strip	_rt2800usb_init_registers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2800usb_init_registers
_rt2800usb_init_registers:              ; @rt2800usb_init_registers
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	bl	_rt2800_wait_csr_ready
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
Lloh3:
	adrp	x20, _PBF_SYS_CTRL@GOTPAGE
Lloh4:
	ldr	x20, [x20, _PBF_SYS_CTRL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_rt2x00usb_register_read
	ldr	w1, [x20]
	and	w2, w0, #0xffffdfff
	mov	x0, x19
	bl	_rt2x00usb_register_write
	str	wzr, [sp, #12]
Lloh5:
	adrp	x8, _MAC_SYS_CTRL_RESET_CSR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MAC_SYS_CTRL_RESET_CSR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	w2, #1
	bl	_rt2x00_set_field32
Lloh8:
	adrp	x8, _MAC_SYS_CTRL_RESET_BBP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MAC_SYS_CTRL_RESET_BBP@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	w2, #1
	bl	_rt2x00_set_field32
Lloh11:
	adrp	x20, _MAC_SYS_CTRL@GOTPAGE
Lloh12:
	ldr	x20, [x20, _MAC_SYS_CTRL@GOTPAGEOFF]
	ldr	w1, [x20]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_rt2x00usb_register_write
Lloh13:
	adrp	x8, _USB_DEVICE_MODE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _USB_DEVICE_MODE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _USB_MODE_RESET@GOTPAGE
Lloh17:
	ldr	x8, [x8, _USB_MODE_RESET@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
Lloh19:
	adrp	x8, _REGISTER_TIMEOUT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _REGISTER_TIMEOUT@GOTPAGEOFF]
Lloh21:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_rt2x00usb_vendor_request_sw
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_rt2x00usb_register_write
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_PBF_SYS_CTRL,4,2               ; @PBF_SYS_CTRL
	.comm	_MAC_SYS_CTRL_RESET_CSR,4,2     ; @MAC_SYS_CTRL_RESET_CSR
	.comm	_MAC_SYS_CTRL_RESET_BBP,4,2     ; @MAC_SYS_CTRL_RESET_BBP
	.comm	_MAC_SYS_CTRL,4,2               ; @MAC_SYS_CTRL
	.comm	_USB_DEVICE_MODE,4,2            ; @USB_DEVICE_MODE
	.comm	_USB_MODE_RESET,4,2             ; @USB_MODE_RESET
	.comm	_REGISTER_TIMEOUT,4,2           ; @REGISTER_TIMEOUT
	.no_dead_strip	_rt2800usb_init_registers
.subsections_via_symbols
