	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_TH_CreateAASFaceTriangles      ## -- Begin function TH_CreateAASFaceTriangles
	.p2align	4, 0x90
_TH_CreateAASFaceTriangles:             ## @TH_CreateAASFaceTriangles
	.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, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	$0, -72(%rbp)
	movl	(%rdi), %ecx
	testl	%ecx, %ecx
	jle	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r15), %ecx
	movl	%r14d, %ebx
	cmpl	%ecx, %r14d
	jge	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%rcx,%rbx), %eax
	addl	$-2, %eax
	cltd
	idivl	%ecx
	movq	%r15, %rdi
	movl	%edx, %esi
	callq	_TH_AASFaceVertex
	movl	(%r15), %ecx
	leal	(%rbx,%rcx), %eax
	decl	%eax
	cltd
	idivl	%ecx
	movq	%r15, %rdi
	movl	%edx, %esi
	callq	_TH_AASFaceVertex
	movl	%ebx, %eax
	cltd
	idivl	(%r15)
	movq	%r15, %rdi
	movl	%edx, %esi
	callq	_TH_AASFaceVertex
	callq	_TH_Colinear
	leal	1(%rbx), %r14d
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, %eax
	cltd
	idivl	(%r15)
	movq	%r15, %rdi
	movl	%edx, %esi
	callq	_TH_AASFaceVertex
	leal	2(%rbx), %eax
	cltd
	idivl	(%r15)
	movq	%r15, %rdi
	movl	%edx, %esi
	callq	_TH_AASFaceVertex
	callq	_TH_Colinear
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movl	(%r15), %ecx
	movl	%ebx, %r14d
	jmp	LBB0_7
LBB0_1:
	xorl	%r14d, %r14d
LBB0_7:
	movq	%r15, %rdi
	cmpl	%ecx, %r14d
	jge	LBB0_11
## %bb.8:
	movl	%r14d, %esi
	callq	_TH_AASFaceVertex
	callq	_TH_FindOrCreateVertex
	movl	%eax, -60(%rbp)
	movl	(%r15), %ecx
	cmpl	$3, %ecx
	jl	LBB0_16
## %bb.9:
	movl	$1, %ebx
	movq	_thworld@GOTPCREL(%rip), %r12
	leaq	-72(%rbp), %r13
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	leal	(%r14,%rbx), %eax
	cltd
	idivl	%ecx
	movq	%r15, %rdi
	movl	%edx, %esi
	callq	_TH_AASFaceVertex
	leal	(%r14,%rbx), %eax
	incl	%eax
	cltd
	idivl	(%r15)
	movq	%r15, %rdi
	movl	%edx, %esi
	callq	_TH_AASFaceVertex
	callq	_TH_FindOrCreateVertex
	movl	%eax, -56(%rbp)
	callq	_TH_FindOrCreateVertex
	movl	%eax, -52(%rbp)
	leaq	-60(%rbp), %rdi
	callq	_TH_CreateTriangle
	movq	(%r12), %rcx
	cltq
	leaq	(%rcx,%rax,4), %rsi
	movl	$-1, (%rcx,%rax,4)
	movq	%r13, %rdi
	callq	_TH_AddTriangleToList
	incl	%ebx
	movl	(%r15), %ecx
	leal	-1(%rcx), %eax
	cmpl	%eax, %ebx
	jl	LBB0_10
	jmp	LBB0_16
LBB0_11:
	callq	_TH_FaceCenter
	callq	_TH_FindOrCreateVertex
	movl	%eax, -60(%rbp)
	movl	(%r15), %ecx
	testl	%ecx, %ecx
	jle	LBB0_16
## %bb.12:
	xorl	%ebx, %ebx
	leaq	-60(%rbp), %r14
	movq	_thworld@GOTPCREL(%rip), %r13
	leaq	-72(%rbp), %r12
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	(%r15), %ecx
	cmpl	%ecx, %ebx
	jge	LBB0_16
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movq	%r15, %rdi
	movl	%edx, %esi
	callq	_TH_AASFaceVertex
	incl	%ebx
	movl	%ebx, %eax
	cltd
	idivl	(%r15)
	movq	%r15, %rdi
	movl	%edx, %esi
	callq	_TH_AASFaceVertex
	callq	_TH_Colinear
	testq	%rax, %rax
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	callq	_TH_FindOrCreateVertex
	movl	%eax, -56(%rbp)
	callq	_TH_FindOrCreateVertex
	movl	%eax, -52(%rbp)
	movq	%r14, %rdi
	callq	_TH_CreateTriangle
	movq	(%r13), %rcx
	cltq
	leaq	(%rcx,%rax,4), %rsi
	movl	$-1, (%rcx,%rax,4)
	movq	%r12, %rdi
	callq	_TH_AddTriangleToList
	jmp	LBB0_15
LBB0_16:
	movq	-72(%rbp), %rax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_18
