	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_renderstate_emit         ## -- Begin function intel_renderstate_emit
	.p2align	4, 0x90
_intel_renderstate_emit:                ## @intel_renderstate_emit
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movaps	%xmm0, -80(%rbp)
	movq	%r15, %rdi
	callq	_render_state_get_rodata
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%rax), %eax
	shll	$2, %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cmpl	%esi, %eax
	jle	LBB0_4
## %bb.3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_18
LBB0_4:
	movl	16(%r15), %edi
	callq	_i915_gem_object_create_internal
	movq	%rax, %r12
	movq	%rax, -72(%rbp)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_5
## %bb.19:
	movq	%r12, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_5:
	movq	8(%r15), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_i915_vma_instance
	movq	%rax, %r13
	movq	%rax, -64(%rbp)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r13, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_7:
	movq	_PIN_GLOBAL@GOTPCREL(%rip), %rax
	movq	_PIN_HIGH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_i915_vma_pin
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.8:
	movl	(%r14), %esi
	leaq	-80(%rbp), %rdi
	callq	_render_state_setup
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.9:
	movl	-80(%rbp), %edx
	movl	-52(%rbp), %esi
	movq	_I915_DISPATCH_SECURE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	%r14, %rdi
	callq	*(%r15)
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.10:
	movl	-76(%rbp), %edx
	cmpl	$9, %edx
	jl	LBB0_12
## %bb.11:
	movl	-56(%rbp), %esi
	movl	(%r12), %ecx
	movq	%r14, %rdi
	callq	*(%r15)
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
LBB0_12:
	movq	-64(%rbp), %rdi
	callq	_i915_vma_lock
	movq	-64(%rbp), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_i915_request_await_object
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	movq	-64(%rbp), %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_i915_vma_move_to_active
	movl	%eax, %ebx
LBB0_14:
	movq	-64(%rbp), %rdi
	callq	_i915_vma_unlock
LBB0_15:
	movq	-64(%rbp), %rdi
	callq	_i915_vma_unpin
	movq	-64(%rbp), %r13
LBB0_16:
	movq	%r13, %rdi
	callq	_i915_vma_close
	movq	-72(%rbp), %r12
LBB0_17:
	movq	%r12, %rdi
	callq	_i915_gem_object_put
LBB0_18:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PIN_GLOBAL,4,2                 ## @PIN_GLOBAL
	.comm	_PIN_HIGH,4,2                   ## @PIN_HIGH
	.comm	_I915_DISPATCH_SECURE,4,2       ## @I915_DISPATCH_SECURE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_renderstate_emit         ; -- Begin function intel_renderstate_emit
	.p2align	2
_intel_renderstate_emit:                ; @intel_renderstate_emit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x0
	ldr	x20, [x0, #8]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	mov	x0, x20
	bl	_render_state_get_rodata
	str	x0, [sp, #32]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	cmp	w1, w8, lsl #2
	b.ge	LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_19
LBB0_3:
	mov	w21, #0
	b	LBB0_19
LBB0_4:
	ldr	w0, [x20, #16]
	bl	_i915_gem_object_create_internal
	mov	x22, x0
	str	x0, [sp, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_6
; %bb.5:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_PTR_ERR
LBB0_6:
	ldr	x8, [x20, #8]
	ldr	x1, [x8]
	mov	x0, x22
	mov	x2, #0
	bl	_i915_vma_instance
	mov	x23, x0
	str	x0, [sp, #16]
	bl	_IS_ERR
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x23
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_18
LBB0_8:
Lloh6:
	adrp	x8, _PIN_GLOBAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PIN_GLOBAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _PIN_HIGH@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PIN_HIGH@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, x23
	mov	w1, #0
	mov	w2, #0
	bl	_i915_vma_pin
	mov	x21, x0
	cbnz	w0, LBB0_17
; %bb.9:
	ldr	w1, [x19]
	mov	x0, sp
	bl	_render_state_setup
	mov	x21, x0
	cbnz	w0, LBB0_16
; %bb.10:
	ldr	x8, [x20]
	ldr	w1, [sp, #28]
	ldr	w2, [sp]
Lloh12:
	adrp	x22, _I915_DISPATCH_SECURE@GOTPAGE
Lloh13:
	ldr	x22, [x22, _I915_DISPATCH_SECURE@GOTPAGEOFF]
	ldr	w3, [x22]
	mov	x0, x19
	blr	x8
	mov	x21, x0
	cbnz	w0, LBB0_16
; %bb.11:
	ldr	w2, [sp, #4]
	cmp	w2, #9
	b.lt	LBB0_13
; %bb.12:
	ldr	x8, [x20]
	ldr	w1, [sp, #24]
	ldr	w3, [x22]
	mov	x0, x19
	blr	x8
	mov	x21, x0
	cbnz	w0, LBB0_16
LBB0_13:
	ldr	x0, [sp, #16]
	bl	_i915_vma_lock
	ldr	x8, [sp, #16]
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_i915_request_await_object
	mov	x21, x0
	cbnz	w0, LBB0_15
; %bb.14:
	ldr	x0, [sp, #16]
	mov	x1, x19
	mov	w2, #0
	bl	_i915_vma_move_to_active
	mov	x21, x0
LBB0_15:
	ldr	x0, [sp, #16]
	bl	_i915_vma_unlock
LBB0_16:
	ldr	x0, [sp, #16]
	bl	_i915_vma_unpin
	ldr	x23, [sp, #16]
LBB0_17:
	mov	x0, x23
	bl	_i915_vma_close
	ldr	x22, [sp, #8]
LBB0_18:
	mov	x0, x22
	bl	_i915_gem_object_put
LBB0_19:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PIN_GLOBAL,4,2                 ; @PIN_GLOBAL
	.comm	_PIN_HIGH,4,2                   ; @PIN_HIGH
	.comm	_I915_DISPATCH_SECURE,4,2       ; @I915_DISPATCH_SECURE
.subsections_via_symbols
