	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function TIFFCheckDirOffset
_TIFFCheckDirOffset:                    ## @TIFFCheckDirOffset
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r14d, %r14d
	testq	%rsi, %rsi
	je	LBB0_17
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movl	(%rdi), %ecx
	testl	%ecx, %ecx
	je	LBB0_12
## %bb.2:
	cmpl	$65535, %ecx                    ## imm = 0xFFFF
	jne	LBB0_3
## %bb.5:
	movl	20(%r15), %edi
	leaq	L_.str(%rip), %rsi
	leaq	L_.str.1(%rip), %rdx
	callq	_TIFFErrorExt
	jmp	LBB0_17
LBB0_12:
	movq	8(%r15), %rax
	leal	1(%rcx), %edx
	movl	%edx, (%r15)
	movl	$1, %edx
	testq	%rax, %rax
	jne	LBB0_8
## %bb.13:
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_3:
	movq	8(%r15), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.9:
	cmpl	$2, %ecx
	movl	$1, %edx
	cmovael	%ecx, %edx
	movslq	%edx, %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rbx, (%rax,%rsi,8)
	je	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_10 Depth=1
	incq	%rsi
	cmpq	%rsi, %rdx
	jne	LBB0_10
## %bb.7:
	leal	1(%rcx), %edx
	movl	%edx, (%r15)
LBB0_8:
	cmpl	16(%r15), %ecx
	jge	LBB0_14
	jmp	LBB0_16
LBB0_4:
	incl	%ecx
	movl	%ecx, (%r15)
	xorl	%eax, %eax
	movl	%ecx, %edx
LBB0_14:
	leaq	L_.str.2(%rip), %r8
	movq	%r15, %rdi
	movq	%rax, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	movl	$16, %ecx
	callq	__TIFFCheckRealloc
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:
	movl	(%r15), %edx
	leal	(%rdx,%rdx), %ecx
	cmpl	$32768, %edx                    ## imm = 0x8000
	movl	$65535, %esi                    ## imm = 0xFFFF
	cmovll	%ecx, %esi
	movl	%esi, 16(%r15)
	movq	%rax, 8(%r15)
LBB0_16:
	movslq	%edx, %rcx
	movq	%rbx, -8(%rax,%rcx,8)
	movl	$1, %r14d
	jmp	LBB0_17
LBB0_11:
	xorl	%r14d, %r14d
LBB0_17:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TIFFCheckDirOffset"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot handle more than 65535 TIFF directories"

L_.str.2:                               ## @.str.2
	.asciz	"for IFD list"

	.no_dead_strip	_TIFFCheckDirOffset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function TIFFCheckDirOffset
_TIFFCheckDirOffset:                    ; @TIFFCheckDirOffset
	.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
	cbz	x1, LBB0_4
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_5
; %bb.2:
	mov	w9, #65535
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.3:
	ldr	w0, [x20, #20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
Lloh2:
	adrp	x2, l_.str.1@PAGE
Lloh3:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_TIFFErrorExt
LBB0_4:
	mov	w0, #0
	b	LBB0_16
LBB0_5:
	ldr	x1, [x20, #8]
	add	w9, w8, #1
	str	w9, [x20]
	mov	w2, #1
	cbnz	x1, LBB0_11
	b	LBB0_13
LBB0_6:
	ldr	x1, [x20, #8]
	cbz	x1, LBB0_12
; %bb.7:
	mov	x9, #0
	cmp	w8, #1
	csinc	w10, w8, wzr, hi
	sxtw	x10, w10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x1, x9, lsl #3]
	cmp	x11, x19
	b.eq	LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x9, x9, #1
	cmp	x10, x9
	b.ne	LBB0_8
; %bb.10:
	add	w2, w8, #1
	str	w2, [x20]
LBB0_11:
	ldr	w9, [x20, #16]
	cmp	w8, w9
	b.ge	LBB0_13
	b	LBB0_15
LBB0_12:
	add	w2, w8, #1
	str	w2, [x20]
LBB0_13:
Lloh4:
	adrp	x4, l_.str.2@PAGE
Lloh5:
	add	x4, x4, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	w3, #16
	bl	__TIFFCheckRealloc
	cbz	x0, LBB0_16
; %bb.14:
	mov	x1, x0
	ldr	w2, [x20]
	lsl	w8, w2, #1
	mov	w9, #65535
	cmp	w2, #8, lsl #12                 ; =32768
	csel	w8, w9, w8, ge
	str	w8, [x20, #16]
	str	x0, [x20, #8]
LBB0_15:
	sub	w8, w2, #1
	str	x19, [x1, w8, sxtw #3]
	mov	w0, #1
LBB0_16:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TIFFCheckDirOffset"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot handle more than 65535 TIFF directories"

l_.str.2:                               ; @.str.2
	.asciz	"for IFD list"

	.no_dead_strip	_TIFFCheckDirOffset
.subsections_via_symbols
