	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_context_apply_clear_state      ## -- Begin function context_apply_clear_state
	.p2align	4, 0x90
_context_apply_clear_state:             ## @context_apply_clear_state
	.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	%rcx, %rbx
	movl	%edx, %r14d
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movq	(%rcx), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	8(%rcx), %r12
	movq	24(%rdi), %r15
	movq	_STATE_FRAMEBUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_isStateDirty
	movl	%r14d, %edi
	testq	%rax, %rax
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	jne	LBB0_12
## %bb.1:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rbx, (%rax)
	jne	LBB0_12
## %bb.2:
	cmpl	%edi, 24(%r15)
	jne	LBB0_12
## %bb.3:
	movq	_wined3d_settings@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ORM_FBO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_42
## %bb.4:
	testl	%edi, %edi
	movq	%r15, %r14
	je	LBB0_44
## %bb.5:
	movq	(%r12), %rax
	movq	8(%rax), %rdi
	callq	_wined3d_resource_is_offscreen
	testq	%rax, %rax
	je	LBB0_23
## %bb.6:
	movq	_WINED3DFMT_NULL@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %edx
	cmpl	$1, %ecx
	jne	LBB0_45
## %bb.7:
	xorl	%ecx, %ecx
	xorl	%r15d, %r15d
LBB0_8:
	testb	$1, %dl
	je	LBB0_33
## %bb.9:
	movq	(%r12,%rcx,8), %rdx
	testq	%rdx, %rdx
	je	LBB0_33
## %bb.10:
	movq	(%rdx), %rdx
	cmpq	%rax, (%rdx)
	je	LBB0_33
## %bb.11:
	btsl	%ecx, %r15d
	jmp	LBB0_33
LBB0_12:
	movq	%r12, %rsi
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_have_framebuffer_attachment
	testl	%eax, %eax
	je	LBB0_21
## %bb.13:
	movq	_wined3d_settings@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ORM_FBO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_22
## %bb.14:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_context_validate_onscreen_formats
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_26
## %bb.15:
	movq	(%r12), %rax
	movq	8(%rax), %rdi
	callq	_wined3d_resource_is_offscreen
	testq	%rax, %rax
	je	LBB0_31
## %bb.16:
	movq	16(%r13), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_WINED3DFMT_NULL@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	$16, %edx
	xorl	%r15d, %r15d
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_18 Depth=1
	incq	%r14
	addq	$24, %rdx
	cmpq	%r14, %rcx
	je	LBB0_24
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%r14,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_17
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	movl	24(%rsi), %edi
	movq	16(%r13), %rbx
	movl	%edi, (%rbx,%rdx)
	movq	8(%rsi), %rsi
	movq	%rsi, -8(%rbx,%rdx)
	movq	(%r12,%r14,8), %rsi
	movl	20(%rsi), %edi
	movl	%edi, -12(%rbx,%rdx)
	movl	16(%rsi), %edi
	movl	%edi, -16(%rbx,%rdx)
	movq	(%rsi), %rsi
	cmpq	%rax, (%rsi)
	je	LBB0_17
## %bb.20:                              ##   in Loop: Header=BB0_18 Depth=1
	btsl	%r14d, %r15d
	jmp	LBB0_17
LBB0_21:
	leaq	L_.str(%rip), %rdi
	callq	_WARN
	movq	_FALSE@GOTPCREL(%rip), %rax
	jmp	LBB0_41
LBB0_22:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	movq	%r15, %r14
	je	LBB0_29
LBB0_23:
	movq	(%r12), %rdi
	callq	_wined3d_rendertarget_view_get_surface
	movq	(%rax), %rsi
	jmp	LBB0_30
LBB0_24:
	movq	_GL_FRAMEBUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	16(%r13), %rbx
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_wined3d_rendertarget_view_get_surface
	movq	(%r12), %rcx
	movq	8(%rcx), %rcx
	movl	(%rcx), %r8d
	testq	%r14, %r14
	je	LBB0_27
LBB0_25:
	movq	8(%r14), %rcx
	movl	(%rcx), %r9d
	jmp	LBB0_28
LBB0_26:
	movq	16(%r13), %rdi
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_GL_FRAMEBUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	16(%r13), %rbx
	movq	%r14, %rdi
	callq	_wined3d_rendertarget_view_get_surface
	xorl	%r8d, %r8d
	testq	%r14, %r14
	jne	LBB0_25
LBB0_27:
	xorl	%r9d, %r9d
LBB0_28:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%rbx, %rdx
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movq	%r13, %rdi
	movq	%rax, %rcx
	callq	_context_apply_fbo_state
	jmp	LBB0_32
