	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usb_cypress_load_firmware      ## -- Begin function usb_cypress_load_firmware
	.p2align	4, 0x90
_usb_cypress_load_firmware:             ## @usb_cypress_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movl	$0, -44(%rbp)
	movq	_cypress@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edx, %rcx
	movl	(%rax,%rcx,4), %r15d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movl	$1, (%rax)
	movq	%r14, %rdi
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movl	%r15d, %esi
	movq	%rax, %rdx
	movl	$1, %ecx
	callq	_usb_cypress_writemem
	cmpl	$1, %eax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_err
LBB0_4:
	leaq	-44(%rbp), %r15
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_dvb_usb_get_hexline
	testl	%eax, %eax
	jle	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%rbx), %edx
	movl	16(%rbx), %esi
	movl	20(%rbx), %ecx
	leaq	L_.str.1(%rip), %rdi
	callq	_deb_fw
	movl	16(%rbx), %esi
	movq	8(%rbx), %rdx
	movl	(%rbx), %ecx
	movq	%r14, %rdi
	callq	_usb_cypress_writemem
	movl	(%rbx), %edx
	cmpl	%edx, %eax
	je	LBB0_5
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	testl	%r13d, %r13d
	jns	LBB0_11
LBB0_10:
	movl	-44(%rbp), %esi
	leaq	L_.str.3(%rip), %rdi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_err
	jmp	LBB0_16
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_17
LBB0_6:
	movl	%eax, %r13d
	testl	%r13d, %r13d
	js	LBB0_10
LBB0_11:
	je	LBB0_12
## %bb.14:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	jmp	LBB0_15
LBB0_12:
	movl	$0, (%rbx)
	movq	%r14, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, %rdx
	movl	$1, %ecx
	callq	_usb_cypress_writemem
	xorl	%r13d, %r13d
	cmpl	$1, %eax
	je	LBB0_16
## %bb.13:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_15:
	subl	(%rax), %r13d
LBB0_16:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_17:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cypress,8,3                    ## @cypress
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not stop the USB controller CPU."

L_.str.1:                               ## @.str.1
	.asciz	"writing to address 0x%04x (buffer: 0x%02x %02x)\n"

L_.str.2:                               ## @.str.2
	.asciz	"error while transferring firmware (transferred size: %d, block size: %d)"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"firmware download failed at %d with %d"

L_.str.4:                               ## @.str.4
	.asciz	"could not restart the USB controller CPU."

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_usb_cypress_load_firmware      ; -- Begin function usb_cypress_load_firmware
	.p2align	2
_usb_cypress_load_firmware:             ; @usb_cypress_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	x22, x1
	mov	x20, x0
	str	wzr, [sp, #28]
Lloh0:
	adrp	x8, _cypress@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cypress@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w21, [x8, w2, sxtw #2]
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kmalloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x0
	mov	w8, #1
	str	w8, [x0]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	mov	w3, #1
	bl	_usb_cypress_writemem
	cmp	w0, #1
	b.eq	LBB0_3
; %bb.2:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
LBB0_3:
Lloh8:
	adrp	x24, l_.str.1@PAGE
Lloh9:
	add	x24, x24, l_.str.1@PAGEOFF
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #28
	mov	x0, x22
	mov	x1, x19
	bl	_dvb_usb_get_hexline
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w2, [x19]
	ldp	w1, w3, [x19, #16]
	mov	x0, x24
	bl	_deb_fw
	ldr	w1, [x19, #16]
	ldr	x2, [x19, #8]
	ldr	w3, [x19]
	mov	x0, x20
	bl	_usb_cypress_writemem
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x19]
	cmp	w0, w8
	b.eq	LBB0_4
; %bb.6:
	stp	x0, x8, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w23, w8
	tbz	w23, #31, LBB0_10
LBB0_7:
	ldr	w8, [sp, #28]
	stp	x8, x23, [sp]
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_err
	b	LBB0_15
LBB0_8:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_16
LBB0_9:
	mov	x23, x0
	tbnz	w23, #31, LBB0_7
LBB0_10:
	cbz	w23, LBB0_12
; %bb.11:
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_14
LBB0_12:
	str	wzr, [x19]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	mov	w3, #1
	bl	_usb_cypress_writemem
	cmp	w0, #1
	b.eq	LBB0_15
; %bb.13:
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_err
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_15:
	mov	x0, x19
	bl	_kfree
LBB0_16:
	mov	x0, x23
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_cypress,8,3                    ; @cypress
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not stop the USB controller CPU."

l_.str.1:                               ; @.str.1
	.asciz	"writing to address 0x%04x (buffer: 0x%02x %02x)\n"

l_.str.2:                               ; @.str.2
	.asciz	"error while transferring firmware (transferred size: %d, block size: %d)"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"firmware download failed at %d with %d"

l_.str.4:                               ; @.str.4
	.asciz	"could not restart the USB controller CPU."

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