	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl2831u_power_ctrl
_rtl2831u_power_ctrl:                   ## @rtl2831u_power_ctrl
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_SYS_SYS0@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-60(%rbp), %rdx
	movq	%r15, %rdi
	callq	_rtl28xxu_rd_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.1:
	movq	_SYS_GPIO_OUT_VAL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	-64(%rbp), %rdx
	movq	%r15, %rdi
	callq	_rtl28xxu_rd_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.2:
	movq	(%r15), %rdi
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %ecx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	-64(%rbp), %ecx
	andl	$-22, %ecx
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.3:
	orl	$5, %ecx
	movl	%ecx, -64(%rbp)
	movl	-60(%rbp), %edx
	andl	$15, %edx
	orl	$224, %edx
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_4:
	orl	$16, %ecx
	movl	%ecx, -64(%rbp)
	movl	$-193, %edx
	andl	-60(%rbp), %edx
	movl	$2, %eax
	movl	$16, %ebx
LBB0_5:
	movl	%edx, -60(%rbp)
	movl	%ebx, -56(%rbp)
	movl	%eax, -52(%rbp)
	movq	(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	(%r12), %esi
	movl	-60(%rbp), %edx
	movq	%r15, %rdi
	callq	_rtl28xxu_wr_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.6:
	movl	(%r13), %esi
	movl	-64(%rbp), %edx
	movq	%r15, %rdi
	callq	_rtl28xxu_wr_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:
	movq	_USB_EPA_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	movl	$2, %ecx
	callq	_rtl28xxu_wr_regs
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_8
LBB0_10:
	movq	(%r15), %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%ebx, %ebx
	testl	%r14d, %r14d
	je	LBB0_11
## %bb.9:
	movl	8(%r15), %r14d
	movl	%r14d, %edi
	movl	$129, %esi
	callq	_usb_rcvbulkpipe
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_usb_clear_halt
	jmp	LBB0_11
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"onoff=%d\n"

	.comm	_SYS_SYS0,4,2                   ## @SYS_SYS0
	.comm	_SYS_GPIO_OUT_VAL,4,2           ## @SYS_GPIO_OUT_VAL
L_.str.1:                               ## @.str.1
	.asciz	"RD SYS0=%02x GPIO_OUT_VAL=%02x\n"

L_.str.2:                               ## @.str.2
	.asciz	"WR SYS0=%02x GPIO_OUT_VAL=%02x\n"

	.comm	_USB_EPA_CTL,4,2                ## @USB_EPA_CTL
L_.str.3:                               ## @.str.3
	.asciz	"failed=%d\n"

	.no_dead_strip	_rtl2831u_power_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function rtl2831u_power_ctrl
lCPI0_0:
	.long	16                              ; 0x10
	.long	2                               ; 0x2
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_rtl2831u_power_ctrl:                   ; @rtl2831u_power_ctrl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x1
	mov	x19, x0
	ldr	x0, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
Lloh2:
	adrp	x22, _SYS_SYS0@GOTPAGE
Lloh3:
	ldr	x22, [x22, _SYS_SYS0@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #24
	mov	x0, x19
	bl	_rtl28xxu_rd_reg
	mov	x21, x0
	cbnz	w0, LBB0_8
; %bb.1:
Lloh4:
	adrp	x23, _SYS_GPIO_OUT_VAL@GOTPAGE
Lloh5:
	ldr	x23, [x23, _SYS_GPIO_OUT_VAL@GOTPAGEOFF]
	ldr	w1, [x23]
	add	x2, sp, #28
	mov	x0, x19
	bl	_rtl28xxu_rd_reg
	mov	x21, x0
	cbnz	w0, LBB0_8
; %bb.2:
	ldr	x0, [x19]
	ldp	w2, w8, [sp, #24]
	str	x8, [sp]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	ldr	w8, [sp, #28]
	mov	w9, #-22
	and	w8, w8, w9
	cbz	w20, LBB0_4
; %bb.3:
	mov	w9, #5
	orr	w8, w8, w9
	str	w8, [sp, #28]
	ldr	w9, [sp, #24]
	mov	w2, #224
	bfxil	w2, w9, #0, #4
	movi.2d	v0, #0000000000000000
	b	LBB0_5
LBB0_4:
	orr	w8, w8, #0x10
	str	w8, [sp, #28]
	ldr	w9, [sp, #24]
Lloh8:
	adrp	x10, lCPI0_0@PAGE
Lloh9:
	ldr	d0, [x10, lCPI0_0@PAGEOFF]
	and	w2, w9, #0xffffff3f
LBB0_5:
	str	w2, [sp, #24]
	str	d0, [sp, #16]
	ldr	x0, [x19]
	str	x8, [sp]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
	ldr	w1, [x22]
	ldr	w2, [sp, #24]
	mov	x0, x19
	bl	_rtl28xxu_wr_reg
	mov	x21, x0
	cbnz	w0, LBB0_8
; %bb.6:
	ldr	w1, [x23]
	ldr	w2, [sp, #28]
	mov	x0, x19
	bl	_rtl28xxu_wr_reg
	mov	x21, x0
	cbnz	w0, LBB0_8
; %bb.7:
Lloh12:
	adrp	x8, _USB_EPA_CTL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _USB_EPA_CTL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x2, sp, #16
	mov	x0, x19
	mov	w3, #2
	bl	_rtl28xxu_wr_regs
	mov	x21, x0
	cbz	w0, LBB0_10
LBB0_8:
	ldr	x0, [x19]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_10:
	cbz	w20, LBB0_12
; %bb.11:
	ldr	w19, [x19, #8]
	mov	x0, x19
	mov	w1, #129
	bl	_usb_rcvbulkpipe
	mov	x1, x0
	mov	x0, x19
	bl	_usb_clear_halt
LBB0_12:
	mov	w21, #0
	b	LBB0_9
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdr	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"onoff=%d\n"

	.comm	_SYS_SYS0,4,2                   ; @SYS_SYS0
	.comm	_SYS_GPIO_OUT_VAL,4,2           ; @SYS_GPIO_OUT_VAL
l_.str.1:                               ; @.str.1
	.asciz	"RD SYS0=%02x GPIO_OUT_VAL=%02x\n"

l_.str.2:                               ; @.str.2
	.asciz	"WR SYS0=%02x GPIO_OUT_VAL=%02x\n"

	.comm	_USB_EPA_CTL,4,2                ; @USB_EPA_CTL
l_.str.3:                               ; @.str.3
	.asciz	"failed=%d\n"

	.no_dead_strip	_rtl2831u_power_ctrl
.subsections_via_symbols
