	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psp_v10_0_cmd_submit
_psp_v10_0_cmd_submit:                  ## @psp_v10_0_cmd_submit
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movslq	8(%rdi), %rcx
	movabsq	$-3689348814741910323, %rdx     ## imm = 0xCCCCCCCCCCCCCCCD
	movq	%rcx, %rax
	mulq	%rdx
	movq	16(%rdi), %r15
	shrq	$5, %rdx
	leal	3(%rcx), %r12d
	testq	%rcx, %rcx
	leaq	(%rdx,%rdx,4), %rbx
	cmovnsl	%ecx, %r12d
	sarl	$2, %r12d
	movq	_MP0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_mmMP0_SMN_C2PMSG_67@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_RREG32_SOC15
	movl	%eax, %r13d
	xorl	%edx, %edx
	divl	%r12d
	movq	%r15, %r14
	testl	%edx, %edx
	je	LBB0_2
## %bb.1:
	movl	%r13d, %eax
	movl	$3435973837, %ecx               ## imm = 0xCCCCCCCD
	imulq	%rax, %rcx
	shrq	$35, %rcx
	leaq	(%rcx,%rcx,4), %rax
	leaq	(%r15,%rax,8), %r14
LBB0_2:
	leaq	(%r15,%rbx,8), %rdx
	addq	$-40, %rdx
	cmpq	%r15, %r14
	jb	LBB0_4
## %bb.3:
	cmpq	%r14, %rdx
	jb	LBB0_4
## %bb.5:
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_upper_32_bits
	movq	%rax, 32(%r14)
	movl	%ebx, %edi
	callq	_lower_32_bits
	movq	%rax, 24(%r14)
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_upper_32_bits
	movq	%rax, 16(%r14)
	movl	%ebx, %edi
	callq	_lower_32_bits
	movq	%rax, 8(%r14)
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r14)
	addl	$10, %r13d
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%r12d
	movl	%edx, %ecx
	movq	_MP0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_mmMP0_SMN_C2PMSG_67@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_WREG32_SOC15
	jmp	LBB0_6
LBB0_4:
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_6:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MP0,4,2                        ## @MP0
	.comm	_mmMP0_SMN_C2PMSG_67,4,2        ## @mmMP0_SMN_C2PMSG_67
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ring_buffer_start = %p; ring_buffer_end = %p; write_frame = %p\n"

L_.str.1:                               ## @.str.1
	.asciz	"write_frame is pointing to address out of bounds\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_psp_v10_0_cmd_submit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psp_v10_0_cmd_submit
_psp_v10_0_cmd_submit:                  ; @psp_v10_0_cmd_submit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x3
	mov	x20, x2
	mov	x21, x1
	ldr	x27, [x0, #16]
	ldrsw	x8, [x0, #8]
	mov	x9, #-3689348814741910324
	movk	x9, #52429
	umulh	x9, x8, x9
	lsr	x9, x9, #5
	mov	w10, #40
	madd	x28, x9, x10, x27
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w24, w8, #2
Lloh0:
	adrp	x25, _MP0@GOTPAGE
Lloh1:
	ldr	x25, [x25, _MP0@GOTPAGEOFF]
	ldr	w0, [x25]
Lloh2:
	adrp	x26, _mmMP0_SMN_C2PMSG_67@GOTPAGE
Lloh3:
	ldr	x26, [x26, _mmMP0_SMN_C2PMSG_67@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	w1, #0
	bl	_RREG32_SOC15
	mov	x22, x0
	udiv	w8, w0, w24
	msub	w8, w8, w24, w0
	mov	x23, x27
	cbz	w8, LBB0_2
; %bb.1:
	mov	w8, #52429
	movk	w8, #52428, lsl #16
	umull	x8, w22, w8
	lsr	x8, x8, #35
	mov	w9, #40
	madd	x23, x8, x9, x27
LBB0_2:
	sub	x8, x28, #40
	cmp	x23, x27
	b.lo	LBB0_5
; %bb.3:
	cmp	x8, x23
	b.lo	LBB0_5
; %bb.4:
	mov	x0, x23
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	mov	x0, x21
	bl	_upper_32_bits
	str	x0, [x23, #32]
	mov	x0, x21
	bl	_lower_32_bits
	str	x0, [x23, #24]
	mov	x0, x20
	bl	_upper_32_bits
	str	x0, [x23, #16]
	mov	x0, x20
	bl	_lower_32_bits
	str	x0, [x23, #8]
	str	w19, [x23]
	add	w8, w22, #10
	udiv	w9, w8, w24
	msub	w3, w9, w24, w8
	ldr	w0, [x25]
	ldr	w2, [x26]
	mov	w1, #0
	bl	_WREG32_SOC15
	mov	w0, #0
	b	LBB0_6
LBB0_5:
	stp	x8, x23, [sp, #8]
	str	x27, [sp]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MP0,4,2                        ; @MP0
	.comm	_mmMP0_SMN_C2PMSG_67,4,2        ; @mmMP0_SMN_C2PMSG_67
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ring_buffer_start = %p; ring_buffer_end = %p; write_frame = %p\n"

l_.str.1:                               ; @.str.1
	.asciz	"write_frame is pointing to address out of bounds\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_psp_v10_0_cmd_submit
.subsections_via_symbols