## %bb.17:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_thworld,8,3                    ## @thworld
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_TH_CreateAASFaceTriangles      ; -- Begin function TH_CreateAASFaceTriangles
	.p2align	2
_TH_CreateAASFaceTriangles:             ; @TH_CreateAASFaceTriangles
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	str	xzr, [sp]
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w21, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x19]
	mov	x21, x20
	cmp	w20, w8
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	w9, w8, w21
	sub	w9, w9, #2
	sdiv	w10, w9, w8
	msub	w1, w10, w8, w9
	mov	x0, x19
	bl	_TH_AASFaceVertex
	ldr	w8, [x19]
	add	w9, w21, w8
	sub	w9, w9, #1
	sdiv	w10, w9, w8
	msub	w1, w10, w8, w9
	mov	x0, x19
	bl	_TH_AASFaceVertex
	ldr	w8, [x19]
	sdiv	w9, w21, w8
	msub	w1, w9, w8, w21
	mov	x0, x19
	bl	_TH_AASFaceVertex
	bl	_TH_Colinear
	add	w20, w21, #1
	cbnz	x0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x19]
	sdiv	w9, w20, w8
	msub	w1, w9, w8, w20
	mov	x0, x19
	bl	_TH_AASFaceVertex
	add	w8, w21, #2
	ldr	w9, [x19]
	sdiv	w10, w8, w9
	msub	w1, w10, w9, w8
	mov	x0, x19
	bl	_TH_AASFaceVertex
	bl	_TH_Colinear
	cbnz	x0, LBB0_2
; %bb.5:
	ldr	w8, [x19]
	mov	x20, x21
	b	LBB0_7
LBB0_6:
	mov	w20, #0
LBB0_7:
	mov	x0, x19
	cmp	w20, w8
	b.ge	LBB0_11
; %bb.8:
	mov	x1, x20
	bl	_TH_AASFaceVertex
	bl	_TH_FindOrCreateVertex
	str	w0, [sp, #12]
	ldr	w8, [x19]
	cmp	w8, #3
	b.lt	LBB0_16
; %bb.9:
	mov	w21, #1
Lloh3:
	adrp	x22, _thworld@GOTPAGE
Lloh4:
	ldr	x22, [x22, _thworld@GOTPAGEOFF]
	mov	w23, #-1
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	add	w24, w20, w21
	sdiv	w9, w24, w8
	msub	w1, w9, w8, w24
	mov	x0, x19
	bl	_TH_AASFaceVertex
	add	w8, w24, #1
	ldr	w9, [x19]
	sdiv	w10, w8, w9
	msub	w1, w10, w9, w8
	mov	x0, x19
	bl	_TH_AASFaceVertex
	bl	_TH_FindOrCreateVertex
	str	w0, [sp, #16]
	bl	_TH_FindOrCreateVertex
	str	w0, [sp, #20]
	add	x0, sp, #12
	bl	_TH_CreateTriangle
	ldr	x8, [x22]
	add	x1, x8, w0, sxtw #2
	str	w23, [x1]
	mov	x0, sp
	bl	_TH_AddTriangleToList
	add	w21, w21, #1
	ldr	w8, [x19]
	sub	w9, w8, #1
	cmp	w21, w9
	b.lt	LBB0_10
	b	LBB0_16
LBB0_11:
	bl	_TH_FaceCenter
	bl	_TH_FindOrCreateVertex
	str	w0, [sp, #12]
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.12:
	mov	w20, #0
Lloh5:
	adrp	x21, _thworld@GOTPAGE
Lloh6:
	ldr	x21, [x21, _thworld@GOTPAGEOFF]
	mov	w22, #-1
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x19]
	cmp	w20, w8
	b.ge	LBB0_16
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	sdiv	w9, w20, w8
	msub	w1, w9, w8, w20
	mov	x0, x19
	bl	_TH_AASFaceVertex
	add	w20, w20, #1
	ldr	w8, [x19]
	sdiv	w9, w20, w8
	msub	w1, w9, w8, w20
	mov	x0, x19
	bl	_TH_AASFaceVertex
	bl	_TH_Colinear
	cbnz	x0, LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	bl	_TH_FindOrCreateVertex
	str	w0, [sp, #16]
	bl	_TH_FindOrCreateVertex
	str	w0, [sp, #20]
	add	x0, sp, #12
	bl	_TH_CreateTriangle
	ldr	x8, [x21]
	add	x1, x8, w0, sxtw #2
	str	w22, [x1]
	mov	x0, sp
	bl	_TH_AddTriangleToList
	b	LBB0_13
LBB0_16:
	ldr	x0, [sp]
	ldr	x8, [sp, #24]
Lloh7:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh8:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.17:
	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
	add	sp, sp, #96
	ret
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_thworld,8,3                    ; @thworld
.subsections_via_symbols
