	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opera1_xilinx_rw
_opera1_xilinx_rw:                      ## @opera1_xilinx_rw
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %ebx
	movl	%r8d, %r12d
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	movl	%esi, -72(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movq	%rsp, -96(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	%r8d, %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	movq	_OPERA_READ_MSG@GOTPCREL(%rip), %r14
	movl	%ebx, -56(%rbp)                 ## 4-byte Spill
	cmpl	%ebx, (%r14)
	jne	LBB0_2
## %bb.1:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	jmp	LBB0_3
LBB0_2:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
LBB0_3:
	movl	%eax, %r15d
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, (%r14)
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	jne	LBB0_4
## %bb.5:
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %r14d
	movq	_OPERA_WRITE_MSG@GOTPCREL(%rip), %rax
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, (%rax)
	jne	LBB0_8
## %bb.7:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_memcpy
LBB0_8:
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	subq	$8, %rsp
	movl	$0, -52(%rbp)                   ## 4-byte Folded Spill
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	-72(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	movl	%r14d, %ecx
	movl	-68(%rbp), %r8d                 ## 4-byte Reload
	xorl	%r9d, %r9d
	pushq	$2000                           ## imm = 0x7D0
	movq	%r12, %r14
	pushq	%r12
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %r12d
	movq	_OPERA_TUNER_REQ@GOTPCREL(%rip), %r15
	cmpl	%ebx, (%r15)
	jne	LBB0_11
## %bb.9:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	movl	(%r15), %edx
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rsi
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rsi), %ecx
	subq	$8, %rsp
	leaq	-76(%rbp), %rbx
	movq	%r13, %rdi
	movl	%eax, %esi
	movl	$1, %r8d
	xorl	%r9d, %r9d
	pushq	$2000                           ## imm = 0x7D0
	pushq	$1
	pushq	%rbx
	callq	_usb_control_msg
	addq	$32, %rsp
	testl	%eax, %eax
	jle	LBB0_14
## %bb.10:
	cmpl	$8, -76(%rbp)
	jne	LBB0_14
LBB0_11:
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	movq	_OPERA_READ_MSG@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	jne	LBB0_13
## %bb.12:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r14d, %edx
	callq	_memcpy
LBB0_13:
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
LBB0_14:
	movq	-96(%rbp), %rsp                 ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.15:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_OPERA_READ_MSG,4,2             ## @OPERA_READ_MSG
	.comm	_USB_DIR_IN,4,2                 ## @USB_DIR_IN
	.comm	_USB_DIR_OUT,4,2                ## @USB_DIR_OUT
	.comm	_OPERA_WRITE_MSG,4,2            ## @OPERA_WRITE_MSG
	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.comm	_OPERA_TUNER_REQ,4,2            ## @OPERA_TUNER_REQ
	.no_dead_strip	_opera1_xilinx_rw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opera1_xilinx_rw
_opera1_xilinx_rw:                      ; @opera1_xilinx_rw
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #32
	mov	x21, x5
	mov	x19, x4
	mov	x27, x3
	mov	x25, x2
	mov	x24, x1
	mov	x23, x0
	mov	x8, sp
	stur	x8, [x29, #-104]                ; 8-byte Folded Spill
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	mov	w8, w4
	lsl	x8, x8, #2
	mov	x9, x8
Lloh3:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh4:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x22, x9, x8
	mov	sp, x22
Lloh5:
	adrp	x20, _OPERA_READ_MSG@GOTPAGE
Lloh6:
	ldr	x20, [x20, _OPERA_READ_MSG@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, w5
	b.ne	LBB0_2
; %bb.1:
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	b	LBB0_3
LBB0_2:
	mov	w1, #0
	bl	_usb_sndctrlpipe
LBB0_3:
	mov	x26, x0
	ldr	w8, [x20]
Lloh7:
	adrp	x20, _USB_DIR_IN@GOTPAGE
Lloh8:
	ldr	x20, [x20, _USB_DIR_IN@GOTPAGEOFF]
Lloh9:
	adrp	x9, _USB_DIR_OUT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _USB_DIR_OUT@GOTPAGEOFF]
	cmp	w8, w21
	csel	x8, x20, x9, eq
	ldr	w28, [x8]
Lloh11:
	adrp	x8, _OPERA_WRITE_MSG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _OPERA_WRITE_MSG@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x22
	mov	x1, x27
	mov	x2, x19
	bl	_memcpy
LBB0_5:
	stur	x27, [x29, #-112]               ; 8-byte Folded Spill
Lloh14:
	adrp	x27, _USB_TYPE_VENDOR@GOTPAGE
Lloh15:
	ldr	x27, [x27, _USB_TYPE_VENDOR@GOTPAGEOFF]
	ldr	w8, [x27]
	orr	w3, w8, w28
	mov	w28, #2000
	str	w28, [sp, #-16]!
	mov	x0, x23
	mov	x1, x26
	mov	x2, x24
	mov	x4, x25
	mov	w5, #0
	mov	x6, x22
	mov	x7, x19
	bl	_usb_control_msg
	add	sp, sp, #16
	mov	x25, x0
Lloh16:
	adrp	x26, _OPERA_TUNER_REQ@GOTPAGE
Lloh17:
	ldr	x26, [x26, _OPERA_TUNER_REQ@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, w24
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x23
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
	ldr	w2, [x26]
	ldr	w8, [x20]
	ldr	w9, [x27]
	orr	w3, w9, w8
	str	w28, [sp, #-16]!
	sub	x6, x29, #92
	mov	x0, x23
	mov	w4, #1
	mov	w5, #0
	mov	w7, #1
	bl	_usb_control_msg
	add	sp, sp, #16
	mov	x8, x0
	mov	w0, #0
	ldur	w9, [x29, #-92]
	cmp	w8, #1
	ccmp	w9, #8, #0, ge
	b.ne	LBB0_10
LBB0_7:
Lloh18:
	adrp	x8, _OPERA_READ_MSG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _OPERA_READ_MSG@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_9
; %bb.8:
	ldur	x0, [x29, #-112]                ; 8-byte Folded Reload
	mov	x1, x22
	mov	x2, x19
	bl	_memcpy
LBB0_9:
	mov	x0, x25
LBB0_10:
	ldur	x8, [x29, #-104]                ; 8-byte Folded Reload
	mov	sp, x8
	ldur	x8, [x29, #-88]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	sub	sp, x29, #80
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_OPERA_READ_MSG,4,2             ; @OPERA_READ_MSG
	.comm	_USB_DIR_IN,4,2                 ; @USB_DIR_IN
	.comm	_USB_DIR_OUT,4,2                ; @USB_DIR_OUT
	.comm	_OPERA_WRITE_MSG,4,2            ; @OPERA_WRITE_MSG
	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.comm	_OPERA_TUNER_REQ,4,2            ; @OPERA_TUNER_REQ
	.no_dead_strip	_opera1_xilinx_rw
.subsections_via_symbols