LBB0_31:
	movq	_GL_FRAMEBUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_WINED3D_LOCATION_DRAWABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r13, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	%r8d, %r9d
	callq	_context_apply_fbo_state
	movq	(%r12), %rax
	movq	8(%rax), %rdi
	callq	_context_generate_rt_mask_from_resource
	movl	%eax, %r15d
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_32:
	movq	_STATE_FRAMEBUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_context_invalidate_state
	jmp	LBB0_33
LBB0_42:
	testl	%edi, %edi
	movq	%r15, %r14
	jne	LBB0_23
LBB0_29:
	xorl	%esi, %esi
LBB0_30:
	movq	%r13, %rdi
	callq	_context_generate_rt_mask_no_fbo
	movl	%eax, %r15d
LBB0_33:
	movq	8(%r13), %rbx
	testq	%rbx, %rbx
	cmoveq	%r13, %rbx
	cmpl	(%rbx), %r15d
	je	LBB0_35
## %bb.34:
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_context_apply_draw_buffers
	movl	%r15d, (%rbx)
	movq	_STATE_FRAMEBUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_context_invalidate_state
LBB0_35:
	movq	_wined3d_settings@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ORM_FBO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_37
## %bb.36:
	movq	_GL_FRAMEBUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_context_check_fbo_status
LBB0_37:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r13)
	movq	_GL_BLEND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	*(%r14)
	movq	_GL_SCISSOR_TEST@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	*8(%r14)
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	je	LBB0_40
## %bb.38:
	movq	16(%r14), %rax
	movq	_ARB_FRAMEBUFFER_SRGB@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_40
## %bb.39:
	movq	%r13, %rdi
	callq	_needs_srgb_write
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	movq	_GL_FRAMEBUFFER_SRGB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	*(%r14,%rcx,8)
	movq	_WINED3D_RS_SRGBWRITEENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_STATE_RENDER
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_context_invalidate_state
LBB0_40:
	leaq	L_.str.1(%rip), %rdi
	callq	_checkGLcall
	movq	_WINED3D_RS_ALPHABLENDENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_STATE_RENDER
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_context_invalidate_state
	movq	_WINED3D_RS_SCISSORTESTENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_STATE_RENDER
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_context_invalidate_state
	movq	_STATE_SCISSORRECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_context_invalidate_state
	movq	_TRUE@GOTPCREL(%rip), %rax
LBB0_41:
	movl	(%rax), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_44:
	xorl	%r15d, %r15d
	jmp	LBB0_33
LBB0_45:
	movl	%edx, %esi
	andl	$-2, %esi
	xorl	%ecx, %ecx
	xorl	%r15d, %r15d
	jmp	LBB0_47
	.p2align	4, 0x90
LBB0_46:                                ##   in Loop: Header=BB0_47 Depth=1
	addq	$2, %rcx
	cmpq	%rcx, %rsi
	je	LBB0_8
LBB0_47:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%rcx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_50
## %bb.48:                              ##   in Loop: Header=BB0_47 Depth=1
	movq	(%rdi), %rdi
	cmpq	%rax, (%rdi)
	je	LBB0_50
## %bb.49:                              ##   in Loop: Header=BB0_47 Depth=1
	btsl	%ecx, %r15d
