	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_issue_simple_cmd
_pvr2_issue_simple_cmd:                 ## @pvr2_issue_simple_cmd
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	8(%rdi), %edi
	callq	_LOCK_TAKE
	movl	%ebx, %ecx
	movzbl	%cl, %ebx
	movq	(%r15), %rsi
	movl	%ebx, (%rsi)
	movzbl	%ch, %edx
	cmpl	$2, %edx
	movl	$2, %r14d
	cmovael	%r14d, %edx
	testl	%edx, %edx
	je	LBB0_1
## %bb.2:
	movl	%ecx, %eax
	shrl	$16, %eax
	movzbl	%al, %eax
	movl	%eax, 4(%rsi)
	cmpl	$1, %edx
	je	LBB0_4
## %bb.3:
	shrl	$24, %ecx
	movl	%ecx, 8(%rsi)
	movl	$3, %r14d
	jmp	LBB0_4
LBB0_1:
	movl	$1, %r14d
LBB0_4:
	movq	_pvrusb2_debug@GOTPCREL(%rip), %rax
	movq	_PVR2_TRACE_INIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_16
## %bb.5:
	movl	%edx, -120(%rbp)                ## 4-byte Spill
	leaq	L_.str(%rip), %rdx
	leaq	-112(%rbp), %rdi
	movl	$50, %esi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_scnprintf
	movl	%eax, %r12d
	movq	_pvr2_fx2cmd_desc@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_11
## %bb.6:
	movl	%r14d, -116(%rbp)               ## 4-byte Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdi
	cmpl	%ebx, (%rdi,%r14,8)
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%r14
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	cmpq	%rax, %r14
	jb	LBB0_7
	jmp	LBB0_10
LBB0_8:
	movl	%r12d, %eax
	addq	%rbp, %rax
	addq	$-112, %rax
	movl	$50, %esi
	subl	%r12d, %esi
	movl	4(%rdi,%r14,8), %ecx
	leaq	L_.str.1(%rip), %rdx
	movq	%rax, %rdi
	xorl	%eax, %eax
	callq	_scnprintf
	addl	%eax, %r12d
LBB0_10:
	movl	-116(%rbp), %r14d               ## 4-byte Reload
LBB0_11:
	movl	-120(%rbp), %r13d               ## 4-byte Reload
	testl	%r13d, %r13d
	je	LBB0_15
## %bb.12:
	movl	%r12d, %eax
	leaq	(%rax,%rbp), %rdi
	addq	$-112, %rdi
	movl	$50, %esi
	subl	%r12d, %esi
	movq	(%r15), %rax
	movl	4(%rax), %ecx
	leaq	L_.str.2(%rip), %rdx
	xorl	%eax, %eax
	callq	_scnprintf
	movl	%eax, %ebx
	addl	%r12d, %ebx
	cmpl	$1, %r13d
	je	LBB0_14
## %bb.13:
	movl	%ebx, %eax
	leaq	(%rax,%rbp), %rdi
	addq	$-112, %rdi
	movl	$50, %esi
	subl	%ebx, %esi
	movq	(%r15), %rax
	movl	8(%rax), %ecx
	leaq	L_.str.3(%rip), %rdx
	xorl	%eax, %eax
	callq	_scnprintf
	addl	%eax, %ebx
LBB0_14:
	movl	%ebx, %eax
	leaq	(%rax,%rbp), %rdi
	addq	$-112, %rdi
	movl	$50, %esi
	subl	%ebx, %esi
	leaq	L_.str.4(%rip), %rdx
	xorl	%eax, %eax
	callq	_scnprintf
	movl	%eax, %r12d
	addl	%ebx, %r12d
LBB0_15:
	movq	_PVR2_TRACE_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	leaq	-112(%rbp), %rcx
	movl	%r12d, %edx
	callq	_pvr2_trace
	movq	(%r15), %rsi
LBB0_16:
	movq	%r15, %rdi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_pvr2_send_request
	movl	%eax, %ebx
	movl	8(%r15), %edi
	callq	_LOCK_GIVE
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_18
## %bb.17:
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_pvrusb2_debug,4,2              ## @pvrusb2_debug
	.comm	_PVR2_TRACE_INIT,4,2            ## @PVR2_TRACE_INIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Sending FX2 command 0x%x"

	.comm	_pvr2_fx2cmd_desc,8,3           ## @pvr2_fx2cmd_desc
L_.str.1:                               ## @.str.1
	.asciz	" \"%s\""

L_.str.2:                               ## @.str.2
	.asciz	" (%u"

L_.str.3:                               ## @.str.3
	.asciz	",%u"

L_.str.4:                               ## @.str.4
	.asciz	")"

L_.str.5:                               ## @.str.5
	.asciz	"%.*s"

	.no_dead_strip	_pvr2_issue_simple_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_issue_simple_cmd
