	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function TIFFReadDirEntryArrayWithLimit
_TIFFReadDirEntryArrayWithLimit:        ## @TIFFReadDirEntryArrayWithLimit
	.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, %r14
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r15d
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movl	24(%rsi), %edi
	callq	_TIFFDataWidth
	movl	%eax, %r12d
	movq	(%rbx), %rax
	cmpq	%r14, %rax
	cmovlq	%rax, %r14
	testq	%r14, %r14
	je	LBB0_5
## %bb.1:
	testl	%r12d, %r12d
	je	LBB0_5
## %bb.2:
	movl	$2147483647, %eax               ## imm = 0x7FFFFFFF
	xorl	%edx, %edx
	idivl	%r12d
	cltq
	cmpq	%rax, %r14
	jg	LBB0_4
## %bb.3:
	movl	$2147483647, %eax               ## imm = 0x7FFFFFFF
	xorl	%edx, %edx
	idivl	%r15d
	cltq
	cmpq	%rax, %r14
	jle	LBB0_9
LBB0_4:
	movq	_TIFFReadDirEntryErrSizesan@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
LBB0_6:
	movq	_TIFFReadDirEntryErrOk@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%r14d, (%rax)
	movl	%r12d, %r15d
	imull	%r14d, %r15d
	xorl	%edi, %edi
	testl	%r15d, %r15d
	setg	%dil
	callq	_assert
	movq	%r13, %r14
	movq	%r13, %rdi
	callq	_isMapped
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	cmpl	8(%r14), %r15d
	jle	LBB0_12
## %bb.11:
	movq	_TIFFReadDirEntryErrIo@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_12:
	movq	%r14, %rdi
	callq	_isMapped
	testq	%rax, %rax
	je	LBB0_15
LBB0_13:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	__TIFFCheckMalloc
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_25
## %bb.14:
	movq	%rax, %r13
	movl	(%r14), %eax
	movq	_TIFF_BIGTIFF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	jmp	LBB0_20
LBB0_15:
	movl	(%r14), %eax
	movq	_TIFF_BIGTIFF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_17
## %bb.16:
	cmpl	$8, %r15d
	jg	LBB0_19
LBB0_17:
	testl	%eax, %ecx
	jne	LBB0_13
## %bb.18:
	cmpl	$5, %r15d
	jl	LBB0_13
LBB0_19:
	movq	$0, -48(%rbp)
	xorl	%r13d, %r13d
LBB0_20:
	movslq	%r15d, %r12
	testl	%eax, %ecx
	je	LBB0_26
## %bb.21:
	cmpl	$8, %r15d
	jle	LBB0_27
## %bb.22:
	movq	16(%rbx), %rcx
	movq	%rcx, -64(%rbp)
	movq	_TIFF_SWAB@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_24
## %bb.23:
	leaq	-64(%rbp), %rdi
	callq	_TIFFSwabLong8
LBB0_24:
	movq	%r14, %rdi
	callq	_isMapped
	movq	-64(%rbp), %rsi
	jmp	LBB0_31
LBB0_25:
	movq	_TIFFReadDirEntryErrAlloc@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_26:
	cmpl	$4, %r15d
	jg	LBB0_28
LBB0_27:
	addq	$8, %rbx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	__TIFFmemcpy
	jmp	LBB0_35
LBB0_28:
	movl	8(%rbx), %ecx
	movl	%ecx, -64(%rbp)
	movq	_TIFF_SWAB@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_30
## %bb.29:
	leaq	-64(%rbp), %rdi
	callq	_TIFFSwabLong
LBB0_30:
	movq	%r14, %rdi
	callq	_isMapped
	movslq	-64(%rbp), %rsi
LBB0_31:
	testq	%rax, %rax
	je	LBB0_33
## %bb.32:
	movq	%r14, %rdi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	_TIFFReadDirEntryData
	jmp	LBB0_34
LBB0_33:
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r12, %rdx
	callq	_TIFFReadDirEntryDataAndRealloc
LBB0_34:
	movl	%eax, %ebx
	movq	_TIFFReadDirEntryErrOk@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_36
LBB0_35:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	-48(%rbp), %rax
	movq	%rax, (%rcx)
	jmp	LBB0_6
LBB0_36:
	movq	-48(%rbp), %rdi
	callq	__TIFFfree
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_TIFFReadDirEntryErrOk,4,2      ## @TIFFReadDirEntryErrOk
	.comm	_TIFFReadDirEntryErrSizesan,4,2 ## @TIFFReadDirEntryErrSizesan
	.comm	_TIFFReadDirEntryErrIo,4,2      ## @TIFFReadDirEntryErrIo
	.comm	_TIFF_BIGTIFF,4,2               ## @TIFF_BIGTIFF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ReadDirEntryArray"

	.comm	_TIFFReadDirEntryErrAlloc,4,2   ## @TIFFReadDirEntryErrAlloc
	.comm	_TIFF_SWAB,4,2                  ## @TIFF_SWAB
	.no_dead_strip	_TIFFReadDirEntryArrayWithLimit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function TIFFReadDirEntryArrayWithLimit
