	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bluebird_patch_dvico_firmware_download
_bluebird_patch_dvico_firmware_download: ## @bluebird_patch_dvico_firmware_download
	.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, %r12
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_dvico_firmware_id_offsets@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_9
## %bb.1:
	xorl	%ebx, %ebx
	movq	_USB_VID_DVICO@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_9
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	movslq	(%rdi,%rbx,4), %r13
	movl	(%r12), %eax
	leal	4(%r13), %ecx
	cmpl	%ecx, %eax
	jl	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r12), %rcx
	movl	(%r14), %edx
	movzbl	%dl, %esi
	cmpl	%esi, (%rcx,%r13,4)
	jne	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	sarl	$8, %edx
	cmpl	%edx, 4(%rcx,%r13,4)
	jne	LBB0_8
## %bb.5:
	movl	%eax, %edi
	callq	_vmalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r15
	movq	8(%r12), %rsi
	movl	(%r12), %edx
	movq	%rax, %rdi
	callq	_memcpy
	movl	(%r12), %eax
	movl	%eax, -64(%rbp)
	movq	%r15, -56(%rbp)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
	callq	_le16_to_cpu
	incl	%eax
	movl	%eax, 8(%r15,%r13,4)
	movl	(%rbx), %edi
	callq	_le16_to_cpu
	sarl	$8, %eax
	movl	%eax, 12(%r15,%r13,4)
	movq	_CYPRESS_FX2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-64(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_usb_cypress_load_firmware
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_vfree
	jmp	LBB0_11
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_10:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_dvico_firmware_id_offsets,8,3  ## @dvico_firmware_id_offsets
	.comm	_USB_VID_DVICO,4,2              ## @USB_VID_DVICO
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CYPRESS_FX2,4,2                ## @CYPRESS_FX2
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_bluebird_patch_dvico_firmware_download
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bluebird_patch_dvico_firmware_download
_bluebird_patch_dvico_firmware_download: ; @bluebird_patch_dvico_firmware_download
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _dvico_firmware_id_offsets@GOTPAGE
Lloh1:
	ldr	x21, [x21, _dvico_firmware_id_offsets@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x23, #0
Lloh2:
	adrp	x24, _USB_VID_DVICO@GOTPAGE
Lloh3:
	ldr	x24, [x24, _USB_VID_DVICO@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #1
	bl	_ARRAY_SIZE
	cmp	x23, w0, sxtw
	b.ge	LBB0_8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21]
	ldrsw	x22, [x0, x23, lsl #2]
	ldr	w8, [x20]
	add	w9, w22, #4
	cmp	w8, w9
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x20, #8]
	ldr	w11, [x9, x22, lsl #2]
	ldr	w10, [x24]
	cmp	w11, w10, uxtb
	b.ne	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w11, w22, #1
	ldr	w9, [x9, w11, sxtw #2]
	cmp	w9, w10, asr #8
	b.ne	LBB0_2
; %bb.6:
	mov	x0, x8
	bl	_vmalloc
	cbz	x0, LBB0_11
; %bb.7:
	mov	x21, x0
	ldr	x1, [x20, #8]
	ldr	w2, [x20]
	bl	_memcpy
	ldr	w8, [x20]
	str	w8, [sp]
	str	x21, [sp, #8]
	ldr	w0, [x19]
	bl	_le16_to_cpu
	add	w8, w0, #1
	add	w9, w22, #2
	str	w8, [x21, w9, sxtw #2]
	ldr	w0, [x19]
	bl	_le16_to_cpu
	asr	w8, w0, #8
	add	w9, w22, #3
	str	w8, [x21, w9, sxtw #2]
Lloh4:
	adrp	x8, _CYPRESS_FX2@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CYPRESS_FX2@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	x1, sp
	mov	x0, x19
	bl	_usb_cypress_load_firmware
	mov	x19, x0
	mov	x0, x21
	bl	_vfree
	b	LBB0_10
LBB0_8:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_dvico_firmware_id_offsets,8,3  ; @dvico_firmware_id_offsets
	.comm	_USB_VID_DVICO,4,2              ; @USB_VID_DVICO
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CYPRESS_FX2,4,2                ; @CYPRESS_FX2
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_bluebird_patch_dvico_firmware_download
.subsections_via_symbols
