	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function flexcop_usb_readwrite_dw
_flexcop_usb_readwrite_dw:              ## @flexcop_usb_readwrite_dw
	.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
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	testl	%ecx, %ecx
	setne	%bl
	movq	(%rdi), %r12
	movq	_B2C2_USB_READ_REG@GOTPCREL(%rip), %rax
	cmoveq	_B2C2_USB_WRITE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rax
	cmoveq	_USB_DIR_OUT@GOTPCREL(%rip), %rax
	movq	_B2C2_USB_CTRL_PIPE_IN@GOTPCREL(%rip), %r15
	cmoveq	_B2C2_USB_CTRL_PIPE_OUT@GOTPCREL(%rip), %r15
	movl	(%rax), %r14d
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movl	%esi, %edi
	callq	_B2C2_FLEX_PCIOFFSET_TO_INTERNALADDR
	shll	$7, %ebx
	orl	%eax, %ebx
	movl	(%r12), %edi
	movl	(%r15), %esi
	movq	_B2C2_WAIT_FOR_OPERATION_RDW@GOTPCREL(%rip), %rdx
	movq	_HZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	imull	(%rdx), %eax
	subq	$8, %rsp
	xorl	%r12d, %r12d
	movl	%r13d, %edx
	movl	%r14d, %ecx
	movl	%ebx, %r8d
	xorl	%r9d, %r9d
	pushq	%rax
	pushq	$4
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	callq	_usb_control_msg
	addq	$32, %rsp
	cmpl	$4, %eax
	je	LBB0_2
## %bb.1:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %edx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	callq	_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_2:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_B2C2_USB_READ_REG,4,2          ## @B2C2_USB_READ_REG
	.comm	_B2C2_USB_WRITE_REG,4,2         ## @B2C2_USB_WRITE_REG
	.comm	_USB_DIR_IN,4,2                 ## @USB_DIR_IN
	.comm	_USB_DIR_OUT,4,2                ## @USB_DIR_OUT
	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.comm	_B2C2_USB_CTRL_PIPE_IN,4,2      ## @B2C2_USB_CTRL_PIPE_IN
	.comm	_B2C2_USB_CTRL_PIPE_OUT,4,2     ## @B2C2_USB_CTRL_PIPE_OUT
	.comm	_B2C2_WAIT_FOR_OPERATION_RDW,4,2 ## @B2C2_WAIT_FOR_OPERATION_RDW
	.comm	_HZ,4,2                         ## @HZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error while %s dword from %d (%d)."

L_.str.1:                               ## @.str.1
	.asciz	"reading"

L_.str.2:                               ## @.str.2
	.asciz	"writing"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_flexcop_usb_readwrite_dw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function flexcop_usb_readwrite_dw
_flexcop_usb_readwrite_dw:              ; @flexcop_usb_readwrite_dw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x3
	mov	x22, x2
	mov	x19, x1
	cmp	w3, #0
	cset	w21, ne
	ldr	x25, [x0]
Lloh0:
	adrp	x8, _B2C2_USB_READ_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _B2C2_USB_READ_REG@GOTPAGEOFF]
Lloh2:
	adrp	x9, _B2C2_USB_WRITE_REG@GOTPAGE
Lloh3:
	ldr	x9, [x9, _B2C2_USB_WRITE_REG@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	ldr	w23, [x8]
Lloh4:
	adrp	x8, _USB_DIR_IN@GOTPAGE
Lloh5:
	ldr	x8, [x8, _USB_DIR_IN@GOTPAGEOFF]
Lloh6:
	adrp	x9, _USB_DIR_OUT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _USB_DIR_OUT@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _USB_TYPE_VENDOR@GOTPAGE
Lloh9:
	ldr	x9, [x9, _USB_TYPE_VENDOR@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w24, w8, w9
Lloh11:
	adrp	x8, _B2C2_USB_CTRL_PIPE_IN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _B2C2_USB_CTRL_PIPE_IN@GOTPAGEOFF]
Lloh13:
	adrp	x9, _B2C2_USB_CTRL_PIPE_OUT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _B2C2_USB_CTRL_PIPE_OUT@GOTPAGEOFF]
	csel	x26, x9, x8, eq
	mov	x0, x1
	bl	_B2C2_FLEX_PCIOFFSET_TO_INTERNALADDR
	orr	w21, w0, w21, lsl #7
	ldr	w0, [x25]
Lloh15:
	adrp	x8, _B2C2_WAIT_FOR_OPERATION_RDW@GOTPAGE
Lloh16:
	ldr	x8, [x8, _B2C2_WAIT_FOR_OPERATION_RDW@GOTPAGEOFF]
	ldr	w1, [x26]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _HZ@GOTPAGE
Lloh19:
	ldr	x9, [x9, _HZ@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	mul	w8, w9, w8
	str	w8, [sp]
	mov	x2, x23
	mov	x3, x24
	mov	x4, x21
	mov	w5, #0
	mov	x6, x22
	mov	w7, #4
	bl	_usb_control_msg
	mov	x8, x0
	mov	w0, #0
	cmp	w8, #4
	b.eq	LBB0_2
; %bb.1:
Lloh21:
	adrp	x8, l_.str.1@PAGE
Lloh22:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh23:
	adrp	x9, l_.str.2@PAGE
Lloh24:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w20, #0
	csel	x1, x9, x8, eq
Lloh25:
	adrp	x0, l_.str@PAGE
Lloh26:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x19
	bl	_err
Lloh27:
	adrp	x8, _EIO@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_2:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_B2C2_USB_READ_REG,4,2          ; @B2C2_USB_READ_REG
	.comm	_B2C2_USB_WRITE_REG,4,2         ; @B2C2_USB_WRITE_REG
	.comm	_USB_DIR_IN,4,2                 ; @USB_DIR_IN
	.comm	_USB_DIR_OUT,4,2                ; @USB_DIR_OUT
	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.comm	_B2C2_USB_CTRL_PIPE_IN,4,2      ; @B2C2_USB_CTRL_PIPE_IN
	.comm	_B2C2_USB_CTRL_PIPE_OUT,4,2     ; @B2C2_USB_CTRL_PIPE_OUT
	.comm	_B2C2_WAIT_FOR_OPERATION_RDW,4,2 ; @B2C2_WAIT_FOR_OPERATION_RDW
	.comm	_HZ,4,2                         ; @HZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error while %s dword from %d (%d)."

l_.str.1:                               ; @.str.1
	.asciz	"reading"

l_.str.2:                               ; @.str.2
	.asciz	"writing"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_flexcop_usb_readwrite_dw
.subsections_via_symbols
