	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shader_glsl_generate_clip_or_cull_distances
_shader_glsl_generate_clip_or_cull_distances: ## @shader_glsl_generate_clip_or_cull_distances
	.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	%rsi, %rbx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rax
	movq	_WINED3D_SV_CLIP_DISTANCE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	leaq	L_.str(%rip), %rax
	leaq	L_.str.1(%rip), %r15
	cmoveq	%rax, %r15
	cmpq	$0, 16(%rsi)
	je	LBB0_1
## %bb.2:
	andl	$15, %edx
	movl	%edx, %edi
	callq	_wined3d_popcount
	movl	%eax, %r12d
	jmp	LBB0_3
LBB0_1:
	xorl	%r12d, %r12d
LBB0_3:
	movl	8(%rbx), %ecx
	movq	_WINED3DSP_WRITEMASK_0@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	testl	%ecx, %edi
	je	LBB0_5
## %bb.4:
	leaq	-46(%rbp), %r13
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r13, %rsi
	callq	_shader_glsl_write_mask_to_str
	movl	12(%rbx), %r8d
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rdx
	movl	%r12d, %ecx
	movq	%r13, %r9
	callq	_shader_addline
	movq	_WINED3DSP_WRITEMASK_0@GOTPCREL(%rip), %r14
	incl	%r12d
	movl	8(%rbx), %ecx
	movl	(%r14), %edi
LBB0_5:
	leal	(%rdi,%rdi), %eax
	testl	%ecx, %eax
	je	LBB0_7
## %bb.6:
	leaq	-46(%rbp), %r13
	movl	%eax, %edi
	movq	%r13, %rsi
	callq	_shader_glsl_write_mask_to_str
	movl	12(%rbx), %r8d
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rdx
	movl	%r12d, %ecx
	movq	%r13, %r9
	callq	_shader_addline
	incl	%r12d
	movl	8(%rbx), %ecx
	movl	(%r14), %edi
LBB0_7:
	leal	(,%rdi,4), %eax
	testl	%ecx, %eax
	je	LBB0_9
## %bb.8:
	leaq	-46(%rbp), %r13
	movl	%eax, %edi
	movq	%r13, %rsi
	callq	_shader_glsl_write_mask_to_str
	movl	12(%rbx), %r8d
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rdx
	movl	%r12d, %ecx
	movq	%r13, %r9
	callq	_shader_addline
	incl	%r12d
	movl	8(%rbx), %ecx
	movl	(%r14), %edi
LBB0_9:
	shll	$3, %edi
	testl	%ecx, %edi
	je	LBB0_11
## %bb.10:
	leaq	-46(%rbp), %r13
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r13, %rsi
	callq	_shader_glsl_write_mask_to_str
	movl	12(%rbx), %r8d
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rdx
	movl	%r12d, %ecx
	movq	%r13, %r9
	callq	_shader_addline
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WINED3D_SV_CLIP_DISTANCE,8,3   ## @WINED3D_SV_CLIP_DISTANCE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Clip"

L_.str.1:                               ## @.str.1
	.asciz	"Cull"

	.comm	_WINED3DSP_WRITEMASK_0,4,2      ## @WINED3DSP_WRITEMASK_0
L_.str.2:                               ## @.str.2
	.asciz	"gl_%sDistance[%u] = outputs[%u]%s;\n"

	.no_dead_strip	_shader_glsl_generate_clip_or_cull_distances
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function shader_glsl_generate_clip_or_cull_distances
_shader_glsl_generate_clip_or_cull_distances: ; @shader_glsl_generate_clip_or_cull_distances
	.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	x21, x1
	mov	x19, x0
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _WINED3D_SV_CLIP_DISTANCE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WINED3D_SV_CLIP_DISTANCE@GOTPAGEOFF]
Lloh2:
	adrp	x10, l_.str.1@PAGE
Lloh3:
	add	x10, x10, l_.str.1@PAGEOFF
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x11, l_.str@PAGE
Lloh6:
	add	x11, x11, l_.str@PAGEOFF
	cmp	x8, x9
	csel	x20, x11, x10, eq
	ldr	x8, [x1, #16]
	cbz	x8, LBB0_2
; %bb.1:
	and	w0, w2, #0xf
	bl	_wined3d_popcount
	mov	x22, x0
	b	LBB0_3
LBB0_2:
	mov	w22, #0
LBB0_3:
	ldr	w9, [x21, #8]
Lloh7:
	adrp	x23, _WINED3DSP_WRITEMASK_0@GOTPAGE
Lloh8:
	ldr	x23, [x23, _WINED3DSP_WRITEMASK_0@GOTPAGEOFF]
	ldr	w0, [x23]
	tst	w0, w9
	b.eq	LBB0_5
; %bb.4:
	add	x1, sp, #10
	bl	_shader_glsl_write_mask_to_str
	ldr	w4, [x21, #12]
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x5, sp, #10
	mov	x0, x19
	mov	x2, x20
	mov	x3, x22
	bl	_shader_addline
	add	w22, w22, #1
	ldr	w9, [x21, #8]
	ldr	w0, [x23]
LBB0_5:
	lsl	w8, w0, #1
	tst	w8, w9
	b.eq	LBB0_7
; %bb.6:
	add	x1, sp, #10
	mov	x0, x8
	bl	_shader_glsl_write_mask_to_str
	ldr	w4, [x21, #12]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x5, sp, #10
	mov	x0, x19
	mov	x2, x20
	mov	x3, x22
	bl	_shader_addline
	add	w22, w22, #1
	ldr	w9, [x21, #8]
	ldr	w0, [x23]
LBB0_7:
	lsl	w8, w0, #2
	tst	w8, w9
	b.eq	LBB0_9
; %bb.8:
	add	x1, sp, #10
	mov	x0, x8
	bl	_shader_glsl_write_mask_to_str
	ldr	w4, [x21, #12]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x5, sp, #10
	mov	x0, x19
	mov	x2, x20
	mov	x3, x22
	bl	_shader_addline
	add	w22, w22, #1
	ldr	w9, [x21, #8]
	ldr	w0, [x23]
LBB0_9:
	lsl	w0, w0, #3
	tst	w0, w9
	b.eq	LBB0_11
; %bb.10:
	add	x1, sp, #10
	bl	_shader_glsl_write_mask_to_str
	ldr	w4, [x21, #12]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x5, sp, #10
	mov	x0, x19
	mov	x2, x20
	mov	x3, x22
	bl	_shader_addline
LBB0_11:
	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
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_WINED3D_SV_CLIP_DISTANCE,8,3   ; @WINED3D_SV_CLIP_DISTANCE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Clip"

l_.str.1:                               ; @.str.1
	.asciz	"Cull"

	.comm	_WINED3DSP_WRITEMASK_0,4,2      ; @WINED3DSP_WRITEMASK_0
l_.str.2:                               ; @.str.2
	.asciz	"gl_%sDistance[%u] = outputs[%u]%s;\n"

	.no_dead_strip	_shader_glsl_generate_clip_or_cull_distances
.subsections_via_symbols
