	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_locate_firmware
_pvr2_locate_firmware:                  ## @pvr2_locate_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	%rdx, -64(%rbp)                 ## 8-byte Spill
	testl	%ecx, %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_1
## %bb.2:
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movl	%ecx, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r8, %r14
	movq	(%r8,%r12,8), %rsi
	movq	(%r15), %rdx
	movq	%rbx, %rdi
	callq	_request_firmware
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %r13d
	movq	_ENOENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r13d, %eax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%r12
	cmpq	%r12, -72(%rbp)                 ## 8-byte Folded Reload
	movq	%r14, %r8
	jne	LBB0_3
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_8:
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	_PVR2_TRACE_ERROR_LEGS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_pvr2_trace
	movl	(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_pvr2_trace
	movl	(%rbx), %edi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	cmpl	$1, %ebx
	jne	LBB0_10
## %bb.9:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rcx
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_pvr2_trace
	jmp	LBB0_13
LBB0_10:
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_pvr2_trace
	testl	%ebx, %ebx
	je	LBB0_13
## %bb.11:
	movl	%ebx, %r14d
	leaq	L_.str.6(%rip), %r15
	xorl	%ebx, %ebx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	_PVR2_TRACE_ERROR_LEGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r12,%rbx,8), %rdx
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_pvr2_trace
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_12
	jmp	LBB0_13
LBB0_4:
	movq	(%r14,%r12,8), %rdx
	leaq	L_.str(%rip), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_trace_firmware
	movl	%r12d, %r13d
	jmp	LBB0_13
LBB0_6:
	movq	_PVR2_TRACE_ERROR_LEGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_pvr2_trace
LBB0_13:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Located %s firmware: %s; uploading..."

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_PVR2_TRACE_ERROR_LEGS,4,2      ## @PVR2_TRACE_ERROR_LEGS
L_.str.1:                               ## @.str.1
	.asciz	"request_firmware fatal error with code=%d"

L_.str.2:                               ## @.str.2
	.asciz	"***WARNING*** Device %s firmware seems to be missing."

L_.str.3:                               ## @.str.3
	.asciz	"Did you install the pvrusb2 firmware files in their proper location?"

L_.str.4:                               ## @.str.4
	.asciz	"request_firmware unable to locate %s file %s"

L_.str.5:                               ## @.str.5
	.asciz	"request_firmware unable to locate one of the following %s files:"

L_.str.6:                               ## @.str.6
	.asciz	"request_firmware: Failed to find %s"

	.no_dead_strip	_pvr2_locate_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_locate_firmware
_pvr2_locate_firmware:                  ; @pvr2_locate_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x4
	mov	x22, x3
	mov	x21, x2
	cbz	w3, LBB0_5
; %bb.1:
	mov	x23, x1
	mov	x24, x0
	mov	x25, #0
	mov	w26, w22
Lloh0:
	adrp	x27, _ENOENT@GOTPAGE
Lloh1:
	ldr	x27, [x27, _ENOENT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x20, x25, lsl #3]
	ldr	x2, [x24]
	mov	x0, x23
	bl	_request_firmware
	cbz	w0, LBB0_11
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x19, x0
	ldr	w8, [x27]
	cmn	w0, w8
	b.ne	LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x25, x25, #1
	cmp	x26, x25
	b.ne	LBB0_2
	b	LBB0_6
LBB0_5:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_6:
Lloh5:
	adrp	x23, _PVR2_TRACE_ERROR_LEGS@GOTPAGE
Lloh6:
	ldr	x23, [x23, _PVR2_TRACE_ERROR_LEGS@GOTPAGEOFF]
	ldr	w0, [x23]
	str	x21, [sp]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_pvr2_trace
	ldr	w0, [x23]
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_pvr2_trace
	ldr	w0, [x23]
	cmp	w22, #1
	b.ne	LBB0_8
; %bb.7:
	ldr	x8, [x20]
	stp	x21, x8, [sp]
Lloh11:
	adrp	x1, l_.str.4@PAGE
Lloh12:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_13
LBB0_8:
	str	x21, [sp]
Lloh13:
	adrp	x1, l_.str.5@PAGE
Lloh14:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_pvr2_trace
	cbz	w22, LBB0_14
; %bb.9:
	mov	w22, w22
Lloh15:
	adrp	x21, l_.str.6@PAGE
Lloh16:
	add	x21, x21, l_.str.6@PAGEOFF
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	ldr	x8, [x20], #8
	str	x8, [sp]
	mov	x1, x21
	bl	_pvr2_trace
	subs	x22, x22, #1
	b.ne	LBB0_10
	b	LBB0_14
LBB0_11:
	ldr	x2, [x20, x25, lsl #3]
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_trace_firmware
	mov	x19, x25
	b	LBB0_14
LBB0_12:
Lloh19:
	adrp	x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	str	x19, [sp]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_13:
	bl	_pvr2_trace
LBB0_14:
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Located %s firmware: %s; uploading..."

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_PVR2_TRACE_ERROR_LEGS,4,2      ; @PVR2_TRACE_ERROR_LEGS
l_.str.1:                               ; @.str.1
	.asciz	"request_firmware fatal error with code=%d"

l_.str.2:                               ; @.str.2
	.asciz	"***WARNING*** Device %s firmware seems to be missing."

l_.str.3:                               ; @.str.3
	.asciz	"Did you install the pvrusb2 firmware files in their proper location?"

l_.str.4:                               ; @.str.4
	.asciz	"request_firmware unable to locate %s file %s"

l_.str.5:                               ; @.str.5
	.asciz	"request_firmware unable to locate one of the following %s files:"

l_.str.6:                               ; @.str.6
	.asciz	"request_firmware: Failed to find %s"

	.no_dead_strip	_pvr2_locate_firmware
.subsections_via_symbols
