	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function go7007_loader_probe
_go7007_loader_probe:                   ## @go7007_loader_probe
	.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	%rdi, %r14
	callq	_interface_to_usbdev
	movl	%eax, %edi
	callq	_usb_get_dev
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_19
## %bb.1:
	cmpl	$1, 4(%r15)
	jne	LBB0_2
## %bb.3:
	movl	12(%r15), %edi
	callq	_le16_to_cpu
	movq	%rax, %r12
	movl	8(%r15), %edi
	callq	_le16_to_cpu
	movq	_fw_configs@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %rbx
	testq	%rbx, %rbx
	je	LBB0_19
## %bb.4:
	leaq	32(%rcx), %rsi
	xorl	%edx, %edx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rdx
	movq	(%rsi), %rbx
	addq	$32, %rsi
	testq	%rbx, %rbx
	je	LBB0_19
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%r12, -24(%rsi)
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpq	%rax, -16(%rsi)
	jne	LBB0_7
## %bb.8:
	movl	%edx, %eax
	shlq	$5, %rax
	movq	24(%rcx,%rax), %r12
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_dev_info
	leaq	-48(%rbp), %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_request_firmware
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
LBB0_10:
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_19
LBB0_2:
	leaq	L_.str(%rip), %rsi
LBB0_18:
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_19:
	movq	%r15, %rdi
	callq	_usb_put_dev
	leaq	L_.str.5(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	-48(%rbp), %rsi
	movq	_CYPRESS_FX2@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%r15, %rdi
	callq	_cypress_load_firmware
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi
	callq	_release_firmware
	testl	%ebx, %ebx
	je	LBB0_13
## %bb.12:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_18
LBB0_13:
	xorl	%ebx, %ebx
	testq	%r12, %r12
	je	LBB0_20
## %bb.14:
	leaq	-48(%rbp), %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_request_firmware
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movq	%r12, %rdx
	jmp	LBB0_10
LBB0_16:
	movq	-48(%rbp), %rsi
	movl	(%r13), %edx
	movq	%r15, %rdi
	callq	_cypress_load_firmware
	movl	%eax, %r12d
	movq	-48(%rbp), %rdi
	callq	_release_firmware
	testl	%r12d, %r12d
	je	LBB0_20
## %bb.17:
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't handle multiple config\n"

	.comm	_fw_configs,8,3                 ## @fw_configs
L_.str.1:                               ## @.str.1
	.asciz	"loading firmware %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"unable to load firmware from file \"%s\"\n"

	.comm	_CYPRESS_FX2,4,2                ## @CYPRESS_FX2
L_.str.3:                               ## @.str.3
	.asciz	"loader download failed\n"

L_.str.4:                               ## @.str.4
	.asciz	"firmware download failed\n"

L_.str.5:                               ## @.str.5
	.asciz	"probe failed\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_go7007_loader_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function go7007_loader_probe
_go7007_loader_probe:                   ; @go7007_loader_probe
	.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	x19, x0
	bl	_interface_to_usbdev
	bl	_usb_get_dev
	mov	x20, x0
	cbz	x0, LBB0_12
; %bb.1:
	ldr	w8, [x20, #4]
	cmp	w8, #1
	b.ne	LBB0_10
; %bb.2:
	ldr	w0, [x20, #12]
	bl	_le16_to_cpu
	mov	x22, x0
	ldr	w0, [x20, #8]
	bl	_le16_to_cpu
Lloh0:
	adrp	x8, _fw_configs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _fw_configs@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x21, [x8]
	cbz	x21, LBB0_12
; %bb.3:
	mov	x9, #0
	add	x10, x8, #16
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x9, x9, #1
	ldr	x21, [x10, #16]
	add	x10, x10, #32
	cbz	x21, LBB0_12
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldur	x11, [x10, #-8]
	cmp	x11, x22
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x11, [x10]
	cmp	x11, x0
	b.ne	LBB0_4
; %bb.7:
	and	x9, x9, #0xffffffff
	add	x8, x8, x9, lsl #5
	ldr	x22, [x8, #24]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dev_info
	add	x0, sp, #8
	mov	x1, x21
	mov	x2, x20
	bl	_request_firmware
	cbz	x0, LBB0_14
; %bb.8:
	str	x21, [sp]
LBB0_9:
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
LBB0_11:
	mov	x0, x19
	bl	_dev_err
LBB0_12:
	mov	x0, x20
	bl	_usb_put_dev
Lloh9:
	adrp	x1, l_.str.5@PAGE
Lloh10:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh11:
	adrp	x8, _ENODEV@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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_14:
	ldr	x1, [sp, #8]
Lloh14:
	adrp	x23, _CYPRESS_FX2@GOTPAGE
Lloh15:
	ldr	x23, [x23, _CYPRESS_FX2@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x20
	bl	_cypress_load_firmware
	mov	x21, x0
	ldr	x0, [sp, #8]
	bl	_release_firmware
	cbz	w21, LBB0_16
; %bb.15:
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_11
LBB0_16:
	cbz	x22, LBB0_21
; %bb.17:
	add	x0, sp, #8
	mov	x1, x22
	mov	x2, x20
	bl	_request_firmware
	cbz	x0, LBB0_19
; %bb.18:
	str	x22, [sp]
	b	LBB0_9
LBB0_19:
	ldr	x1, [sp, #8]
	ldr	w2, [x23]
	mov	x0, x20
	bl	_cypress_load_firmware
	mov	x21, x0
	ldr	x0, [sp, #8]
	bl	_release_firmware
	cbz	w21, LBB0_21
; %bb.20:
Lloh18:
	adrp	x1, l_.str.4@PAGE
Lloh19:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_11
LBB0_21:
	mov	w0, #0
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't handle multiple config\n"

	.comm	_fw_configs,8,3                 ; @fw_configs
l_.str.1:                               ; @.str.1
	.asciz	"loading firmware %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"unable to load firmware from file \"%s\"\n"

	.comm	_CYPRESS_FX2,4,2                ; @CYPRESS_FX2
l_.str.3:                               ; @.str.3
	.asciz	"loader download failed\n"

l_.str.4:                               ; @.str.4
	.asciz	"firmware download failed\n"

l_.str.5:                               ; @.str.5
	.asciz	"probe failed\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_go7007_loader_probe
.subsections_via_symbols