LBB0_50:                                ##   in Loop: Header=BB0_47 Depth=1
	movq	8(%r12,%rcx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_46
## %bb.51:                              ##   in Loop: Header=BB0_47 Depth=1
	movq	(%rdi), %rdi
	cmpq	%rax, (%rdi)
	je	LBB0_46
## %bb.52:                              ##   in Loop: Header=BB0_47 Depth=1
	leal	1(%rcx), %edi
	btsl	%edi, %r15d
	jmp	LBB0_46
	.cfi_endproc
                                        ## -- End function
	.comm	_STATE_FRAMEBUFFER,4,2          ## @STATE_FRAMEBUFFER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid render target config, need at least one attachment.\n"

	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_wined3d_settings,8,3           ## @wined3d_settings
	.comm	_ORM_FBO,8,3                    ## @ORM_FBO
	.comm	_WINED3DFMT_NULL,8,3            ## @WINED3DFMT_NULL
	.comm	_GL_FRAMEBUFFER,4,2             ## @GL_FRAMEBUFFER
	.comm	_WINED3D_LOCATION_DRAWABLE,4,2  ## @WINED3D_LOCATION_DRAWABLE
	.comm	_GL_BLEND,4,2                   ## @GL_BLEND
	.comm	_GL_SCISSOR_TEST,4,2            ## @GL_SCISSOR_TEST
	.comm	_ARB_FRAMEBUFFER_SRGB,8,3       ## @ARB_FRAMEBUFFER_SRGB
	.comm	_GL_FRAMEBUFFER_SRGB,4,2        ## @GL_FRAMEBUFFER_SRGB
	.comm	_WINED3D_RS_SRGBWRITEENABLE,4,2 ## @WINED3D_RS_SRGBWRITEENABLE
L_.str.1:                               ## @.str.1
	.asciz	"setting up state for clear"

	.comm	_WINED3D_RS_ALPHABLENDENABLE,4,2 ## @WINED3D_RS_ALPHABLENDENABLE
	.comm	_WINED3D_RS_SCISSORTESTENABLE,4,2 ## @WINED3D_RS_SCISSORTESTENABLE
	.comm	_STATE_SCISSORRECT,4,2          ## @STATE_SCISSORRECT
	.comm	_TRUE,4,2                       ## @TRUE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_context_apply_clear_state      ; -- Begin function context_apply_clear_state
	.p2align	2
_context_apply_clear_state:             ; @context_apply_clear_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x3
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	ldp	x25, x23, [x3]
	ldr	x28, [x0, #24]
Lloh0:
	adrp	x26, _STATE_FRAMEBUFFER@GOTPAGE
Lloh1:
	ldr	x26, [x26, _STATE_FRAMEBUFFER@GOTPAGEOFF]
	ldr	w1, [x26]
	bl	_isStateDirty
Lloh2:
	adrp	x27, _wined3d_settings@GOTPAGE
Lloh3:
	ldr	x27, [x27, _wined3d_settings@GOTPAGEOFF]
Lloh4:
	adrp	x24, _ORM_FBO@GOTPAGE
Lloh5:
	ldr	x24, [x24, _ORM_FBO@GOTPAGEOFF]
	cbnz	x0, LBB0_7
; %bb.1:
	ldr	x8, [x21]
	cmp	x8, x20
	b.ne	LBB0_7
; %bb.2:
	ldr	w8, [x28, #24]
	cmp	w8, w22
	b.ne	LBB0_7
; %bb.3:
	ldr	x8, [x27]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_21
; %bb.4:
	cbz	w22, LBB0_41
; %bb.5:
	ldr	x8, [x23]
	ldr	x0, [x8, #8]
	bl	_wined3d_resource_is_offscreen
	cbz	x0, LBB0_22
; %bb.6:
	mov	x8, #0
	mov	w24, #0
Lloh6:
	adrp	x9, _WINED3DFMT_NULL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _WINED3DFMT_NULL@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	mov	w10, w22
	mov	w11, #1
	b	LBB0_17
LBB0_7:
	mov	x0, x22
	mov	x1, x23
	mov	x2, x25
	bl	_have_framebuffer_attachment
	cbz	w0, LBB0_20
; %bb.8:
	ldr	x8, [x27]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_21
; %bb.9:
	mov	x0, x19
	mov	x1, x25
	bl	_context_validate_onscreen_formats
	cbz	w22, LBB0_27
; %bb.10:
	ldr	x8, [x23]
	ldr	x0, [x8, #8]
	bl	_wined3d_resource_is_offscreen
	cbz	x0, LBB0_30
; %bb.11:
	ldr	x0, [x19, #16]
	mov	w26, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	mov	x8, #0
	mov	w24, #0
Lloh9:
	adrp	x9, _WINED3DFMT_NULL@GOTPAGE
Lloh10:
	ldr	x9, [x9, _WINED3DFMT_NULL@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	mov	w10, w22
	mov	w11, #1
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x8, x8, #1
	add	x26, x26, #24
	cmp	x10, x8
	b.eq	LBB0_25
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x23, x8, lsl #3]
	cbz	x12, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w13, [x12, #24]
	ldr	x14, [x19, #16]
	add	x14, x14, x26
	ldr	x12, [x12, #8]
	str	x12, [x14]
	ldr	x12, [x23, x8, lsl #3]
	str	w13, [x14, #8]
	ldr	d0, [x12, #16]
	stur	d0, [x14, #-8]
	ldr	x12, [x12]
	ldr	x12, [x12]
	cmp	x12, x9
	b.eq	LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	lsl	w12, w11, w8
	orr	w24, w12, w24
	b	LBB0_12
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	add	x8, x8, #1
	cmp	x10, x8
	b.eq	LBB0_32
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x23, x8, lsl #3]
	cbz	x12, LBB0_16
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	ldr	x12, [x12]
	ldr	x12, [x12]
	cmp	x12, x9
	b.eq	LBB0_16
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=1
	lsl	w12, w11, w8
	orr	w24, w12, w24
	b	LBB0_16
LBB0_20:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_WARN
Lloh14:
	adrp	x8, _FALSE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
	b	LBB0_40
LBB0_21:
	cbz	w22, LBB0_23
LBB0_22:
	ldr	x0, [x23]
	bl	_wined3d_rendertarget_view_get_surface
	ldr	x1, [x0]
	b	LBB0_24
LBB0_23:
	mov	x1, #0
LBB0_24:
	mov	x0, x19
	bl	_context_generate_rt_mask_no_fbo
	mov	x24, x0
	b	LBB0_32
LBB0_25:
	str	x21, [sp, #8]                   ; 8-byte Folded Spill
	mov	x21, x27
Lloh16:
	adrp	x8, _GL_FRAMEBUFFER@GOTPAGE
Lloh17:
	ldr	x8, [x8, _GL_FRAMEBUFFER@GOTPAGEOFF]
Lloh18:
	ldr	w26, [x8]
	ldr	x27, [x19, #16]
	mov	x0, x25
	bl	_wined3d_rendertarget_view_get_surface
	mov	x3, x0
	ldr	x8, [x23]
	ldr	x8, [x8, #8]
	ldr	w4, [x8]
	cbnz	x25, LBB0_28
LBB0_26:
	mov	w5, #0
	b	LBB0_29
LBB0_27:
	str	x21, [sp, #8]                   ; 8-byte Folded Spill
	mov	x21, x27
	ldr	x0, [x19, #16]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
Lloh19:
	adrp	x8, _GL_FRAMEBUFFER@GOTPAGE
Lloh20:
	ldr	x8, [x8, _GL_FRAMEBUFFER@GOTPAGEOFF]
Lloh21:
	ldr	w26, [x8]
	ldr	x27, [x19, #16]
	mov	x0, x25
	bl	_wined3d_rendertarget_view_get_surface
	mov	x3, x0
	mov	w24, #0
	mov	w4, #0
	cbz	x25, LBB0_26
LBB0_28:
	ldr	x8, [x25, #8]
	ldr	w5, [x8]
LBB0_29:
	mov	x0, x19
	mov	x1, x26
	mov	x2, x27
	bl	_context_apply_fbo_state
Lloh22:
	adrp	x26, _STATE_FRAMEBUFFER@GOTPAGE
Lloh23:
	ldr	x26, [x26, _STATE_FRAMEBUFFER@GOTPAGEOFF]
	mov	x27, x21
	ldr	x21, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_31
LBB0_30:
Lloh24:
	adrp	x8, _GL_FRAMEBUFFER@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GL_FRAMEBUFFER@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x8, _WINED3D_LOCATION_DRAWABLE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _WINED3D_LOCATION_DRAWABLE@GOTPAGEOFF]
Lloh29:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x2, #0
	mov	x3, #0
	mov	x5, x4
	bl	_context_apply_fbo_state
	ldr	x8, [x23]
	ldr	x0, [x8, #8]
	bl	_context_generate_rt_mask_from_resource
	mov	x24, x0
LBB0_31:
	ldr	w1, [x26]
	mov	x0, x19
	bl	_context_invalidate_state
LBB0_32:
	ldr	x8, [x19, #8]
	cmp	x8, #0
	csel	x23, x19, x8, eq
	ldr	w8, [x23]
	cmp	w24, w8
	b.eq	LBB0_34
; %bb.33:
	mov	x0, x19
	mov	x1, x24
	bl	_context_apply_draw_buffers
	str	w24, [x23]
	ldr	w1, [x26]
	mov	x0, x19
	bl	_context_invalidate_state
LBB0_34:
	ldr	x8, [x27]
Lloh30:
	adrp	x9, _ORM_FBO@GOTPAGE
Lloh31:
	ldr	x9, [x9, _ORM_FBO@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_36
; %bb.35:
Lloh33:
	adrp	x8, _GL_FRAMEBUFFER@GOTPAGE
Lloh34:
	ldr	x8, [x8, _GL_FRAMEBUFFER@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_context_check_fbo_status
LBB0_36:
Lloh36:
	adrp	x8, _FALSE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	ldr	x8, [x28]
Lloh39:
	adrp	x9, _GL_BLEND@GOTPAGE
Lloh40:
	ldr	x9, [x9, _GL_BLEND@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x9]
	blr	x8
	ldr	x8, [x28, #8]
Lloh42:
	adrp	x9, _GL_SCISSOR_TEST@GOTPAGE
Lloh43:
	ldr	x9, [x9, _GL_SCISSOR_TEST@GOTPAGEOFF]
Lloh44:
	ldr	w0, [x9]
	blr	x8
	cbz	w22, LBB0_39
; %bb.37:
	ldr	x8, [x28, #16]
Lloh45:
	adrp	x9, _ARB_FRAMEBUFFER_SRGB@GOTPAGE
Lloh46:
	ldr	x9, [x9, _ARB_FRAMEBUFFER_SRGB@GOTPAGEOFF]
Lloh47:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_39
; %bb.38:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_needs_srgb_write
	cmp	x0, #0
	cset	w8, ne
	ldr	x8, [x28, w8, uxtw #3]
Lloh48:
	adrp	x9, _GL_FRAMEBUFFER_SRGB@GOTPAGE
Lloh49:
	ldr	x9, [x9, _GL_FRAMEBUFFER_SRGB@GOTPAGEOFF]
Lloh50:
	ldr	w0, [x9]
	blr	x8
Lloh51:
	adrp	x8, _WINED3D_RS_SRGBWRITEENABLE@GOTPAGE
Lloh52:
	ldr	x8, [x8, _WINED3D_RS_SRGBWRITEENABLE@GOTPAGEOFF]
Lloh53:
	ldr	w0, [x8]
	bl	_STATE_RENDER
	mov	x1, x0
	mov	x0, x19
	bl	_context_invalidate_state
LBB0_39:
Lloh54:
	adrp	x0, l_.str.1@PAGE
Lloh55:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_checkGLcall
Lloh56:
	adrp	x8, _WINED3D_RS_ALPHABLENDENABLE@GOTPAGE
Lloh57:
	ldr	x8, [x8, _WINED3D_RS_ALPHABLENDENABLE@GOTPAGEOFF]
Lloh58:
	ldr	w0, [x8]
	bl	_STATE_RENDER
	mov	x1, x0
	mov	x0, x19
	bl	_context_invalidate_state
Lloh59:
	adrp	x8, _WINED3D_RS_SCISSORTESTENABLE@GOTPAGE
Lloh60:
	ldr	x8, [x8, _WINED3D_RS_SCISSORTESTENABLE@GOTPAGEOFF]
Lloh61:
	ldr	w0, [x8]
	bl	_STATE_RENDER
	mov	x1, x0
	mov	x0, x19
	bl	_context_invalidate_state
Lloh62:
	adrp	x8, _STATE_SCISSORRECT@GOTPAGE
Lloh63:
	ldr	x8, [x8, _STATE_SCISSORRECT@GOTPAGEOFF]
Lloh64:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_context_invalidate_state
Lloh65:
	adrp	x8, _TRUE@GOTPAGE
Lloh66:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
LBB0_40:
	ldr	w0, [x8]
	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
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_41:
	mov	w24, #0
	b	LBB0_32
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGot	Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpAdd	Lloh54, Lloh55
	.cfi_endproc
                                        ; -- End function
	.comm	_STATE_FRAMEBUFFER,4,2          ; @STATE_FRAMEBUFFER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid render target config, need at least one attachment.\n"

	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_wined3d_settings,8,3           ; @wined3d_settings
	.comm	_ORM_FBO,8,3                    ; @ORM_FBO
	.comm	_WINED3DFMT_NULL,8,3            ; @WINED3DFMT_NULL
	.comm	_GL_FRAMEBUFFER,4,2             ; @GL_FRAMEBUFFER
	.comm	_WINED3D_LOCATION_DRAWABLE,4,2  ; @WINED3D_LOCATION_DRAWABLE
	.comm	_GL_BLEND,4,2                   ; @GL_BLEND
	.comm	_GL_SCISSOR_TEST,4,2            ; @GL_SCISSOR_TEST
	.comm	_ARB_FRAMEBUFFER_SRGB,8,3       ; @ARB_FRAMEBUFFER_SRGB
	.comm	_GL_FRAMEBUFFER_SRGB,4,2        ; @GL_FRAMEBUFFER_SRGB
	.comm	_WINED3D_RS_SRGBWRITEENABLE,4,2 ; @WINED3D_RS_SRGBWRITEENABLE
l_.str.1:                               ; @.str.1
	.asciz	"setting up state for clear"

	.comm	_WINED3D_RS_ALPHABLENDENABLE,4,2 ; @WINED3D_RS_ALPHABLENDENABLE
	.comm	_WINED3D_RS_SCISSORTESTENABLE,4,2 ; @WINED3D_RS_SCISSORTESTENABLE
	.comm	_STATE_SCISSORRECT,4,2          ; @STATE_SCISSORRECT
	.comm	_TRUE,4,2                       ; @TRUE
.subsections_via_symbols
