	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function TIFFWriteDirectoryTagSubifd
_TIFFWriteDirectoryTagSubifd:           ## @TIFFWriteDirectoryTagSubifd
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movslq	24(%rdi), %r8
	movl	$1, %r14d
	testq	%r8, %r8
	je	LBB0_19
## %bb.1:
	movq	%rdx, %r15
	movq	%rsi, %r12
	testq	%rdx, %rdx
	je	LBB0_6
## %bb.2:
	movq	%rdi, %rbx
	movl	(%rdi), %r13d
	movq	_TIFF_BIGTIFF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%rdi)
	je	LBB0_7
## %bb.3:
	movq	_TIFFTAG_SUBIFD@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	32(%rbx), %r9
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_TIFFWriteDirectoryTagCheckedIfd8Array
	movl	%eax, %r15d
	testl	%r15d, %r15d
	je	LBB0_18
LBB0_4:
	movq	_TIFF_INSUBIFD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%rbx)
	movslq	24(%rbx), %rax
	movq	%rax, 8(%rbx)
	cmpq	$1, %rax
	jne	LBB0_15
## %bb.5:
	movl	$0, 16(%rbx)
	jmp	LBB0_19
LBB0_6:
	incq	(%r12)
	jmp	LBB0_19
LBB0_7:
	shll	$3, %r8d
	movl	%r8d, %edi
	callq	__TIFFmalloc
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_16
## %bb.8:
	movl	24(%rbx), %eax
	testl	%eax, %eax
	jle	LBB0_13
## %bb.9:
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	movq	32(%rbx), %r14
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	xorl	%edi, %edi
	testq	%r14, %r14
	setne	%dil
	callq	_assert
	movl	(%r14), %eax
	testl	%eax, %eax
	js	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	addq	$4, %r14
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx,%r13,8)
	incq	%r13
	movslq	24(%rbx), %rax
	cmpq	%rax, %r13
	jl	LBB0_10
## %bb.12:
	movl	$1, %r14d
	movl	-52(%rbp), %r13d                ## 4-byte Reload
LBB0_13:
	movslq	%eax, %r8
	movq	_TIFFTAG_SUBIFD@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %r9
	callq	_TIFFWriteDirectoryTagCheckedIfdArray
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	__TIFFfree
	testl	%r15d, %r15d
	jne	LBB0_4
	jmp	LBB0_18
LBB0_15:
	movl	%r13d, 16(%rbx)
	jmp	LBB0_19
LBB0_16:
	movl	40(%rbx), %edi
	leaq	_TIFFWriteDirectoryTagSubifd.module(%rip), %rsi
	leaq	L_.str(%rip), %rdx
	callq	_TIFFErrorExt
	jmp	LBB0_18
LBB0_17:
	movl	40(%rbx), %edi
	leaq	_TIFFWriteDirectoryTagSubifd.module(%rip), %rsi
	leaq	L_.str.1(%rip), %rdx
	callq	_TIFFErrorExt
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	__TIFFfree
LBB0_18:
	xorl	%r14d, %r14d
LBB0_19:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @TIFFWriteDirectoryTagSubifd.module
_TIFFWriteDirectoryTagSubifd.module:
	.asciz	"TIFFWriteDirectoryTagSubifd"

	.comm	_TIFF_BIGTIFF,4,2               ## @TIFF_BIGTIFF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Out of memory"

L_.str.1:                               ## @.str.1
	.asciz	"Illegal value for SubIFD tag"

	.comm	_TIFFTAG_SUBIFD,4,2             ## @TIFFTAG_SUBIFD
	.comm	_TIFF_INSUBIFD,4,2              ## @TIFF_INSUBIFD
	.no_dead_strip	_TIFFWriteDirectoryTagSubifd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function TIFFWriteDirectoryTagSubifd
