	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vc4_rcl_render_config_surface_setup
_vc4_rcl_render_config_surface_setup:   ## @vc4_rcl_render_config_surface_setup
	.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
	movq	%rcx, %rbx
	movq	%rdx, %r13
	movq	%rdi, %r14
	movl	(%rcx), %edi
	movq	_VC4_RENDER_CONFIG_MEMORY_FORMAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_VC4_GET_FIELD
	movq	%rax, %r15
	movl	(%rbx), %edi
	movq	_VC4_RENDER_CONFIG_FORMAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_VC4_GET_FIELD
	cmpq	$0, 8(%rbx)
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
LBB0_2:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	jmp	LBB0_5
LBB0_3:
	movq	%rax, %r12
	movl	(%rbx), %esi
	movq	_VC4_RENDER_CONFIG_MEMORY_FORMAT_MASK@GOTPCREL(%rip), %rax
	movq	_VC4_RENDER_CONFIG_FORMAT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_VC4_RENDER_CONFIG_MS_MODE_4X@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_VC4_RENDER_CONFIG_DECIMATE_MODE_4X@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	notl	%ecx
	testl	%ecx, %esi
	je	LBB0_8
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_DRM_DEBUG
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_6:
	subl	(%rax), %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movl	20(%rbx), %esi
	xorl	%r15d, %r15d
	cmpl	$-1, %esi
	je	LBB0_7
## %bb.9:
	movq	%r14, %rdi
	callq	_vc4_use_bo
	movq	%rax, (%r13)
	testq	%rax, %rax
	je	LBB0_14
## %bb.10:
	movq	16(%r14), %rcx
	movslq	8(%r14), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%r14)
	movq	%rax, (%rcx,%rdx,8)
	movq	_VC4_TILING_FORMAT_LT@GOTPCREL(%rip), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	(%rax), %rcx
	jle	LBB0_12
## %bb.11:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_12:
	leaq	-128(%r12), %rax
	cmpq	$3, %rax
	jae	LBB0_15
## %bb.13:
	leaq	l_switch.table.vc4_rcl_render_config_surface_setup(%rip), %rax
	movl	-512(%rax,%r12,4), %eax
	movq	(%r13), %rsi
	movl	16(%rbx), %edx
	movq	(%r14), %rcx
	movl	(%rcx), %r9d
	movl	4(%rcx), %r8d
	movl	%eax, (%rsp)
	movq	%r14, %rdi
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_vc4_check_tex_size
	testl	%eax, %eax
	jne	LBB0_7
LBB0_14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	jmp	LBB0_6
LBB0_15:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_VC4_RENDER_CONFIG_MEMORY_FORMAT,4,2 ## @VC4_RENDER_CONFIG_MEMORY_FORMAT
	.comm	_VC4_RENDER_CONFIG_FORMAT,4,2   ## @VC4_RENDER_CONFIG_FORMAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No flags supported on render config.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VC4_RENDER_CONFIG_MEMORY_FORMAT_MASK,4,2 ## @VC4_RENDER_CONFIG_MEMORY_FORMAT_MASK
	.comm	_VC4_RENDER_CONFIG_FORMAT_MASK,4,2 ## @VC4_RENDER_CONFIG_FORMAT_MASK
	.comm	_VC4_RENDER_CONFIG_MS_MODE_4X,4,2 ## @VC4_RENDER_CONFIG_MS_MODE_4X
	.comm	_VC4_RENDER_CONFIG_DECIMATE_MODE_4X,4,2 ## @VC4_RENDER_CONFIG_DECIMATE_MODE_4X
L_.str.1:                               ## @.str.1
	.asciz	"Unknown bits in render config: 0x%04x\n"

	.comm	_VC4_TILING_FORMAT_LT,8,3       ## @VC4_TILING_FORMAT_LT
L_.str.2:                               ## @.str.2
	.asciz	"Bad tiling format\n"

L_.str.3:                               ## @.str.3
	.asciz	"Bad tile buffer format\n"

	.no_dead_strip	_vc4_rcl_render_config_surface_setup
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.vc4_rcl_render_config_surface_setup
l_switch.table.vc4_rcl_render_config_surface_setup:
	.long	4                               ## 0x4
	.long	2                               ## 0x2
	.long	2                               ## 0x2

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vc4_rcl_render_config_surface_setup
_vc4_rcl_render_config_surface_setup:   ; @vc4_rcl_render_config_surface_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x3
	mov	x21, x2
	mov	x19, x0
	ldr	w0, [x3]
Lloh0:
	adrp	x8, _VC4_RENDER_CONFIG_MEMORY_FORMAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VC4_RENDER_CONFIG_MEMORY_FORMAT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_VC4_GET_FIELD
	mov	x22, x0
	ldr	w0, [x20]
