	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	$0, -48(%rbp)
	movl	$1, -44(%rbp)
	movq	_cypress@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edx, %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movl	(%rax,%rcx,4), %esi
	leaq	-44(%rbp), %rdx
	movl	$1, %ecx
	callq	_usb_cypress_writemem
	cmpl	$1, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_err
LBB0_2:
	leaq	-48(%rbp), %r13
	leaq	L_.str.1(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	leaq	-72(%rbp), %rsi
	movq	%r13, %rdx
	callq	_dvb_usb_get_hexline
	testl	%eax, %eax
	jle	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-72(%rbp), %edx
	movl	-56(%rbp), %esi
	movl	-52(%rbp), %ecx
	movq	%r12, %rdi
	callq	_deb_fw
	movl	-56(%rbp), %esi
	movq	-64(%rbp), %rdx
	movl	-72(%rbp), %ecx
	movq	%r14, %rdi
	callq	_usb_cypress_writemem
	movl	-72(%rbp), %edx
	cmpl	%edx, %eax
	je	LBB0_3
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	testl	%ebx, %ebx
	jns	LBB0_9
LBB0_8:
	movl	-48(%rbp), %esi
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_err
	jmp	LBB0_14
LBB0_4:
	movl	%eax, %ebx
	testl	%ebx, %ebx
	js	LBB0_8
LBB0_9:
	je	LBB0_10
## %bb.12:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_10:
	movl	$0, -44(%rbp)
	movq	_cypress@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rax,%rcx,4), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_usb_cypress_writemem
	xorl	%ebx, %ebx
	cmpl	$1, %eax
	je	LBB0_14
## %bb.11:
	leaq	L_.str.4(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_13:
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cypress,8,3                    ## @cypress
	.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, #112
	.cfi_def_cfa_offset 112
	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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	mov	w8, #1
	stp	wzr, w8, [sp, #16]
Lloh0:
	adrp	x23, _cypress@GOTPAGE
Lloh1:
	ldr	x23, [x23, _cypress@GOTPAGEOFF]
	ldr	x8, [x23]
	ldr	w1, [x8, w2, sxtw #2]
	add	x2, sp, #20
	mov	w3, #1
	bl	_usb_cypress_writemem
	cmp	w0, #1
	b.eq	LBB0_2
; %bb.1:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
LBB0_2:
	sxtw	x24, w21
Lloh4:
	adrp	x22, l_.str.1@PAGE
Lloh5:
	add	x22, x22, l_.str.1@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #24
	add	x2, sp, #16
	mov	x0, x20
	bl	_dvb_usb_get_hexline
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldp	w1, w3, [sp, #40]
	ldr	w2, [sp, #24]
	mov	x0, x22
	bl	_deb_fw
	ldr	w1, [sp, #40]
	ldr	x2, [sp, #32]
	ldr	w3, [sp, #24]
	mov	x0, x19
	bl	_usb_cypress_writemem
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [sp, #24]
	cmp	w0, w8
	b.eq	LBB0_3
; %bb.5:
	stp	x0, x8, [sp]
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_err
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w21, w8
	tbz	w21, #31, LBB0_8
LBB0_6:
	ldr	w8, [sp, #16]
	stp	x8, x21, [sp]
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_err
	b	LBB0_13
LBB0_7:
	mov	x21, x0
	tbnz	w21, #31, LBB0_6
LBB0_8:
	cbz	w21, LBB0_10
; %bb.9:
Lloh13:
	adrp	x8, _EIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
	str	wzr, [sp, #20]
	ldr	x8, [x23]
	ldr	w1, [x8, x24, lsl #2]
	add	x2, sp, #20
	mov	x0, x19
	mov	w3, #1
	bl	_usb_cypress_writemem
	cmp	w0, #1
	b.eq	LBB0_13
; %bb.11:
Lloh15:
	adrp	x0, l_.str.4@PAGE
Lloh16:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_err
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_13:
	mov	x0, x21
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_cypress,8,3                    ; @cypress
	.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
