	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opera1_xilinx_load_firmware
_opera1_xilinx_load_firmware:           ## @opera1_xilinx_load_firmware
	.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	%rsi, %rbx
	movq	%rdi, %r15
	movq	$0, -48(%rbp)
	leaq	L_.str(%rip), %rdi
	callq	_info
	leaq	-48(%rbp), %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_request_firmware
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_err
	jmp	LBB0_12
LBB0_2:
	movq	-48(%rbp), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	movq	%rax, %r14
	movq	_OPERA_READ_MSG@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	xorl	%r12d, %r12d
	leaq	-60(%rbp), %rcx
	movq	%r15, %rdi
	movl	$188, %esi
	xorl	%edx, %edx
	movl	$1, %r8d
	callq	_opera1_xilinx_rw
	testq	%r14, %r14
	je	LBB0_11
## %bb.3:
	cmpl	$103, -60(%rbp)
	je	LBB0_11
## %bb.4:
	movl	$0, -56(%rbp)
	movl	$0, -52(%rbp)
	movq	-48(%rbp), %rax
	movl	(%rax), %edx
	movl	4(%rax), %esi
	movq	%r14, %rdi
	callq	_memcpy
	movq	_OPERA_WRITE_MSG@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	-52(%rbp), %rcx
	movq	%r15, %rdi
	movl	$188, %esi
	movl	$170, %edx
	movl	$1, %r8d
	callq	_opera1_xilinx_rw
	movq	-48(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_9
## %bb.5:
	xorl	%r13d, %r13d
	movl	$40, %ebx
	movq	_OPERA_WRITE_FX2@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %ecx
	subl	%r13d, %eax
	cmpl	%ebx, %eax
	movl	%eax, %ebx
	cmovgel	%ecx, %ebx
	movslq	%r13d, %rax
	leaq	(%r14,%rax,4), %rcx
	movl	(%r12), %esi
	movq	_OPERA_WRITE_MSG@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r15, %rdi
	xorl	%edx, %edx
	movl	%ebx, %r8d
	callq	_opera1_xilinx_rw
	cmpl	%ebx, %eax
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	addl	%ebx, %r13d
	movq	-48(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%r13d, %eax
	jg	LBB0_7
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_10
LBB0_9:
	movq	_OPERA_WRITE_MSG@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	-56(%rbp), %rcx
	movq	%r15, %rdi
	movl	$160, %esi
	movl	$58880, %edx                    ## imm = 0xE600
	movl	$1, %r8d
	callq	_opera1_xilinx_rw
	xorl	%r12d, %r12d
	cmpl	$1, %eax
	je	LBB0_11
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_11:
	movq	%r14, %rdi
	callq	_kfree
	movq	-48(%rbp), %rdi
	callq	_release_firmware
LBB0_12:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"start downloading fpga firmware %s"

L_.str.1:                               ## @.str.1
	.asciz	"did not find the firmware file '%s'. You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_OPERA_READ_MSG,4,2             ## @OPERA_READ_MSG
	.comm	_OPERA_WRITE_MSG,4,2            ## @OPERA_WRITE_MSG
	.comm	_OPERA_WRITE_FX2,4,2            ## @OPERA_WRITE_FX2
L_.str.2:                               ## @.str.2
	.asciz	"error while transferring firmware"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"could not restart the USB controller CPU."

	.no_dead_strip	_opera1_xilinx_load_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opera1_xilinx_load_firmware
_opera1_xilinx_load_firmware:           ; @opera1_xilinx_load_firmware
	.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	x19, x1
	mov	x20, x0
	str	xzr, [sp, #24]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_info
	add	x0, sp, #24
	mov	x1, x19
	mov	x2, x20
	bl	_request_firmware
	mov	x21, x0
	cbz	w0, LBB0_2
; %bb.1:
	str	x19, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_err
	b	LBB0_13
LBB0_2:
	ldr	x8, [sp, #24]
	ldr	w0, [x8]
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	bl	_kmalloc
	mov	x19, x0
Lloh7:
	adrp	x8, _OPERA_READ_MSG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _OPERA_READ_MSG@GOTPAGEOFF]
Lloh9:
	ldr	w5, [x8]
	add	x3, sp, #20
	mov	x0, x20
	mov	w1, #188
	mov	w2, #0
	mov	w4, #1
	bl	_opera1_xilinx_rw
	cbz	x19, LBB0_12
; %bb.3:
	ldr	w8, [sp, #20]
	cmp	w8, #103
	b.eq	LBB0_12
; %bb.4:
	stp	wzr, wzr, [sp, #12]
	ldr	x8, [sp, #24]
	ldp	w2, w1, [x8]
	mov	x0, x19
	bl	_memcpy
Lloh10:
	adrp	x22, _OPERA_WRITE_MSG@GOTPAGE
Lloh11:
	ldr	x22, [x22, _OPERA_WRITE_MSG@GOTPAGEOFF]
	ldr	w5, [x22]
	add	x3, sp, #12
	mov	x0, x20
	mov	w1, #188
	mov	w2, #170
	mov	w4, #1
	bl	_opera1_xilinx_rw
	ldr	x8, [sp, #24]
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.5:
	mov	w23, #0
	mov	w21, #40
Lloh12:
	adrp	x24, _OPERA_WRITE_FX2@GOTPAGE
Lloh13:
	ldr	x24, [x24, _OPERA_WRITE_FX2@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	sub	w8, w8, w23
	cmp	w8, w21
	csel	w21, w8, w21, lt
	add	x3, x19, w23, sxtw #2
	ldr	w1, [x24]
	ldr	w5, [x22]
	mov	x0, x20
	mov	w2, #0
	mov	x4, x21
	bl	_opera1_xilinx_rw
	cmp	w0, w21
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [sp, #24]
	ldr	w8, [x8]
	add	w23, w21, w23
	cmp	w8, w23
	b.gt	LBB0_6
	b	LBB0_9
LBB0_8:
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_err
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cbnz	w8, LBB0_11
LBB0_9:
	ldr	w5, [x22]
	add	x3, sp, #16
	mov	x0, x20
	mov	w1, #160
	mov	w2, #58880
	mov	w4, #1
	bl	_opera1_xilinx_rw
	cmp	w0, #1
	b.ne	LBB0_11
; %bb.10:
	mov	w21, #0
	b	LBB0_12
LBB0_11:
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_err
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	mov	x0, x19
	bl	_kfree
	ldr	x0, [sp, #24]
	bl	_release_firmware
LBB0_13:
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"start downloading fpga firmware %s"

l_.str.1:                               ; @.str.1
	.asciz	"did not find the firmware file '%s'. You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_OPERA_READ_MSG,4,2             ; @OPERA_READ_MSG
	.comm	_OPERA_WRITE_MSG,4,2            ; @OPERA_WRITE_MSG
	.comm	_OPERA_WRITE_FX2,4,2            ; @OPERA_WRITE_FX2
l_.str.2:                               ; @.str.2
	.asciz	"error while transferring firmware"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"could not restart the USB controller CPU."

	.no_dead_strip	_opera1_xilinx_load_firmware
.subsections_via_symbols
