	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i915_emit_cmds
_i915_emit_cmds:                        ## @i915_emit_cmds
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	(%rdi), %rdi
	movslq	%edx, %rax
	leaq	4(,%rax,4), %rbx
	callq	_LP_RING
	movslq	(%rax), %rax
	addq	$-8, %rax
	cmpq	%rax, %rbx
	jae	LBB0_5
## %bb.1:
	leal	1(%r12), %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r12d, %ebx
	jge	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	%ebx, %rax
	movl	(%r14,%rax,4), %edi
	callq	_validate_cmd
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	%eax, %ebx
	cmpl	%r12d, %ebx
	jle	LBB0_2
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_13:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	andl	$-2, %r15d
	movl	%r15d, %edi
	callq	_BEGIN_LP_RING
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.7:
	testl	%r12d, %r12d
	jle	LBB0_10
## %bb.8:
	movl	%r12d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14,%rbx,4), %edi
	callq	_OUT_RING
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_9
LBB0_10:
	testb	$1, %r12b
	je	LBB0_12
## %bb.11:
	xorl	%edi, %edi
	callq	_OUT_RING
LBB0_12:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_ADVANCE_LP_RING
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_i915_emit_cmds
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i915_emit_cmds
_i915_emit_cmds:                        ; @i915_emit_cmds
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	mov	x20, x1
	ldr	x0, [x0]
	add	w21, w2, #1
	bl	_LP_RING
	ldrsw	x8, [x0]
	sub	x8, x8, #8
	cmp	x8, w21, sxtw #2
	b.ls	LBB0_4
; %bb.1:
	mov	w22, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w22, w19
	b.ge	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x20, w22, sxtw #2]
	bl	_validate_cmd
	add	w22, w0, w22
	cmp	w0, #0
	ccmp	w22, w19, #0, ne
	b.le	LBB0_2
LBB0_4:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	and	w0, w21, #0xfffffffe
	bl	_BEGIN_LP_RING
	cbnz	w0, LBB0_5
; %bb.7:
	cmp	w19, #1
	b.lt	LBB0_10
; %bb.8:
	mov	w21, w19
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20], #4
	bl	_OUT_RING
	subs	x21, x21, #1
	b.ne	LBB0_9
LBB0_10:
	tbz	w19, #0, LBB0_12
; %bb.11:
	mov	w0, #0
	bl	_OUT_RING
LBB0_12:
	bl	_ADVANCE_LP_RING
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_i915_emit_cmds
.subsections_via_symbols
