	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_TIFFWriteCheck                 ## -- Begin function TIFFWriteCheck
	.p2align	4, 0x90
_TIFFWriteCheck:                        ## @TIFFWriteCheck
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	_O_RDONLY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movl	28(%r15), %edi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_20
LBB0_2:
	movl	%esi, %ebx
	movq	%r15, %rdi
	callq	_isTiled
	cmpl	%ebx, %eax
	jne	LBB0_7
## %bb.3:
	movq	%r15, %rdi
	callq	__TIFFFillStriles
	movq	_FIELD_IMAGEDIMENSIONS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_TIFFFieldSet
	testl	%eax, %eax
	je	LBB0_8
## %bb.4:
	movl	32(%r15), %ebx
	movq	_FIELD_PLANARCONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_TIFFFieldSet
	cmpl	$1, %ebx
	jne	LBB0_9
## %bb.5:
	testl	%eax, %eax
	jne	LBB0_10
## %bb.6:
	movq	_PLANARCONFIG_CONTIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r15)
	jmp	LBB0_10
LBB0_7:
	movl	28(%r15), %edi
	testl	%ebx, %ebx
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rdx
	cmoveq	%rax, %rdx
	jmp	LBB0_20
LBB0_8:
	movl	28(%r15), %edi
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_20
LBB0_9:
	testl	%eax, %eax
	je	LBB0_19
LBB0_10:
	cmpq	$0, 48(%r15)
	jne	LBB0_12
## %bb.11:
	movq	%r15, %rdi
	callq	_TIFFSetupStrips
	testl	%eax, %eax
	je	LBB0_22
LBB0_12:
	movq	%r15, %rdi
	callq	_isTiled
	testl	%eax, %eax
	je	LBB0_15
## %bb.13:
	movq	%r15, %rdi
	callq	_TIFFTileSize
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	jne	LBB0_16
	jmp	LBB0_14
LBB0_15:
	movq	$-1, 8(%r15)
LBB0_16:
	movq	%r15, %rdi
	callq	_TIFFScanlineSize
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_14
## %bb.17:
	movq	_TIFF_BEENWRITING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%r15)
	movl	$1, %ebx
	jmp	LBB0_21
LBB0_14:
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_19:
	movl	28(%r15), %edi
	leaq	L_.str.4(%rip), %rdx
