	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psbfb_2d_submit
_psbfb_2d_submit:                       ## @psbfb_2d_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
	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
	movq	%rsi, %r12
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.1:
	movq	_PSB_SGX_2D_SLAVE_PORT@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	cmpl	$96, %ebx
	movl	$96, %r15d
	cmovbl	%ebx, %r15d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	callq	_psb_2d_wait_available
	testl	%eax, %eax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	subl	%r15d, %ebx
	movl	%ebx, %r13d
	shll	$2, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12,%rbx), %edi
	movq	(%r14), %rsi
	addq	%rbx, %rsi
	callq	_PSB_WSGX32
	addq	$4, %rbx
	cmpq	%r15, %rbx
	jb	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r14), %rax
	leaq	(%rax,%rbx), %rdi
	addq	$-4, %rdi
	callq	_PSB_RSGX32
	addq	%rbx, %r12
	movl	%r13d, %ebx
	testl	%r13d, %r13d
	jne	LBB0_2
LBB0_7:
	xorl	%r13d, %r13d
	jmp	LBB0_8
LBB0_3:
	movl	%eax, %r13d
LBB0_8:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PSB_SGX_2D_SLAVE_PORT,8,3      ## @PSB_SGX_2D_SLAVE_PORT
	.no_dead_strip	_psbfb_2d_submit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psbfb_2d_submit
_psbfb_2d_submit:                       ; @psbfb_2d_submit
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_spin_lock_irqsave
	cbz	w20, LBB0_6
; %bb.1:
	mov	w24, #96
Lloh0:
	adrp	x25, _PSB_SGX_2D_SLAVE_PORT@GOTPAGE
Lloh1:
	ldr	x25, [x25, _PSB_SGX_2D_SLAVE_PORT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	cmp	w20, #96
	csel	w23, w20, w24, lo
	mov	x0, x19
	mov	x1, x23
	bl	_psb_2d_wait_available
	cbnz	w0, LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x22, #0
	sub	w20, w20, w23
	lsl	w23, w23, #2
LBB0_4:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x21, x22]
	ldr	x8, [x25]
	add	x1, x22, x8
	bl	_PSB_WSGX32
	add	x22, x22, #4
	cmp	x22, x23
	b.lo	LBB0_4
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x25]
	add	x8, x8, x22
	sub	x0, x8, #4
	bl	_PSB_RSGX32
	add	x21, x21, x22
	cbnz	w20, LBB0_2
LBB0_6:
	mov	w22, #0
	b	LBB0_8
LBB0_7:
	mov	x22, x0
LBB0_8:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x22
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_PSB_SGX_2D_SLAVE_PORT,8,3      ; @PSB_SGX_2D_SLAVE_PORT
	.no_dead_strip	_psbfb_2d_submit
.subsections_via_symbols
