	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Load3DSTriangleList            ## -- Begin function Load3DSTriangleList
	.p2align	4, 0x90
_Load3DSTriangleList:                   ## @Load3DSTriangleList
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_bytesread@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_level@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_numtris@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_totaltris@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movq	_vertsfound@GOTPCREL(%rip), %r13
	movq	$0, (%r13)
	movq	_trisfound@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %rbx
	leaq	-42(%rbp), %rdi
	movl	$2, %esi
	movl	$1, %edx
	movq	%rax, %rcx
	callq	_fread
	movzwl	-42(%rbp), %eax
	movq	_MAIN3DS@GOTPCREL(%rip), %rcx
	cmpw	(%rcx), %ax
	je	LBB0_3
## %bb.2:
	movq	_EDIT3DS@GOTPCREL(%rip), %rcx
	cmpw	(%rcx), %ax
	jne	LBB0_7
LBB0_3:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	_MAXTRIANGLES@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$2, %edi
	callq	_malloc
	movq	_ptri@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	%rax, (%r15)
	movq	%rbx, %rdi
	callq	_ParseChunk
	movq	(%r13), %rax
	movq	_trisfound@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.3(%rip), %rdi
	callq	_Error
LBB0_5:
	movq	_totaltris@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fclose                         ## TAILCALL
LBB0_6:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_fprintf
	xorl	%edi, %edi
	callq	_exit
LBB0_7:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	xorl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_bytesread,8,3                  ## @bytesread
	.comm	_level,8,3                      ## @level
	.comm	_numtris,8,3                    ## @numtris
	.comm	_totaltris,4,2                  ## @totaltris
	.comm	_vertsfound,8,3                 ## @vertsfound
	.comm	_trisfound,8,3                  ## @trisfound
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rb"

	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"reader: could not open file '%s'\n"

	.comm	_MAIN3DS,2,1                    ## @MAIN3DS
	.comm	_EDIT3DS,2,1                    ## @EDIT3DS
L_.str.2:                               ## @.str.2
	.asciz	"File is not a 3DS file.\n"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_MAXTRIANGLES,4,2               ## @MAXTRIANGLES
	.comm	_ptri,8,3                       ## @ptri
L_.str.3:                               ## @.str.3
	.asciz	"Incomplete triangle set"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Load3DSTriangleList            ; -- Begin function Load3DSTriangleList
	.p2align	2
_Load3DSTriangleList:                   ; @Load3DSTriangleList
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _bytesread@GOTPAGE
Lloh1:
	ldr	x8, [x8, _bytesread@GOTPAGEOFF]
Lloh2:
	str	xzr, [x8]
Lloh3:
	adrp	x8, _level@GOTPAGE
Lloh4:
	ldr	x8, [x8, _level@GOTPAGEOFF]
Lloh5:
	str	xzr, [x8]
Lloh6:
	adrp	x8, _numtris@GOTPAGE
Lloh7:
	ldr	x8, [x8, _numtris@GOTPAGEOFF]
Lloh8:
	str	xzr, [x8]
Lloh9:
	adrp	x23, _totaltris@GOTPAGE
Lloh10:
	ldr	x23, [x23, _totaltris@GOTPAGEOFF]
	str	wzr, [x23]
Lloh11:
	adrp	x24, _vertsfound@GOTPAGE
Lloh12:
	ldr	x24, [x24, _vertsfound@GOTPAGEOFF]
	str	xzr, [x24]
Lloh13:
	adrp	x25, _trisfound@GOTPAGE
Lloh14:
	ldr	x25, [x25, _trisfound@GOTPAGEOFF]
	str	xzr, [x25]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_5
; %bb.1:
	mov	x21, x0
	add	x0, sp, #14
	mov	w1, #2
	mov	w2, #1
	mov	x3, x21
	bl	_fread
	ldrh	w8, [sp, #14]
Lloh17:
	adrp	x9, _MAIN3DS@GOTPAGE
Lloh18:
	ldr	x9, [x9, _MAIN3DS@GOTPAGEOFF]
	ldrh	w9, [x9]
Lloh19:
	adrp	x10, _EDIT3DS@GOTPAGE
Lloh20:
	ldr	x10, [x10, _EDIT3DS@GOTPAGEOFF]
	ldrh	w10, [x10]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.ne	LBB0_6
; %bb.2:
Lloh21:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w1, #0
	bl	_fseek
Lloh24:
	adrp	x8, _MAXTRIANGLES@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MAXTRIANGLES@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	lsl	w0, w8, #2
	bl	_malloc
Lloh27:
	adrp	x8, _ptri@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ptri@GOTPAGEOFF]
Lloh29:
	str	x0, [x8]
	str	x0, [x20]
	mov	x0, x21
	bl	_ParseChunk
	ldr	x8, [x24]
	ldr	x9, [x25]
	orr	x8, x8, x9
	cbz	x8, LBB0_4
; %bb.3:
Lloh30:
	adrp	x0, l_.str.3@PAGE
Lloh31:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_Error
LBB0_4:
	ldr	w8, [x23]
	str	w8, [x19]
	mov	x0, x21
	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
	add	sp, sp, #96
	b	_fclose
LBB0_5:
Lloh32:
	adrp	x8, _stderr@GOTPAGE
Lloh33:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	str	x22, [sp]
Lloh35:
	adrp	x1, l_.str.1@PAGE
Lloh36:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh37:
	adrp	x8, _stderr@GOTPAGE
Lloh38:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
Lloh40:
	adrp	x1, l_.str.2@PAGE
Lloh41:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_7:
	bl	_fprintf
	mov	w0, #0
	bl	_exit
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_bytesread,8,3                  ; @bytesread
	.comm	_level,8,3                      ; @level
	.comm	_numtris,8,3                    ; @numtris
	.comm	_totaltris,4,2                  ; @totaltris
	.comm	_vertsfound,8,3                 ; @vertsfound
	.comm	_trisfound,8,3                  ; @trisfound
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rb"

	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"reader: could not open file '%s'\n"

	.comm	_MAIN3DS,2,1                    ; @MAIN3DS
	.comm	_EDIT3DS,2,1                    ; @EDIT3DS
l_.str.2:                               ; @.str.2
	.asciz	"File is not a 3DS file.\n"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_MAXTRIANGLES,4,2               ; @MAXTRIANGLES
	.comm	_ptri,8,3                       ; @ptri
l_.str.3:                               ; @.str.3
	.asciz	"Incomplete triangle set"

.subsections_via_symbols
