	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _gd2GetHeader
__gd2GetHeader:                         ## @_gd2GetHeader
	.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	%r9, %rbx
	movq	%r8, %r14
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movl	%edi, %r13d
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_gd_error
	movl	%eax, %edi
	callq	_GD2_DBG
	movl	%r13d, %edi
	callq	_gdGetC
	movq	_EOF@GOTPCREL(%rip), %r12
	cmpl	(%r12), %eax
	je	LBB0_1
## %bb.2:
	movb	%al, -45(%rbp)
	movl	%r13d, %edi
	callq	_gdGetC
	cmpl	(%r12), %eax
	je	LBB0_1
## %bb.4:
	movb	%al, -44(%rbp)
	movl	%r13d, %edi
	callq	_gdGetC
	cmpl	(%r12), %eax
	jne	LBB0_6
LBB0_1:
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movb	%al, -43(%rbp)
	movl	%r13d, %edi
	callq	_gdGetC
	cmpl	(%r12), %eax
	movl	$0, %ebx
	je	LBB0_11
## %bb.7:
	movb	%al, -42(%rbp)
	movb	$0, -41(%rbp)
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	leaq	-45(%rbp), %r12
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_gd_error
	movl	%eax, %edi
	callq	_GD2_DBG
	movq	_GD2_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_12
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
LBB0_9:
	xorl	%eax, %eax
	callq	_gd_error
LBB0_10:
	movl	%eax, %edi
	callq	_GD2_DBG
	jmp	LBB0_11
LBB0_12:
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_gdGetWord
	cmpl	$1, %eax
	jne	LBB0_11
## %bb.13:
	movl	(%r14), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_gd_error
	movl	%eax, %edi
	callq	_GD2_DBG
	movl	(%r14), %esi
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jae	LBB0_25
## %bb.14:
	movq	%r15, %rbx
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_gdGetWord
	testl	%eax, %eax
	je	LBB0_27
## %bb.15:
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_gdGetWord
	testl	%eax, %eax
	je	LBB0_28