Lloh3:
	adrp	x8, _VC4_RENDER_CONFIG_FORMAT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VC4_RENDER_CONFIG_FORMAT@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_VC4_GET_FIELD
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	ldr	w8, [x20]
Lloh8:
	adrp	x9, _VC4_RENDER_CONFIG_MEMORY_FORMAT_MASK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _VC4_RENDER_CONFIG_MEMORY_FORMAT_MASK@GOTPAGEOFF]
Lloh10:
	adrp	x10, _VC4_RENDER_CONFIG_FORMAT_MASK@GOTPAGE
Lloh11:
	ldr	x10, [x10, _VC4_RENDER_CONFIG_FORMAT_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh14:
	adrp	x10, _VC4_RENDER_CONFIG_MS_MODE_4X@GOTPAGE
Lloh15:
	ldr	x10, [x10, _VC4_RENDER_CONFIG_MS_MODE_4X@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	orr	w9, w9, w10
Lloh17:
	adrp	x10, _VC4_RENDER_CONFIG_DECIMATE_MODE_4X@GOTPAGE
Lloh18:
	ldr	x10, [x10, _VC4_RENDER_CONFIG_DECIMATE_MODE_4X@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	orr	w9, w9, w10
	bics	wzr, w8, w9
	b.eq	LBB0_7
; %bb.3:
	str	x8, [sp]
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_4:
	bl	_DRM_DEBUG
LBB0_5:
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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
	add	sp, sp, #80
	ret
LBB0_7:
	ldr	w1, [x20, #20]
	cmn	w1, #1
	b.eq	LBB0_13
; %bb.8:
	mov	x23, x0
	mov	x0, x19
	bl	_vc4_use_bo
	str	x0, [x21]
	cbz	x0, LBB0_5
; %bb.9:
	ldr	x8, [x19, #16]
	ldrsw	x9, [x19, #8]
	add	w10, w9, #1
	str	w10, [x19, #8]
	str	x0, [x8, x9, lsl #3]
Lloh25:
	adrp	x8, _VC4_TILING_FORMAT_LT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _VC4_TILING_FORMAT_LT@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	cmp	x22, x8
	b.le	LBB0_11
; %bb.10:
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_11:
	sub	x8, x23, #128
	cmp	x8, #3
	b.hs	LBB0_14
; %bb.12:
Lloh30:
	adrp	x9, l_switch.table.vc4_rcl_render_config_surface_setup@PAGE
Lloh31:
	add	x9, x9, l_switch.table.vc4_rcl_render_config_surface_setup@PAGEOFF
	ldr	w6, [x9, x8, lsl #2]
	ldr	x1, [x21]
	ldr	w2, [x20, #16]
	ldr	x8, [x19]
	ldp	w5, w4, [x8]
	mov	x0, x19
	mov	x3, x22
	bl	_vc4_check_tex_size
	cbz	w0, LBB0_5
LBB0_13:
	mov	w0, #0
	b	LBB0_6
LBB0_14:
Lloh32:
	adrp	x0, l_.str.3@PAGE
Lloh33:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_VC4_RENDER_CONFIG_MEMORY_FORMAT,4,2 ; @VC4_RENDER_CONFIG_MEMORY_FORMAT
	.comm	_VC4_RENDER_CONFIG_FORMAT,4,2   ; @VC4_RENDER_CONFIG_FORMAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No flags supported on render config.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VC4_RENDER_CONFIG_MEMORY_FORMAT_MASK,4,2 ; @VC4_RENDER_CONFIG_MEMORY_FORMAT_MASK
	.comm	_VC4_RENDER_CONFIG_FORMAT_MASK,4,2 ; @VC4_RENDER_CONFIG_FORMAT_MASK
	.comm	_VC4_RENDER_CONFIG_MS_MODE_4X,4,2 ; @VC4_RENDER_CONFIG_MS_MODE_4X
	.comm	_VC4_RENDER_CONFIG_DECIMATE_MODE_4X,4,2 ; @VC4_RENDER_CONFIG_DECIMATE_MODE_4X
l_.str.1:                               ; @.str.1
	.asciz	"Unknown bits in render config: 0x%04x\n"

	.comm	_VC4_TILING_FORMAT_LT,8,3       ; @VC4_TILING_FORMAT_LT
l_.str.2:                               ; @.str.2
	.asciz	"Bad tiling format\n"

l_.str.3:                               ; @.str.3
	.asciz	"Bad tile buffer format\n"

	.no_dead_strip	_vc4_rcl_render_config_surface_setup
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.vc4_rcl_render_config_surface_setup
l_switch.table.vc4_rcl_render_config_surface_setup:
	.long	4                               ; 0x4
	.long	2                               ; 0x2
	.long	2                               ; 0x2

.subsections_via_symbols