_pvr2_issue_simple_cmd:                 ; @pvr2_issue_simple_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #72]
	ldr	w0, [x0, #8]
	bl	_LOCK_TAKE
	and	w24, w20, #0xff
	ldr	x1, [x19]
	str	w24, [x1]
	ubfx	w8, w20, #8, #8
	mov	w9, #2
	cmp	w8, #2
	csel	w23, w8, w9, lo
	cbz	w23, LBB0_3
; %bb.1:
	ubfx	w8, w20, #16, #8
	str	w8, [x1, #4]
	cmp	w23, #1
	b.ne	LBB0_4
; %bb.2:
	mov	w20, #2
	b	LBB0_5
LBB0_3:
	mov	w20, #1
	b	LBB0_5
LBB0_4:
	lsr	w8, w20, #24
	str	w8, [x1, #8]
	mov	w20, #3
LBB0_5:
Lloh3:
	adrp	x8, _pvrusb2_debug@GOTPAGE
Lloh4:
	ldr	x8, [x8, _pvrusb2_debug@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x22, _PVR2_TRACE_INIT@GOTPAGE
Lloh7:
	ldr	x22, [x22, _PVR2_TRACE_INIT@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.6:
	str	x24, [sp]
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	add	x0, sp, #22
	mov	w1, #50
	bl	_scnprintf
	mov	x21, x0
Lloh10:
	adrp	x25, _pvr2_fx2cmd_desc@GOTPAGE
Lloh11:
	ldr	x25, [x25, _pvr2_fx2cmd_desc@GOTPAGEOFF]
	ldr	x0, [x25]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_10
; %bb.7:
	mov	x26, #0
	mov	x27, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x25]
	ldr	w8, [x0, x26]
	cmp	w8, w24
	b.eq	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x27, x27, #1
	bl	_ARRAY_SIZE
	add	x26, x26, #8
	cmp	x27, w0, uxtw
	b.lo	LBB0_8
LBB0_10:
	cbnz	w23, LBB0_12
	b	LBB0_15
LBB0_11:
	add	x8, sp, #22
	add	x8, x8, w21, uxtw
	mov	w9, #50
	sub	w1, w9, w21
	add	x9, x0, x26
	ldr	w9, [x9, #4]
	str	x9, [sp]
Lloh12:
	adrp	x2, l_.str.1@PAGE
Lloh13:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x8
	bl	_scnprintf
	add	w21, w0, w21
	cbz	w23, LBB0_15
LBB0_12:
	add	x24, sp, #22
	add	x0, x24, w21, uxtw
	mov	w25, #50
	sub	w1, w25, w21
	ldr	x8, [x19]
	ldr	w8, [x8, #4]
	str	x8, [sp]
Lloh14:
	adrp	x2, l_.str.2@PAGE
Lloh15:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_scnprintf
	add	w21, w0, w21
	cmp	w23, #1
	b.eq	LBB0_14
; %bb.13:
	add	x0, x24, w21, uxtw
	sub	w1, w25, w21
	ldr	x8, [x19]
	ldr	w8, [x8, #8]
	str	x8, [sp]
Lloh16:
	adrp	x2, l_.str.3@PAGE
Lloh17:
	add	x2, x2, l_.str.3@PAGEOFF
	bl	_scnprintf
	add	w21, w0, w21
LBB0_14:
	add	x0, x24, w21, uxtw
	sub	w1, w25, w21
Lloh18:
	adrp	x2, l_.str.4@PAGE
Lloh19:
	add	x2, x2, l_.str.4@PAGEOFF
	bl	_scnprintf
	add	w21, w0, w21
LBB0_15:
	ldr	w0, [x22]
Lloh20:
	adrp	x1, l_.str.5@PAGE
Lloh21:
	add	x1, x1, l_.str.5@PAGEOFF
	add	x3, sp, #22
	mov	x2, x21
	bl	_pvr2_trace
	ldr	x1, [x19]
LBB0_16:
	mov	x0, x19
	mov	x2, x20
	mov	x3, #0
	mov	w4, #0
	bl	_pvr2_send_request
	mov	x20, x0
	ldr	w0, [x19, #8]
	bl	_LOCK_GIVE
	ldr	x8, [sp, #72]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.17:
	mov	x0, x20
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_pvrusb2_debug,4,2              ; @pvrusb2_debug
	.comm	_PVR2_TRACE_INIT,4,2            ; @PVR2_TRACE_INIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Sending FX2 command 0x%x"

	.comm	_pvr2_fx2cmd_desc,8,3           ; @pvr2_fx2cmd_desc
l_.str.1:                               ; @.str.1
	.asciz	" \"%s\""

l_.str.2:                               ; @.str.2
	.asciz	" (%u"

l_.str.3:                               ; @.str.3
	.asciz	",%u"

l_.str.4:                               ; @.str.4
	.asciz	")"

l_.str.5:                               ; @.str.5
	.asciz	"%.*s"

	.no_dead_strip	_pvr2_issue_simple_cmd
.subsections_via_symbols