_TIFFReadDirEntryArrayWithLimit:        ; @TIFFReadDirEntryArrayWithLimit
	.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	x25, x5
	mov	x19, x4
	mov	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x20, x0
	ldr	w0, [x1, #24]
	bl	_TIFFDataWidth
	ldr	x8, [x22]
	cmp	x8, x25
	csel	x8, x8, x25, lt
	cmp	x8, #0
	ccmp	w0, #0, #4, ne
	b.ne	LBB0_2
; %bb.1:
	str	xzr, [x19]
Lloh0:
	adrp	x8, _TIFFReadDirEntryErrOk@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TIFFReadDirEntryErrOk@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:
	mov	x24, x0
	mov	w9, #2147483647
	sdiv	w10, w9, w0
	cmp	x8, w10, sxtw
	b.gt	LBB0_4
; %bb.3:
	sdiv	w9, w9, w21
	cmp	x8, w9, sxtw
	b.le	LBB0_7
LBB0_4:
Lloh2:
	adrp	x8, _TIFFReadDirEntryErrSizesan@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TIFFReadDirEntryErrSizesan@GOTPAGEOFF]
LBB0_5:
	ldr	w20, [x8]
LBB0_6:
	mov	x0, x20
	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
	ret
LBB0_7:
	str	w8, [x23]
	mul	w8, w24, w8
	sxtw	x21, w8
	cmp	w8, #0
	cset	w0, gt
	bl	_assert
	mov	x0, x20
	bl	_isMapped
	cbz	x0, LBB0_10
; %bb.8:
	ldr	w8, [x20, #8]
	cmp	w21, w8
	b.le	LBB0_10
; %bb.9:
Lloh4:
	adrp	x8, _TIFFReadDirEntryErrIo@GOTPAGE
Lloh5:
	ldr	x8, [x8, _TIFFReadDirEntryErrIo@GOTPAGEOFF]
	b	LBB0_5
LBB0_10:
	mov	x0, x20
	bl	_isMapped
	cbz	x0, LBB0_13
LBB0_11:
	ldr	w1, [x23]
Lloh6:
	adrp	x3, l_.str@PAGE
Lloh7:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x24
	bl	__TIFFCheckMalloc
	str	x0, [sp, #8]
	cbz	x0, LBB0_24
; %bb.12:
	mov	x23, x0
	ldr	w8, [x20]
Lloh8:
	adrp	x9, _TIFF_BIGTIFF@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TIFF_BIGTIFF@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	b	LBB0_18
LBB0_13:
	ldr	w8, [x20]
Lloh11:
	adrp	x9, _TIFF_BIGTIFF@GOTPAGE
Lloh12:
	ldr	x9, [x9, _TIFF_BIGTIFF@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	ands	w10, w9, w8
	b.eq	LBB0_15
; %bb.14:
	cmp	w21, #8
	b.gt	LBB0_17
LBB0_15:
	cbnz	w10, LBB0_11
; %bb.16:
	cmp	w21, #5
	b.lt	LBB0_11
LBB0_17:
	mov	x23, #0
	str	xzr, [sp, #8]
LBB0_18:
Lloh14:
	adrp	x24, _TIFFReadDirEntryErrOk@GOTPAGE
Lloh15:
	ldr	x24, [x24, _TIFFReadDirEntryErrOk@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_25
; %bb.19:
	cmp	w21, #8
	b.le	LBB0_26
; %bb.20:
	ldr	x9, [x22, #16]
	str	x9, [sp]
Lloh16:
	adrp	x9, _TIFF_SWAB@GOTPAGE
Lloh17:
	ldr	x9, [x9, _TIFF_SWAB@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_22
; %bb.21:
	mov	x0, sp
	bl	_TIFFSwabLong8
LBB0_22:
	mov	x0, x20
	bl	_isMapped
	ldr	x1, [sp]
	cbz	x0, LBB0_30
LBB0_23:
	mov	x0, x20
	mov	x2, x21
	mov	x3, x23
	bl	_TIFFReadDirEntryData
	b	LBB0_31
LBB0_24:
Lloh19:
	adrp	x8, _TIFFReadDirEntryErrAlloc@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TIFFReadDirEntryErrAlloc@GOTPAGEOFF]
	b	LBB0_5
LBB0_25:
	cmp	w21, #4
	b.gt	LBB0_27
LBB0_26:
	add	x1, x22, #8
	mov	x0, x23
	mov	x2, x21
	bl	__TIFFmemcpy
	b	LBB0_32
LBB0_27:
	ldr	w9, [x22, #8]
	str	w9, [sp]
Lloh21:
	adrp	x9, _TIFF_SWAB@GOTPAGE
Lloh22:
	ldr	x9, [x9, _TIFF_SWAB@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_29
; %bb.28:
	mov	x0, sp
	bl	_TIFFSwabLong
LBB0_29:
	mov	x0, x20
	bl	_isMapped
	ldrsw	x1, [sp]
	cbnz	x0, LBB0_23
LBB0_30:
	add	x3, sp, #8
	mov	x0, x20
	mov	x2, x21
	bl	_TIFFReadDirEntryDataAndRealloc
LBB0_31:
	mov	x20, x0
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_33
LBB0_32:
	ldr	x8, [sp, #8]
	str	x8, [x19]
	ldr	w20, [x24]
	b	LBB0_6
LBB0_33:
	ldr	x0, [sp, #8]
	bl	__TIFFfree
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_TIFFReadDirEntryErrOk,4,2      ; @TIFFReadDirEntryErrOk
	.comm	_TIFFReadDirEntryErrSizesan,4,2 ; @TIFFReadDirEntryErrSizesan
	.comm	_TIFFReadDirEntryErrIo,4,2      ; @TIFFReadDirEntryErrIo
	.comm	_TIFF_BIGTIFF,4,2               ; @TIFF_BIGTIFF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ReadDirEntryArray"

	.comm	_TIFFReadDirEntryErrAlloc,4,2   ; @TIFFReadDirEntryErrAlloc
	.comm	_TIFF_SWAB,4,2                  ; @TIFF_SWAB
	.no_dead_strip	_TIFFReadDirEntryArrayWithLimit
.subsections_via_symbols