## %bb.16:
	movl	(%rbx), %esi
	movl	(%r15), %edx
	leaq	L_.str.7(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_gd_error
	movl	%eax, %edi
	callq	_GD2_DBG
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_gdGetWord
	cmpl	$1, %eax
	jne	LBB0_11
## %bb.17:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %esi
	leaq	L_.str.8(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_gd_error
	movl	%eax, %edi
	callq	_GD2_DBG
	movl	(%r14), %esi
	movq	_GD2_CHUNKSIZE_MIN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jl	LBB0_29
## %bb.18:
	movq	_GD2_CHUNKSIZE_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jg	LBB0_29
## %bb.19:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_gdGetWord
	xorl	%ebx, %ebx
	cmpl	$1, %eax
	jne	LBB0_11
## %bb.20:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %esi
	leaq	L_.str.10(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_gd_error
	movl	%eax, %edi
	callq	_GD2_DBG
	movl	(%r14), %esi
	movq	_GD2_FMT_RAW@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	je	LBB0_30
## %bb.21:
	movq	_GD2_FMT_COMPRESSED@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	je	LBB0_30
## %bb.22:
	movq	_GD2_FMT_TRUECOLOR_RAW@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	je	LBB0_30
## %bb.23:
	movq	_GD2_FMT_TRUECOLOR_COMPRESSED@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	je	LBB0_30
## %bb.24:
	leaq	L_.str.11(%rip), %rdi
	xorl	%ebx, %ebx
	jmp	LBB0_26
LBB0_25:
	leaq	L_.str.4(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
LBB0_26:
	xorl	%eax, %eax
	callq	_gd_error
	jmp	LBB0_10
LBB0_27:
	leaq	L_.str.5(%rip), %rdi
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_28:
	leaq	L_.str.6(%rip), %rdi
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_29:
	leaq	L_.str.9(%rip), %rdi
	jmp	LBB0_26
LBB0_30:
	movq	16(%rbp), %r14
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_gdGetWord
	cmpl	$1, %eax
	jne	LBB0_11
## %bb.31:
	movq	24(%rbp), %r15
	movl	(%r14), %esi
	leaq	L_.str.12(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_gd_error
	movl	%eax, %edi
	callq	_GD2_DBG
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_gdGetWord
	cmpl	$1, %eax
	jne	LBB0_11
## %bb.32:
	movl	(%r15), %esi
	leaq	L_.str.13(%rip), %rdi
	xorl	%eax, %eax
	callq	_gd_error
	movl	%eax, %edi
	callq	_GD2_DBG
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_gd2_compressed
	testq	%rax, %rax
	je	LBB0_49
## %bb.33:
	movl	(%r14), %esi
	movl	(%r15), %r14d
	testl	%esi, %esi
	jle	LBB0_36
## %bb.34:
	testl	%r14d, %r14d
	jle	LBB0_36
## %bb.35:
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%r14d
	cmpl	%eax, %esi
	jle	LBB0_37
LBB0_36:
	leaq	L_.str.14(%rip), %rdi
	movl	%r14d, %edx
	callq	_printf
	movl	%eax, %edi
	callq	_GD2_DBG
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_37:
	imull	%esi, %r14d
	leaq	L_.str.15(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_gd_error
	movl	%eax, %edi
	callq	_GD2_DBG
	movl	$16, %edi
	movl	%r14d, %esi
	callq	_overflow2
	testq	%rax, %rax
	jne	LBB0_1
## %bb.39:
	movl	%r14d, %edi
	shll	$4, %edi
	testl	%edi, %edi
	jle	LBB0_1
## %bb.40:
	movl	$1, %esi
	callq	_gdCalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.41:
	movq	%rax, %r15
	testl	%r14d, %r14d
	jle	LBB0_48
## %bb.42:
	movl	%r14d, %ebx
	movq	%r15, %r14
	addq	$8, %r14
LBB0_43:                                ## =>This Inner Loop Header: Depth=1
	leaq	-8(%r14), %r12
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_gdGetInt
	cmpl	$1, %eax
	jne	LBB0_52
## %bb.44:                              ##   in Loop: Header=BB0_43 Depth=1
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_gdGetInt
	cmpl	$1, %eax
	jne	LBB0_52
## %bb.45:                              ##   in Loop: Header=BB0_43 Depth=1
	cmpq	$0, (%r12)
	js	LBB0_52
## %bb.46:                              ##   in Loop: Header=BB0_43 Depth=1
	cmpq	$0, (%r14)
	js	LBB0_52
## %bb.47:                              ##   in Loop: Header=BB0_43 Depth=1
	addq	$16, %r14
	decq	%rbx
	jne	LBB0_43
LBB0_48:
	movq	32(%rbp), %rax
	movq	%r15, (%rax)
LBB0_49:
	leaq	L_.str.16(%rip), %rdi
	xorl	%eax, %eax
	callq	_gd_error
	movl	%eax, %edi
	callq	_GD2_DBG
	movl	$1, %ebx
	jmp	LBB0_11
LBB0_52:
	movq	%r15, %rdi
	callq	_gdFree
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reading gd2 header info"

	.comm	_EOF,4,2                        ## @EOF
L_.str.1:                               ## @.str.1
	.asciz	"Got file code: %s"

	.comm	_GD2_ID,4,2                     ## @GD2_ID
L_.str.2:                               ## @.str.2
	.asciz	"Not a valid gd2 file"

L_.str.3:                               ## @.str.3
	.asciz	"Version: %d"

L_.str.4:                               ## @.str.4
	.asciz	"Bad version: %d"

L_.str.5:                               ## @.str.5
	.asciz	"Could not get x-size"

L_.str.6:                               ## @.str.6
	.asciz	"Could not get y-size"

L_.str.7:                               ## @.str.7
	.asciz	"Image is %dx%d"

L_.str.8:                               ## @.str.8
	.asciz	"ChunkSize: %d"

	.comm	_GD2_CHUNKSIZE_MIN,4,2          ## @GD2_CHUNKSIZE_MIN
	.comm	_GD2_CHUNKSIZE_MAX,4,2          ## @GD2_CHUNKSIZE_MAX
L_.str.9:                               ## @.str.9
	.asciz	"Bad chunk size: %d"

L_.str.10:                              ## @.str.10
	.asciz	"Format: %d"

	.comm	_GD2_FMT_RAW,4,2                ## @GD2_FMT_RAW
	.comm	_GD2_FMT_COMPRESSED,4,2         ## @GD2_FMT_COMPRESSED
	.comm	_GD2_FMT_TRUECOLOR_RAW,4,2      ## @GD2_FMT_TRUECOLOR_RAW
	.comm	_GD2_FMT_TRUECOLOR_COMPRESSED,4,2 ## @GD2_FMT_TRUECOLOR_COMPRESSED
L_.str.11:                              ## @.str.11
	.asciz	"Bad data format: %d"

L_.str.12:                              ## @.str.12
	.asciz	"%d Chunks Wide"

L_.str.13:                              ## @.str.13
	.asciz	"%d Chunks vertically"

	.comm	_INT_MAX,4,2                    ## @INT_MAX
L_.str.14:                              ## @.str.14
	.asciz	"Illegal chunk counts: %d * %d\n"

L_.str.15:                              ## @.str.15
	.asciz	"Reading %d chunk index entries"

L_.str.16:                              ## @.str.16
	.asciz	"gd2 header complete"

	.no_dead_strip	__gd2GetHeader
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _gd2GetHeader
__gd2GetHeader:                         ; @_gd2GetHeader
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x20, x7
	mov	x21, x6
	mov	x22, x5
	mov	x26, x4
	mov	x23, x3
	mov	x24, x2
	mov	x25, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	mov	x0, x19
	bl	_gdGetC
Lloh2:
	adrp	x27, _EOF@GOTPAGE
Lloh3:
	ldr	x27, [x27, _EOF@GOTPAGEOFF]
	ldr	w8, [x27]
	cmp	w0, w8
	b.eq	LBB0_8
; %bb.1:
	strb	w0, [sp, #27]
	mov	x0, x19
	bl	_gdGetC
	ldr	w8, [x27]
	cmp	w0, w8
	b.eq	LBB0_8
; %bb.2:
	strb	w0, [sp, #28]
	mov	x0, x19
	bl	_gdGetC
	ldr	w8, [x27]
	cmp	w0, w8
	b.eq	LBB0_8
; %bb.3:
	strb	w0, [sp, #29]
	mov	x0, x19
	bl	_gdGetC
	ldr	w8, [x27]
	cmp	w0, w8
	b.eq	LBB0_8
; %bb.4:
	strb	w0, [sp, #30]
	strb	wzr, [sp, #31]
	add	x8, sp, #27
	str	x8, [sp]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
Lloh6:
	adrp	x8, _GD2_ID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GD2_ID@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x0, sp, #27
	bl	_strcmp
	cbz	x0, LBB0_10
; %bb.5:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_6:
	bl	_gd_error
LBB0_7:
	bl	_GD2_DBG
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_10:
	mov	x0, x26
	mov	x1, x19
	bl	_gdGetWord
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.11:
	ldr	w8, [x26]
	str	x8, [sp]
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	ldr	w8, [x26]
	sub	w9, w8, #1
	cmp	w9, #2
	b.hs	LBB0_23
; %bb.12:
	mov	x0, x25
	mov	x1, x19
	bl	_gdGetWord
	cbz	w0, LBB0_24
; %bb.13:
	mov	x0, x24
	mov	x1, x19
	bl	_gdGetWord
	cbz	w0, LBB0_25
; %bb.14:
	ldr	w8, [x25]
	ldr	w9, [x24]
	stp	x8, x9, [sp]
Lloh13:
	adrp	x0, l_.str.7@PAGE
Lloh14:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	mov	x0, x23
	mov	x1, x19
	bl	_gdGetWord
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.15:
	ldr	w8, [x23]
	str	x8, [sp]
Lloh15:
	adrp	x0, l_.str.8@PAGE
Lloh16:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	ldr	w8, [x23]
Lloh17:
	adrp	x9, _GD2_CHUNKSIZE_MIN@GOTPAGE
Lloh18:
	ldr	x9, [x9, _GD2_CHUNKSIZE_MIN@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	cmp	w8, w9
	b.lt	LBB0_26
; %bb.16:
Lloh20:
	adrp	x9, _GD2_CHUNKSIZE_MAX@GOTPAGE
Lloh21:
	ldr	x9, [x9, _GD2_CHUNKSIZE_MAX@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	cmp	w8, w9
	b.gt	LBB0_26
; %bb.17:
	mov	x0, x22
	mov	x1, x19
	bl	_gdGetWord
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.18:
	ldr	w8, [x22]
	str	x8, [sp]
Lloh23:
	adrp	x0, l_.str.10@PAGE
Lloh24:
	add	x0, x0, l_.str.10@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	ldr	w8, [x22]
Lloh25:
	adrp	x9, _GD2_FMT_RAW@GOTPAGE
Lloh26:
	ldr	x9, [x9, _GD2_FMT_RAW@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_27
; %bb.19:
Lloh28:
	adrp	x9, _GD2_FMT_COMPRESSED@GOTPAGE
Lloh29:
	ldr	x9, [x9, _GD2_FMT_COMPRESSED@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_27
; %bb.20:
Lloh31:
	adrp	x9, _GD2_FMT_TRUECOLOR_RAW@GOTPAGE
Lloh32:
	ldr	x9, [x9, _GD2_FMT_TRUECOLOR_RAW@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_27
; %bb.21:
Lloh34:
	adrp	x9, _GD2_FMT_TRUECOLOR_COMPRESSED@GOTPAGE
Lloh35:
	ldr	x9, [x9, _GD2_FMT_TRUECOLOR_COMPRESSED@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_27
; %bb.22:
	str	x8, [sp]
Lloh37:
	adrp	x0, l_.str.11@PAGE
Lloh38:
	add	x0, x0, l_.str.11@PAGEOFF
	b	LBB0_6
LBB0_23:
	str	x8, [sp]
Lloh39:
	adrp	x0, l_.str.4@PAGE
Lloh40:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_6
LBB0_24:
Lloh41:
	adrp	x0, l_.str.5@PAGE
Lloh42:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_6
LBB0_25:
Lloh43:
	adrp	x0, l_.str.6@PAGE
Lloh44:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_6
LBB0_26:
	str	x8, [sp]
Lloh45:
	adrp	x0, l_.str.9@PAGE
Lloh46:
	add	x0, x0, l_.str.9@PAGEOFF
	b	LBB0_6
LBB0_27:
	mov	x0, x21
	mov	x1, x19
	bl	_gdGetWord
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.28:
	ldr	w8, [x21]
	str	x8, [sp]
Lloh47:
	adrp	x0, l_.str.12@PAGE
Lloh48:
	add	x0, x0, l_.str.12@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	mov	x0, x20
	mov	x1, x19
	bl	_gdGetWord
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.29:
	ldr	w8, [x20]
	str	x8, [sp]
Lloh49:
	adrp	x0, l_.str.13@PAGE
Lloh50:
	add	x0, x0, l_.str.13@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	ldr	w0, [x22]
	bl	_gd2_compressed
	cbz	x0, LBB0_45
; %bb.30:
	ldr	w1, [x21]
	ldr	w2, [x20]
	cmp	w1, #1
	b.lt	LBB0_33
; %bb.31:
	cmp	w2, #1
	b.lt	LBB0_33
; %bb.32:
Lloh51:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh52:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh53:
	ldr	w8, [x8]
	sdiv	w8, w8, w2
	cmp	w1, w8
	b.le	LBB0_34
LBB0_33:
Lloh54:
	adrp	x0, l_.str.14@PAGE
Lloh55:
	add	x0, x0, l_.str.14@PAGEOFF
	bl	_printf
	b	LBB0_7
LBB0_34:
	mul	w21, w2, w1
	mov	x8, x21
	str	x8, [sp]
Lloh56:
	adrp	x0, l_.str.15@PAGE
Lloh57:
	add	x0, x0, l_.str.15@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	mov	w0, #16
	mov	x1, x21
	bl	_overflow2
	cbnz	x0, LBB0_8
; %bb.35:
	lsl	w0, w21, #4
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.36:
	mov	w1, #1
	bl	_gdCalloc
	cbz	x0, LBB0_9
; %bb.37:
	mov	x20, x0
	cmp	w21, #1
	b.lt	LBB0_44
; %bb.38:
	mov	x23, #0
	lsl	x24, x21, #4
LBB0_39:                                ; =>This Inner Loop Header: Depth=1
	add	x21, x20, x23
	mov	x0, x21
	mov	x1, x19
	bl	_gdGetInt
	cmp	w0, #1
	b.ne	LBB0_46
; %bb.40:                               ;   in Loop: Header=BB0_39 Depth=1
	add	x22, x21, #8
	mov	x0, x22
	mov	x1, x19
	bl	_gdGetInt
	cmp	w0, #1
	b.ne	LBB0_46
; %bb.41:                               ;   in Loop: Header=BB0_39 Depth=1
	ldr	x8, [x21]
	tbnz	x8, #63, LBB0_46
; %bb.42:                               ;   in Loop: Header=BB0_39 Depth=1
	ldr	x8, [x22]
	tbnz	x8, #63, LBB0_46
; %bb.43:                               ;   in Loop: Header=BB0_39 Depth=1
	add	x23, x23, #16
	cmp	x24, x23
	b.ne	LBB0_39
LBB0_44:
	ldr	x8, [x29, #16]
	str	x20, [x8]
LBB0_45:
Lloh58:
	adrp	x0, l_.str.16@PAGE
Lloh59:
	add	x0, x0, l_.str.16@PAGEOFF
	bl	_gd_error
	bl	_GD2_DBG
	mov	w0, #1
	b	LBB0_9
LBB0_46:
	mov	x0, x20
	bl	_gdFree
	b	LBB0_8
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpAdd	Lloh58, Lloh59
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reading gd2 header info"

	.comm	_EOF,4,2                        ; @EOF
l_.str.1:                               ; @.str.1
	.asciz	"Got file code: %s"

	.comm	_GD2_ID,4,2                     ; @GD2_ID
l_.str.2:                               ; @.str.2
	.asciz	"Not a valid gd2 file"

l_.str.3:                               ; @.str.3
	.asciz	"Version: %d"

l_.str.4:                               ; @.str.4
	.asciz	"Bad version: %d"

l_.str.5:                               ; @.str.5
	.asciz	"Could not get x-size"

l_.str.6:                               ; @.str.6
	.asciz	"Could not get y-size"

l_.str.7:                               ; @.str.7
	.asciz	"Image is %dx%d"

l_.str.8:                               ; @.str.8
	.asciz	"ChunkSize: %d"

	.comm	_GD2_CHUNKSIZE_MIN,4,2          ; @GD2_CHUNKSIZE_MIN
	.comm	_GD2_CHUNKSIZE_MAX,4,2          ; @GD2_CHUNKSIZE_MAX
l_.str.9:                               ; @.str.9
	.asciz	"Bad chunk size: %d"

l_.str.10:                              ; @.str.10
	.asciz	"Format: %d"

	.comm	_GD2_FMT_RAW,4,2                ; @GD2_FMT_RAW
	.comm	_GD2_FMT_COMPRESSED,4,2         ; @GD2_FMT_COMPRESSED
	.comm	_GD2_FMT_TRUECOLOR_RAW,4,2      ; @GD2_FMT_TRUECOLOR_RAW
	.comm	_GD2_FMT_TRUECOLOR_COMPRESSED,4,2 ; @GD2_FMT_TRUECOLOR_COMPRESSED
l_.str.11:                              ; @.str.11
	.asciz	"Bad data format: %d"

l_.str.12:                              ; @.str.12
	.asciz	"%d Chunks Wide"

l_.str.13:                              ; @.str.13
	.asciz	"%d Chunks vertically"

	.comm	_INT_MAX,4,2                    ; @INT_MAX
l_.str.14:                              ; @.str.14
	.asciz	"Illegal chunk counts: %d * %d\n"

l_.str.15:                              ; @.str.15
	.asciz	"Reading %d chunk index entries"

l_.str.16:                              ; @.str.16
	.asciz	"gd2 header complete"

	.no_dead_strip	__gd2GetHeader
.subsections_via_symbols