LBB0_20:
	xorl	%ebx, %ebx
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_TIFFErrorExt
LBB0_21:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	movq	$0, 40(%r15)
	movl	28(%r15), %r12d
	movq	%r15, %rdi
	callq	_isTiled
	testl	%eax, %eax
	leaq	L_.str.7(%rip), %rax
	leaq	L_.str.6(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str.5(%rip), %rdx
	xorl	%ebx, %ebx
	movl	%r12d, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_TIFFErrorExt
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,8,3                   ## @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"File not open for writing"

L_.str.1:                               ## @.str.1
	.asciz	"Can not write tiles to a stripped image"

L_.str.2:                               ## @.str.2
	.asciz	"Can not write scanlines to a tiled image"

	.comm	_FIELD_IMAGEDIMENSIONS,4,2      ## @FIELD_IMAGEDIMENSIONS
L_.str.3:                               ## @.str.3
	.asciz	"Must set \"ImageWidth\" before writing data"

	.comm	_FIELD_PLANARCONFIG,4,2         ## @FIELD_PLANARCONFIG
	.comm	_PLANARCONFIG_CONTIG,4,2        ## @PLANARCONFIG_CONTIG
L_.str.4:                               ## @.str.4
	.asciz	"Must set \"PlanarConfiguration\" before writing data"

L_.str.5:                               ## @.str.5
	.asciz	"No space for %s arrays"

L_.str.6:                               ## @.str.6
	.asciz	"tile"

L_.str.7:                               ## @.str.7
	.asciz	"strip"

	.comm	_TIFF_BEENWRITING,4,2           ## @TIFF_BEENWRITING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_TIFFWriteCheck                 ; -- Begin function TIFFWriteCheck
	.p2align	2
_TIFFWriteCheck:                        ; @TIFFWriteCheck
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w0, [x20, #28]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_19
LBB0_2:
	mov	x21, x1
	mov	x0, x20
	bl	_isTiled
	cmp	w0, w21
	b.ne	LBB0_7
; %bb.3:
	mov	x0, x20
	bl	__TIFFFillStriles
Lloh5:
	adrp	x8, _FIELD_IMAGEDIMENSIONS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FIELD_IMAGEDIMENSIONS@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_TIFFFieldSet
	cbz	w0, LBB0_8
; %bb.4:
	ldr	w21, [x20, #32]
Lloh8:
	adrp	x8, _FIELD_PLANARCONFIG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FIELD_PLANARCONFIG@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_TIFFFieldSet
	cmp	w21, #1
	b.ne	LBB0_9
; %bb.5:
	cbnz	w0, LBB0_10
; %bb.6:
Lloh11:
	adrp	x8, _PLANARCONFIG_CONTIG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PLANARCONFIG_CONTIG@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x20, #56]
	b	LBB0_10
LBB0_7:
	ldr	w0, [x20, #28]
Lloh14:
	adrp	x8, l_.str.1@PAGE
Lloh15:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh16:
	adrp	x9, l_.str.2@PAGE
Lloh17:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w21, #0
	csel	x2, x9, x8, eq
	b	LBB0_19
LBB0_8:
	ldr	w0, [x20, #28]
Lloh18:
	adrp	x2, l_.str.3@PAGE
Lloh19:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_19
LBB0_9:
	cbz	w0, LBB0_17
LBB0_10:
	ldr	x8, [x20, #48]
	cbnz	x8, LBB0_12
; %bb.11:
	mov	x0, x20
	bl	_TIFFSetupStrips
	cbz	w0, LBB0_18
LBB0_12:
	mov	x0, x20
	bl	_isTiled
	cbz	w0, LBB0_14
; %bb.13:
	mov	x0, x20
	bl	_TIFFTileSize
	str	x0, [x20, #8]
	cbnz	x0, LBB0_15
	b	LBB0_20
LBB0_14:
	mov	x8, #-1
	str	x8, [x20, #8]
LBB0_15:
	mov	x0, x20
	bl	_TIFFScanlineSize
	str	x0, [x20, #16]
	cbz	x0, LBB0_20
; %bb.16:
Lloh20:
	adrp	x8, _TIFF_BEENWRITING@GOTPAGE
Lloh21:
	ldr	x8, [x8, _TIFF_BEENWRITING@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ldr	w9, [x20, #24]
	orr	w8, w9, w8
	str	w8, [x20, #24]
	mov	w0, #1
	b	LBB0_20
LBB0_17:
	ldr	w0, [x20, #28]
Lloh23:
	adrp	x2, l_.str.4@PAGE
Lloh24:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_19
LBB0_18:
	str	xzr, [x20, #40]
	ldr	w21, [x20, #28]
	mov	x0, x20
	bl	_isTiled
Lloh25:
	adrp	x8, l_.str.6@PAGE
Lloh26:
	add	x8, x8, l_.str.6@PAGEOFF
Lloh27:
	adrp	x9, l_.str.7@PAGE
Lloh28:
	add	x9, x9, l_.str.7@PAGEOFF
	cmp	w0, #0
	csel	x8, x9, x8, eq
	str	x8, [sp]
Lloh29:
	adrp	x2, l_.str.5@PAGE
Lloh30:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x0, x21
LBB0_19:
	mov	x1, x19
	bl	_TIFFErrorExt
	mov	w0, #0
LBB0_20:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,8,3                   ; @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"File not open for writing"

l_.str.1:                               ; @.str.1
	.asciz	"Can not write tiles to a stripped image"

l_.str.2:                               ; @.str.2
	.asciz	"Can not write scanlines to a tiled image"

	.comm	_FIELD_IMAGEDIMENSIONS,4,2      ; @FIELD_IMAGEDIMENSIONS
l_.str.3:                               ; @.str.3
	.asciz	"Must set \"ImageWidth\" before writing data"

	.comm	_FIELD_PLANARCONFIG,4,2         ; @FIELD_PLANARCONFIG
	.comm	_PLANARCONFIG_CONTIG,4,2        ; @PLANARCONFIG_CONTIG
l_.str.4:                               ; @.str.4
	.asciz	"Must set \"PlanarConfiguration\" before writing data"

l_.str.5:                               ; @.str.5
	.asciz	"No space for %s arrays"

l_.str.6:                               ; @.str.6
	.asciz	"tile"

l_.str.7:                               ; @.str.7
	.asciz	"strip"

	.comm	_TIFF_BEENWRITING,4,2           ; @TIFF_BEENWRITING
.subsections_via_symbols
