	.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	$24, %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, %r15d
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movq	_OPERA_READ_MSG@GOTPCREL(%rip), %r14
	cmpl	%r9d, (%r14)
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movl	%esi, %r12d
	jne	LBB0_2
## %bb.1:
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	jmp	LBB0_3
LBB0_2:
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
LBB0_3:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cmpl	%ebx, (%r14)
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	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	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %rbx
	movq	_OPERA_WRITE_MSG@GOTPCREL(%rip), %rax
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, (%rax)
	jne	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_memcpy
LBB0_10:
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	subq	$8, %rsp
	movq	%r15, %rax
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	movl	%r14d, %ecx
	movl	-56(%rbp), %r8d                 ## 4-byte Reload
	xorl	%r9d, %r9d
	pushq	$2000                           ## imm = 0x7D0
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	pushq	%rax
	pushq	%rbx
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %edx
	movq	_OPERA_TUNER_REQ@GOTPCREL(%rip), %r14
	cmpl	%r12d, (%r14)
	jne	LBB0_14
## %bb.11:
	movl	%edx, %r12d
	movl	(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	movl	(%r14), %edx
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rsi
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rsi), %ecx
	subq	$8, %rsp
	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_17
## %bb.12:
	cmpl	$8, (%rbx)
	jne	LBB0_17
## %bb.13:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rbx)
	movl	%r12d, %edx
LBB0_14:
	movq	_OPERA_READ_MSG@GOTPCREL(%rip), %rax
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, (%rax)
	jne	LBB0_15
## %bb.16:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	%edx, %r15d
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	jmp	LBB0_17
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_18
LBB0_15:
	movl	%edx, %r15d
LBB0_17:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_18:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.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	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.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:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x21, x5
	mov	x19, x4
	mov	x20, x3
	mov	x25, x2
	mov	x24, x1
	mov	x23, x0
Lloh0:
	adrp	x22, _OPERA_READ_MSG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _OPERA_READ_MSG@GOTPAGEOFF]
	ldr	w8, [x22]
	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, [x22]
Lloh2:
	adrp	x28, _USB_DIR_IN@GOTPAGE
Lloh3:
	ldr	x28, [x28, _USB_DIR_IN@GOTPAGEOFF]
Lloh4:
	adrp	x9, _USB_DIR_OUT@GOTPAGE
Lloh5:
	ldr	x9, [x9, _USB_DIR_OUT@GOTPAGEOFF]
	cmp	w8, w21
	csel	x8, x28, x9, eq
	ldr	w27, [x8]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_kmalloc
	cbz	x0, LBB0_12
; %bb.4:
	mov	x22, x0
Lloh9:
	adrp	x8, _OPERA_WRITE_MSG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _OPERA_WRITE_MSG@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	bl	_memcpy
LBB0_6:
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
Lloh12:
	adrp	x20, _USB_TYPE_VENDOR@GOTPAGE
Lloh13:
	ldr	x20, [x20, _USB_TYPE_VENDOR@GOTPAGEOFF]
	ldr	w8, [x20]
	orr	w3, w8, w27
	mov	w27, #2000
	str	w27, [sp]
	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
	mov	x25, x0
Lloh14:
	adrp	x26, _OPERA_TUNER_REQ@GOTPAGE
Lloh15:
	ldr	x26, [x26, _OPERA_TUNER_REQ@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, w24
	b.ne	LBB0_10
; %bb.7:
	ldr	w24, [x22]
	mov	x0, x23
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
	ldr	w2, [x26]
	ldr	w8, [x28]
	ldr	w9, [x20]
	orr	w3, w9, w8
	str	w27, [sp]
	mov	x0, x23
	mov	w4, #1
	mov	w5, #0
	mov	x6, x22
	mov	w7, #1
	bl	_usb_control_msg
	cmp	w0, #1
	b.lt	LBB0_13
; %bb.8:
	ldr	w8, [x22]
	cmp	w8, #8
	b.ne	LBB0_13
; %bb.9:
	str	w24, [x22]
LBB0_10:
Lloh16:
	adrp	x8, _OPERA_READ_MSG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _OPERA_READ_MSG@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_14
; %bb.11:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x1, x22
	mov	x2, x19
	bl	_memcpy
	b	LBB0_14
LBB0_12:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_15
LBB0_13:
	mov	w25, #0
LBB0_14:
	mov	x0, x22
	bl	_kfree
LBB0_15:
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.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	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.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
