	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gp8psk_load_bcm4500fw
_gp8psk_load_bcm4500fw:                 ## @gp8psk_load_bcm4500fw
	.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	%rdi, %rbx
	movq	$0, -48(%rbp)
	movq	_bcm4500_firmware@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	(%rdi), %rdx
	leaq	-48(%rbp), %rdi
	callq	_request_firmware
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r13d
	movl	(%r14), %esi
	leaq	L_.str(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_err
	jmp	LBB0_15
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	movq	_LOAD_BCM4500@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_gp8psk_usb_out_op
	testq	%rax, %rax
	jne	LBB0_14
## %bb.3:
	movl	(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_info
	movq	-48(%rbp), %rax
	movq	(%rax), %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kmalloc
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_16
## %bb.4:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r15), %r12
	cmpq	$255, %r12
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	leaq	(%r15,%r12,4), %rbx
	addq	$16, %rbx
	movq	-48(%rbp), %rax
	movslq	8(%rax), %rcx
	shlq	$2, %rcx
	addq	(%rax), %rcx
	cmpq	%rcx, %rbx
	jae	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$60, %r12d
	jg	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	addq	$4, %r12
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movl	%r12d, %edx
	callq	_dvb_usb_generic_write
	movq	%rbx, %r15
	testq	%rax, %rax
	je	LBB0_5
LBB0_11:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_12
LBB0_16:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_14
LBB0_6:
	xorl	%r13d, %r13d
	jmp	LBB0_13
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
LBB0_12:
	xorl	%eax, %eax
	callq	_err
LBB0_13:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
LBB0_14:
	movq	-48(%rbp), %rdi
	callq	_release_firmware
LBB0_15:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bcm4500_firmware,4,2           ## @bcm4500_firmware
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"did not find the bcm4500 firmware file '%s' (status %d). You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LOAD_BCM4500,4,2               ## @LOAD_BCM4500
L_.str.1:                               ## @.str.1
	.asciz	"downloading bcm4500 firmware from file '%s'"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"failed to load bcm4500 firmware."

L_.str.3:                               ## @.str.3
	.asciz	"firmware chunk size bigger than 64 bytes."

	.no_dead_strip	_gp8psk_load_bcm4500fw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gp8psk_load_bcm4500fw
_gp8psk_load_bcm4500fw:                 ; @gp8psk_load_bcm4500fw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x20, x0
	str	xzr, [sp, #24]
Lloh0:
	adrp	x21, _bcm4500_firmware@GOTPAGE
Lloh1:
	ldr	x21, [x21, _bcm4500_firmware@GOTPAGEOFF]
	ldr	w1, [x21]
	ldr	x2, [x0]
	add	x0, sp, #24
	bl	_request_firmware
	cbz	w0, LBB0_2
; %bb.1:
	mov	x19, x0
	ldr	w8, [x21]
	stp	x8, x19, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
	b	LBB0_15
LBB0_2:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w19, w8
Lloh7:
	adrp	x8, _LOAD_BCM4500@GOTPAGE
Lloh8:
	ldr	x8, [x8, _LOAD_BCM4500@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	mov	w3, #0
	mov	x4, #0
	mov	w5, #0
	bl	_gp8psk_usb_out_op
	cbnz	x0, LBB0_14
; %bb.3:
	ldr	w1, [x21]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_info
	ldr	x8, [sp, #24]
	ldr	x23, [x8]
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kmalloc
	cbz	x0, LBB0_9
; %bb.4:
	mov	x21, x0
Lloh15:
	adrp	x22, l_.str.2@PAGE
Lloh16:
	add	x22, x22, l_.str.2@PAGEOFF
Lloh17:
	adrp	x25, l_.str.3@PAGE
Lloh18:
	add	x25, x25, l_.str.3@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23]
	cmp	w8, #255
	b.eq	LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w24, w8, #4
	add	x26, x23, w24, sxtw #2
	ldr	x9, [sp, #24]
	ldr	x10, [x9]
	ldrsw	x9, [x9, #8]
	add	x9, x10, x9, lsl #2
	cmp	x26, x9
	b.hs	LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w8, #60
	b.gt	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	mov	x1, x23
	mov	x2, x24
	bl	_memcpy
	mov	x0, x20
	mov	x1, x21
	mov	x2, x24
	bl	_dvb_usb_generic_write
	mov	x23, x26
	cbz	x0, LBB0_5
	b	LBB0_12
LBB0_9:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_14
LBB0_10:
	mov	w19, #0
	b	LBB0_13
LBB0_11:
	mov	x22, x25
LBB0_12:
	mov	x0, x22
	bl	_err
LBB0_13:
	mov	x0, x21
	bl	_kfree
LBB0_14:
	ldr	x0, [sp, #24]
	bl	_release_firmware
LBB0_15:
	mov	x0, x19
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_bcm4500_firmware,4,2           ; @bcm4500_firmware
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"did not find the bcm4500 firmware file '%s' (status %d). You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LOAD_BCM4500,4,2               ; @LOAD_BCM4500
l_.str.1:                               ; @.str.1
	.asciz	"downloading bcm4500 firmware from file '%s'"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"failed to load bcm4500 firmware."

l_.str.3:                               ; @.str.3
	.asciz	"firmware chunk size bigger than 64 bytes."

	.no_dead_strip	_gp8psk_load_bcm4500fw
.subsections_via_symbols
