	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MakeTerrainIntoBrushes         ## -- Begin function MakeTerrainIntoBrushes
	.p2align	4, 0x90
_MakeTerrainIntoBrushes:                ## @MakeTerrainIntoBrushes
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_ShaderInfoForShader
	movl	(%rbx), %r8d
	cmpl	$2, %r8d
	jl	LBB0_7
## %bb.1:
	movq	8(%rbx), %r12
	movl	4(%rbx), %edx
	movl	$1, %edi
	xorl	%esi, %esi
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	leal	-1(%r8), %ecx
	incl	%edi
	movq	%r9, %rsi
	cmpl	%ecx, %r9d
	jge	LBB0_7
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	leaq	1(%rsi), %r9
	cmpl	$2, %edx
	jl	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r14d, %r14d
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%r9, -80(%rbp)                  ## 8-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	(%rsi,%r14), %ecx
	movl	%edx, %eax
	imull	%esi, %eax
	leal	(%r14,%rax), %esi
	movl	%edi, %ebx
	imull	%edx, %ebx
	imull	%r9d, %edx
	leal	(%r14,%rbx), %edi
	testb	$1, %cl
	leal	1(%r14,%rax), %ecx
	cmovel	%eax, %edx
	cmovel	%edi, %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	leal	1(%r14,%rbx), %r13d
	cmovnel	%esi, %r13d
	movslq	%eax, %rcx
	addq	%r14, %rcx
	movl	(%r12,%rcx,4), %edi
	movslq	%ebx, %rcx
	addq	%r14, %rcx
	movl	(%r12,%rcx,4), %esi
	movslq	%edx, %rbx
	addq	%r14, %rbx
	movl	4(%r12,%rbx,4), %edx
	movq	%r15, %rcx
	callq	_MakeBrushFromTriangle
	movl	4(%r12,%rbx,4), %edi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movslq	-48(%rbp), %rax                 ## 4-byte Folded Reload
	movl	(%r12,%rax,4), %esi
	movslq	%r13d, %rax
	movl	(%r12,%rax,4), %edx
	movq	%r15, %rcx
	callq	_MakeBrushFromTriangle
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	4(%rbx), %edx
	leal	-1(%rdx), %ecx
	incq	%r14
	cmpl	%ecx, %r14d
	jl	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rbx), %r8d
	jmp	LBB0_6
LBB0_7:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"textures/common/terrain"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MakeTerrainIntoBrushes         ; -- Begin function MakeTerrainIntoBrushes
	.p2align	2
_MakeTerrainIntoBrushes:                ; @MakeTerrainIntoBrushes
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ShaderInfoForShader
	ldr	w9, [x19]
	cmp	w9, #2
	b.lt	LBB0_7
; %bb.1:
	mov	x20, x0
	mov	x23, #0
	ldr	x21, [x19, #8]
	ldr	w8, [x19, #4]
	mov	w22, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	sub	w10, w9, #1
	add	w22, w22, #1
	mov	x23, x24
	cmp	w24, w10
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	add	x24, x23, #1
	cmp	w8, #2
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x25, #0
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w9, w23, w25
	mul	w10, w8, w23
	add	w11, w25, w10
	mul	w12, w8, w24
	mul	w8, w22, w8
	add	w13, w25, w8
	tst	w9, #0x1
	csel	w9, w10, w12, eq
	csinc	w26, w13, w11, eq
	csinc	w27, w11, w13, ne
	add	x10, x25, w10, sxtw
	ldr	w0, [x21, x10, lsl #2]
	add	x8, x25, w8, sxtw
	ldr	w1, [x21, x8, lsl #2]
	add	x8, x25, w9, sxtw
	add	x28, x21, x8, lsl #2
	ldr	w2, [x28, #4]
	mov	x3, x20
	bl	_MakeBrushFromTriangle
	ldr	w0, [x28, #4]
	ldr	w1, [x21, w26, sxtw #2]
	ldr	w2, [x21, w27, sxtw #2]
	mov	x3, x20
	bl	_MakeBrushFromTriangle
	ldr	w8, [x19, #4]
	sub	w9, w8, #1
	add	x25, x25, #1
	cmp	w25, w9
	b.lt	LBB0_5
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x19]
	b	LBB0_2
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"textures/common/terrain"

.subsections_via_symbols
