	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvr2_hdw_cpufw_set_enabled     ## -- Begin function pvr2_hdw_cpufw_set_enabled
	.p2align	4, 0x90
_pvr2_hdw_cpufw_set_enabled:            ## @pvr2_hdw_cpufw_set_enabled
	.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
	movl	%edx, %ebx
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	16(%rdi), %edi
	callq	_LOCK_TAKE
	cmpq	$0, 8(%r15)
	setne	%al
	testl	%ebx, %ebx
	sete	%cl
	xorb	%al, %cl
	jne	LBB0_16
## %bb.1:
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.4:
	xorl	%eax, %eax
	cmpl	$2, %r14d
	setne	%al
	movl	%eax, 4(%r15)
	je	LBB0_12
## %bb.5:
	xorl	%edx, %edx
	cmpl	$1, %r14d
	sete	%dl
	shll	$13, %edx
	addl	$8192, %edx                     ## imm = 0x2000
	movl	%edx, (%r15)
	movq	_PVR2_TRACE_FIRMWARE@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_pvr2_trace
	movl	(%r15), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_pvr2_hdw_cpureset_assert
	movl	(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_pvr2_trace
	movl	20(%r15), %edi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	cmpl	$0, (%r15)
	jle	LBB0_11
## %bb.8:
	movl	%eax, %r14d
	xorl	%ebx, %ebx
	movq	_HZ@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	20(%r15), %edi
	movq	8(%r15), %rax
	addq	%rbx, %rax
	movl	(%r13), %r10d
	subq	$8, %rsp
	movl	%r14d, %esi
	movl	$160, %edx
	movl	$192, %ecx
	movq	%rbx, %r8
	xorl	%r9d, %r9d
	pushq	%r10
	pushq	$2048                           ## imm = 0x800
	pushq	%rax
	callq	_usb_control_msg
	addq	$32, %rsp
	testl	%eax, %eax
	js	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_10 Depth=1
	addq	$2048, %rbx                     ## imm = 0x800
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_10
LBB0_11:
	movl	(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_15
LBB0_2:
	movq	_PVR2_TRACE_FIRMWARE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_pvr2_trace
	movq	8(%r15), %rdi
	callq	_kfree
	movq	$0, 8(%r15)
	movl	$0, (%r15)
	cmpl	$0, 4(%r15)
	je	LBB0_16
## %bb.3:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_pvr2_hdw_cpureset_assert
	jmp	LBB0_16
LBB0_12:
	movq	_PVR2_TRACE_FIRMWARE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_pvr2_trace
	movq	%r15, %rdi
	callq	_pvr2_full_eeprom_fetch
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_13
## %bb.14:
	movq	_EEPROM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movl	(%rbx), %edi
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_15
LBB0_6:
	movl	$0, (%r15)
	jmp	LBB0_16
LBB0_13:
	movl	(%rbx), %edi
	leaq	L_.str.5(%rip), %rsi
LBB0_15:
	xorl	%eax, %eax
	callq	_pvr2_trace
LBB0_16:
	movl	16(%r15), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_LOCK_GIVE                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_TRACE_FIRMWARE,4,2        ## @PVR2_TRACE_FIRMWARE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cleaning up after CPU firmware fetch"

L_.str.1:                               ## @.str.1
	.asciz	"Preparing to suck out CPU firmware (size=%u)"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.2:                               ## @.str.2
	.asciz	"Grabbing CPU firmware"

	.comm	_HZ,4,2                         ## @HZ
L_.str.3:                               ## @.str.3
	.asciz	"Done grabbing CPU firmware"

L_.str.4:                               ## @.str.4
	.asciz	"Sucking down EEPROM contents"

L_.str.5:                               ## @.str.5
	.asciz	"EEPROM content suck failed."

	.comm	_EEPROM_SIZE,8,3                ## @EEPROM_SIZE
L_.str.6:                               ## @.str.6
	.asciz	"Done sucking down EEPROM contents"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvr2_hdw_cpufw_set_enabled     ; -- Begin function pvr2_hdw_cpufw_set_enabled
	.p2align	2
_pvr2_hdw_cpufw_set_enabled:            ; @pvr2_hdw_cpufw_set_enabled
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #16]
	bl	_LOCK_TAKE
	ldr	x8, [x19, #8]
	cmp	x8, #0
	cset	w8, ne
	cmp	w21, #0
	cset	w9, eq
	eor	w8, w9, w8
	tbnz	w8, #0, LBB0_16
; %bb.1:
	cbz	w21, LBB0_9
; %bb.2:
	cmp	w20, #2
	cset	w8, ne
	str	w8, [x19, #4]
	b.eq	LBB0_11
; %bb.3:
	mov	w8, #8192
	mov	w9, #16384
	cmp	w20, #1
	csel	w10, w9, w8, eq
	str	w10, [x19]
Lloh0:
	adrp	x22, _PVR2_TRACE_FIRMWARE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PVR2_TRACE_FIRMWARE@GOTPAGEOFF]
	ldr	w0, [x22]
	csel	x8, x9, x8, eq
	str	x8, [sp]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_pvr2_trace
	ldr	w0, [x19]
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	bl	_kzalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_13
; %bb.4:
	mov	x0, x19
	mov	w1, #1
	bl	_pvr2_hdw_cpureset_assert
	ldr	w0, [x22]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_pvr2_trace
	ldr	w0, [x19, #20]
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.5:
	mov	x20, x0
	mov	x21, #0
Lloh9:
	adrp	x23, _HZ@GOTPAGE
Lloh10:
	ldr	x23, [x23, _HZ@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #20]
	ldr	x8, [x19, #8]
	add	x6, x21, x8
	ldr	w8, [x23]
	str	w8, [sp]
	mov	x1, x20
	mov	w2, #160
	mov	w3, #192
	mov	x4, x21
	mov	w5, #0
	mov	w7, #2048
	bl	_usb_control_msg
	tbnz	w0, #31, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x21, x21, #2048
	ldrsw	x8, [x19]
	cmp	x21, x8
	b.lt	LBB0_6
LBB0_8:
	ldr	w0, [x22]
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_9:
Lloh13:
	adrp	x8, _PVR2_TRACE_FIRMWARE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PVR2_TRACE_FIRMWARE@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_pvr2_trace
	ldr	x0, [x19, #8]
	bl	_kfree
	str	xzr, [x19, #8]
	str	wzr, [x19]
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_16
; %bb.10:
	mov	x0, x19
	mov	w1, #0
	bl	_pvr2_hdw_cpureset_assert
	b	LBB0_16
LBB0_11:
Lloh18:
	adrp	x20, _PVR2_TRACE_FIRMWARE@GOTPAGE
Lloh19:
	ldr	x20, [x20, _PVR2_TRACE_FIRMWARE@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh20:
	adrp	x1, l_.str.4@PAGE
Lloh21:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_pvr2_trace
	mov	x0, x19
	bl	_pvr2_full_eeprom_fetch
	str	x0, [x19, #8]
	cbz	x0, LBB0_14
; %bb.12:
Lloh22:
	adrp	x8, _EEPROM_SIZE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EEPROM_SIZE@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	str	w8, [x19]
	ldr	w0, [x20]
Lloh25:
	adrp	x1, l_.str.6@PAGE
Lloh26:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_15
LBB0_13:
	str	wzr, [x19]
	b	LBB0_16
LBB0_14:
	ldr	w0, [x20]
Lloh27:
	adrp	x1, l_.str.5@PAGE
Lloh28:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_15:
	bl	_pvr2_trace
LBB0_16:
	ldr	w0, [x19, #16]
	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
	b	_LOCK_GIVE
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_TRACE_FIRMWARE,4,2        ; @PVR2_TRACE_FIRMWARE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cleaning up after CPU firmware fetch"

l_.str.1:                               ; @.str.1
	.asciz	"Preparing to suck out CPU firmware (size=%u)"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.2:                               ; @.str.2
	.asciz	"Grabbing CPU firmware"

	.comm	_HZ,4,2                         ; @HZ
l_.str.3:                               ; @.str.3
	.asciz	"Done grabbing CPU firmware"

l_.str.4:                               ; @.str.4
	.asciz	"Sucking down EEPROM contents"

l_.str.5:                               ; @.str.5
	.asciz	"EEPROM content suck failed."

	.comm	_EEPROM_SIZE,8,3                ; @EEPROM_SIZE
l_.str.6:                               ; @.str.6
	.asciz	"Done sucking down EEPROM contents"

.subsections_via_symbols
