	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtsx_usb_send_cmd              ## -- Begin function rtsx_usb_send_cmd
	.p2align	4, 0x90
_rtsx_usb_send_cmd:                     ## @rtsx_usb_send_cmd
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edx, %r14d
	movq	%rdi, %rbx
	movslq	(%rdi), %rax
	movl	%eax, %ecx
	sarl	$8, %ecx
	movslq	%ecx, %rcx
	movq	8(%rdi), %rdx
	movq	_CNT_H@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	movq	%rcx, (%rdx,%rdi,8)
	movq	8(%rbx), %rcx
	movq	_CNT_L@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	8(%rbx), %rax
	movq	_STAGE_FLAG@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rsi, (%rax,%rcx,8)
	movl	16(%rbx), %edi
	movq	_EP_BULK_OUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_usb_sndbulkpipe
	movq	8(%rbx), %rdx
	movslq	(%rbx), %rcx
	shlq	$2, %rcx
	movq	_CMD_OFFSET@GOTPCREL(%rip), %rsi
	addq	(%rsi), %rcx
	movl	%r14d, (%rsp)
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_rtsx_usb_transfer_data
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_rtsx_usb_clear_fsm_err
LBB0_2:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CNT_H,8,3                      ## @CNT_H
	.comm	_CNT_L,8,3                      ## @CNT_L
	.comm	_STAGE_FLAG,8,3                 ## @STAGE_FLAG
	.comm	_EP_BULK_OUT,4,2                ## @EP_BULK_OUT
	.comm	_CMD_OFFSET,8,3                 ## @CMD_OFFSET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtsx_usb_send_cmd              ; -- Begin function rtsx_usb_send_cmd
	.p2align	2
_rtsx_usb_send_cmd:                     ; @rtsx_usb_send_cmd
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x2
	mov	x19, x0
	ldrsw	x8, [x0]
	mov	x9, x8
	sbfx	x9, x9, #8, #24
	ldr	x10, [x0, #8]
Lloh0:
	adrp	x11, _CNT_H@GOTPAGE
Lloh1:
	ldr	x11, [x11, _CNT_H@GOTPAGEOFF]
Lloh2:
	ldr	x11, [x11]
	str	x9, [x10, x11, lsl #3]
	ldr	x9, [x0, #8]
Lloh3:
	adrp	x10, _CNT_L@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CNT_L@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	str	x8, [x9, x10, lsl #3]
	ldr	x8, [x0, #8]
Lloh6:
	adrp	x9, _STAGE_FLAG@GOTPAGE
Lloh7:
	ldr	x9, [x9, _STAGE_FLAG@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	str	x1, [x8, x9, lsl #3]
	ldr	w0, [x0, #16]
Lloh9:
	adrp	x8, _EP_BULK_OUT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EP_BULK_OUT@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_usb_sndbulkpipe
	mov	x1, x0
	ldr	x2, [x19, #8]
	ldrsw	x8, [x19]
Lloh12:
	adrp	x9, _CMD_OFFSET@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CMD_OFFSET@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x3, x9, x8, lsl #2
	mov	x0, x19
	mov	w4, #0
	mov	x5, #0
	mov	x6, x20
	bl	_rtsx_usb_transfer_data
	mov	x20, x0
	cbz	w0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_rtsx_usb_clear_fsm_err
LBB0_2:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CNT_H,8,3                      ; @CNT_H
	.comm	_CNT_L,8,3                      ; @CNT_L
	.comm	_STAGE_FLAG,8,3                 ; @STAGE_FLAG
	.comm	_EP_BULK_OUT,4,2                ; @EP_BULK_OUT
	.comm	_CMD_OFFSET,8,3                 ; @CMD_OFFSET
.subsections_via_symbols