_TIFFWriteDirectoryTagSubifd:           ; @TIFFWriteDirectoryTagSubifd
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldrsw	x4, [x0, #24]
	cbz	w4, LBB0_16
; %bb.1:
	mov	x21, x2
	mov	x20, x1
	cbz	x2, LBB0_6
; %bb.2:
	mov	x19, x0
	ldp	w23, w8, [x0]
Lloh0:
	adrp	x9, _TIFF_BIGTIFF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TIFF_BIGTIFF@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.3:
Lloh3:
	adrp	x8, _TIFFTAG_SUBIFD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TIFFTAG_SUBIFD@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	ldr	x5, [x19, #32]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_TIFFWriteDirectoryTagCheckedIfd8Array
	mov	x20, x0
	cbz	w20, LBB0_14
LBB0_4:
Lloh6:
	adrp	x8, _TIFF_INSUBIFD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TIFF_INSUBIFD@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
	ldrsw	x8, [x19, #24]
	str	x8, [x19, #8]
	cmp	w8, #1
	b.ne	LBB0_15
; %bb.5:
	str	wzr, [x19, #16]
	b	LBB0_16
LBB0_6:
	ldr	x8, [x20]
	add	x8, x8, #1
	str	x8, [x20]
	b	LBB0_16
LBB0_7:
	lsl	w0, w4, #3
	bl	__TIFFmalloc
	cbz	x0, LBB0_18
; %bb.8:
	mov	x22, x0
	ldr	w8, [x19, #24]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.9:
	mov	x24, #0
	ldr	x25, [x19, #32]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	cmp	x25, #0
	cset	w0, ne
	bl	_assert
	ldr	w8, [x25]
	tbnz	w8, #31, LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x25, x25, #4
	str	x8, [x22, x24, lsl #3]
	add	x24, x24, #1
	ldrsw	x8, [x19, #24]
	cmp	x24, x8
	b.lt	LBB0_10
; %bb.12:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
LBB0_13:
	sxtw	x4, w8
Lloh9:
	adrp	x8, _TIFFTAG_SUBIFD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TIFFTAG_SUBIFD@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	mov	x5, x22
	bl	_TIFFWriteDirectoryTagCheckedIfdArray
	mov	x20, x0
	mov	x0, x22
	bl	__TIFFfree
	cbnz	w20, LBB0_4
LBB0_14:
	mov	w0, #0
	b	LBB0_17
LBB0_15:
	str	w23, [x19, #16]
LBB0_16:
	mov	w0, #1
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_18:
	ldr	w0, [x19, #40]
Lloh12:
	adrp	x1, _TIFFWriteDirectoryTagSubifd.module@PAGE
Lloh13:
	add	x1, x1, _TIFFWriteDirectoryTagSubifd.module@PAGEOFF
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	bl	_TIFFErrorExt
	mov	w0, #0
	b	LBB0_17
LBB0_19:
	ldr	w0, [x19, #40]
Lloh16:
	adrp	x1, _TIFFWriteDirectoryTagSubifd.module@PAGE
Lloh17:
	add	x1, x1, _TIFFWriteDirectoryTagSubifd.module@PAGEOFF
Lloh18:
	adrp	x2, l_.str.1@PAGE
Lloh19:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_TIFFErrorExt
	mov	x0, x22
	bl	__TIFFfree
	mov	w0, #0
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_TIFFWriteDirectoryTagSubifd.module:    ; @TIFFWriteDirectoryTagSubifd.module
	.asciz	"TIFFWriteDirectoryTagSubifd"

	.comm	_TIFF_BIGTIFF,4,2               ; @TIFF_BIGTIFF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Out of memory"

l_.str.1:                               ; @.str.1
	.asciz	"Illegal value for SubIFD tag"

	.comm	_TIFFTAG_SUBIFD,4,2             ; @TIFFTAG_SUBIFD
	.comm	_TIFF_INSUBIFD,4,2              ; @TIFF_INSUBIFD
	.no_dead_strip	_TIFFWriteDirectoryTagSubifd
.subsections_via_symbols
