	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CountTriangles                 ## -- Begin function CountTriangles
	.p2align	4, 0x90
_CountTriangles:                        ## @CountTriangles
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_q3_numDrawSurfaces@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	jle	LBB0_1
## %bb.2:
	movq	_q3_drawSurfaces@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	shlq	$2, %rcx
	leaq	(%rcx,%rcx,2), %r8
	xorl	%edx, %edx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	addl	%edi, %esi
	addq	$12, %rdx
	cmpq	%rdx, %r8
	je	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%rax,%rdx), %rcx
	imulq	$1431655766, %rcx, %rdi         ## imm = 0x55555556
	movq	%rdi, %rcx
	shrq	$63, %rcx
	shrq	$32, %rdi
	addl	%ecx, %edi
	movl	4(%rax,%rdx), %ecx
	testl	%ecx, %ecx
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	imull	8(%rax,%rdx), %ecx
	leal	(%rbx,%rcx,2), %ebx
	jmp	LBB0_5
LBB0_1:
	xorl	%esi, %esi
	xorl	%ebx, %ebx
LBB0_6:
	leaq	L_.str(%rip), %rdi
	callq	_Log_Print
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_Log_Print                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_q3_numDrawSurfaces,4,2         ## @q3_numDrawSurfaces
	.comm	_q3_drawSurfaces,8,3            ## @q3_drawSurfaces
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%6d triangles\n"

L_.str.1:                               ## @.str.1
	.asciz	"%6d patch tris\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CountTriangles                 ; -- Begin function CountTriangles
	.p2align	2
_CountTriangles:                        ; @CountTriangles
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _q3_numDrawSurfaces@GOTPAGE
Lloh1:
	ldr	x8, [x8, _q3_numDrawSurfaces@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	mov	w19, #0
	mov	w1, #0
Lloh3:
	adrp	x9, _q3_drawSurfaces@GOTPAGE
Lloh4:
	ldr	x9, [x9, _q3_drawSurfaces@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x9, x9, #4
	mov	w10, #21846
	movk	w10, #21845, lsl #16
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldursw	x11, [x9, #-4]
	mul	x11, x11, x10
	lsr	x12, x11, #63
	lsr	x11, x11, #32
	add	w11, w11, w12
	add	w1, w11, w1
	add	x9, x9, #12
	subs	x8, x8, #1
	b.eq	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9]
	cbz	w11, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w12, [x9, #4]
	mul	w11, w11, w12
	add	w19, w19, w11, lsl #1
	b	LBB0_2
LBB0_5:
	mov	w1, #0
	mov	w19, #0
LBB0_6:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Log_Print
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_Log_Print
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_q3_numDrawSurfaces,4,2         ; @q3_numDrawSurfaces
	.comm	_q3_drawSurfaces,8,3            ; @q3_drawSurfaces
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%6d triangles\n"

l_.str.1:                               ; @.str.1
	.asciz	"%6d patch tris\n"

.subsections_via_symbols
