	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psp_cmd_submit_buf
_psp_cmd_submit_buf:                    ## @psp_cmd_submit_buf
	.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	%ecx, %r13d
	movq	%rdx, %rbx
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	callq	_mutex_lock
	movq	8(%r12), %rdi
	movq	_PSP_CMD_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_memset
	movq	8(%r12), %rdi
	movq	%rbx, %rsi
	movl	$4, %edx
	callq	_memcpy
	leaq	24(%r12), %r14
	movq	%r14, %rdi
	callq	_atomic_inc_return
	movl	%eax, %r15d
	movl	28(%r12), %esi
	movq	%r12, %rdi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_psp_cmd_submit
	testl	%eax, %eax
	je	LBB0_1
## %bb.15:
	movl	%eax, %r13d
	movq	%r14, %rdi
	callq	_atomic_dec
	movq	%r12, %rdi
	callq	_mutex_unlock
	jmp	LBB0_14
LBB0_1:
	movq	%rbx, %r13
	movq	16(%r12), %rax
	cmpl	%r15d, (%rax)
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_6
## %bb.2:
	movl	$-2000, %ebx                    ## imm = 0xF830
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %edi
	callq	_msleep
	movq	16(%r12), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_3
LBB0_6:
	movq	8(%r12), %rax
	movb	$1, %bl
	cmpl	$0, (%rax)
	movq	%r13, %r15
	je	LBB0_11
## %bb.7:
	testq	%r14, %r14
	je	LBB0_9
LBB0_8:
	movl	(%r14), %esi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_WARN
LBB0_9:
	movq	8(%r12), %rax
	movq	_GFX_CMD_STATUS_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_WARN
	testb	%bl, %bl
	je	LBB0_16
## %bb.10:
	movq	8(%r12), %rax
LBB0_11:
	movl	12(%rax), %ecx
	movl	%ecx, (%r15)
	testq	%r14, %r14
	je	LBB0_13
## %bb.12:
	movl	8(%rax), %ecx
	movl	%ecx, 8(%r14)
	movl	4(%rax), %eax
	movl	%eax, 4(%r14)
LBB0_13:
	movq	%r12, %rdi
	callq	_mutex_unlock
	xorl	%r13d, %r13d
	jmp	LBB0_14
LBB0_16:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_14:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	xorl	%ebx, %ebx
	movq	%r13, %r15
	testq	%r14, %r14
	jne	LBB0_8
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_PSP_CMD_BUFFER_SIZE,4,2        ## @PSP_CMD_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to load ucode id (%d) "

L_.str.1:                               ## @.str.1
	.asciz	"psp command failed and response status is (0x%X)\n"

	.comm	_GFX_CMD_STATUS_MASK,4,2        ## @GFX_CMD_STATUS_MASK
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_psp_cmd_submit_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psp_cmd_submit_buf
_psp_cmd_submit_buf:                    ; @psp_cmd_submit_buf
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x23, x3
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	bl	_mutex_lock
	ldr	x0, [x19, #8]
Lloh0:
	adrp	x8, _PSP_CMD_BUFFER_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PSP_CMD_BUFFER_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_memset
	ldr	x0, [x19, #8]
	mov	x1, x21
	mov	w2, #4
	bl	_memcpy
	add	x24, x19, #24
	mov	x0, x24
	bl	_atomic_inc_return
	mov	x22, x0
	ldr	w1, [x19, #28]
	mov	x0, x19
	mov	x2, x23
	mov	x3, x22
	bl	_psp_cmd_submit
	cbz	w0, LBB0_2
; %bb.1:
	mov	x23, x0
	mov	x0, x24
	bl	_atomic_dec
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_15
LBB0_2:
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
	cmp	w8, w22
	b.eq	LBB0_6
; %bb.3:
	mov	w23, #-2000
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	adds	w23, w23, #1
	b.hs	LBB0_16
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	bl	_msleep
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_4
LBB0_6:
	ldr	x8, [x19, #8]
	ldr	w9, [x8]
	cbz	w9, LBB0_11
; %bb.7:
	mov	w22, #1
	cbz	x20, LBB0_9
LBB0_8:
	ldr	w1, [x20]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_WARN
LBB0_9:
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _GFX_CMD_STATUS_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _GFX_CMD_STATUS_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	and	w1, w9, w8
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_WARN
	cbz	w22, LBB0_14
; %bb.10:
	ldr	x8, [x19, #8]
LBB0_11:
	ldr	w9, [x8, #12]
	str	w9, [x21]
	cbz	x20, LBB0_13
; %bb.12:
	ldur	d0, [x8, #4]
	stur	d0, [x20, #4]
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w23, #0
	b	LBB0_15
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_15:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_16:
	mov	w22, #0
	cbnz	x20, LBB0_8
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_PSP_CMD_BUFFER_SIZE,4,2        ; @PSP_CMD_BUFFER_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to load ucode id (%d) "

l_.str.1:                               ; @.str.1
	.asciz	"psp command failed and response status is (0x%X)\n"

	.comm	_GFX_CMD_STATUS_MASK,4,2        ; @GFX_CMD_STATUS_MASK
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_psp_cmd_submit_buf
.subsections_via_symbols
