	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__TIFFMergeFields               ## -- Begin function _TIFFMergeFields
	.p2align	4, 0x90
__TIFFMergeFields:                      ## @_TIFFMergeFields
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	$0, 24(%rdi)
	movq	8(%rdi), %rsi
	testq	%rsi, %rsi
	je	LBB0_3
## %bb.1:
	movq	(%r15), %rdx
	testq	%rdx, %rdx
	je	LBB0_3
## %bb.2:
	addq	%r14, %rdx
	leaq	__TIFFMergeFields.reason(%rip), %r8
	movq	%r15, %rdi
	movl	$8, %ecx
	callq	__TIFFCheckRealloc
	jmp	LBB0_4
LBB0_3:
	leaq	__TIFFMergeFields.reason(%rip), %rcx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	$8, %edx
	callq	__TIFFCheckMalloc
LBB0_4:
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	testq	%r14, %r14
	je	LBB0_11
## %bb.6:
	movq	_TIFF_ANY@GOTPCREL(%rip), %r12
	movq	%r14, %rbx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	addq	$4, %r13
	decq	%rbx
	je	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movl	(%r12), %edx
	movq	%r15, %rdi
	callq	_TIFFFindField
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	movq	%r13, (%rcx,%rax,8)
	incq	%rax
	movq	%rax, (%r15)
	jmp	LBB0_9
LBB0_13:
	movl	16(%r15), %edi
	leaq	__TIFFMergeFields.module(%rip), %rsi
	leaq	L_.str(%rip), %rdx
	callq	_TIFFErrorExt
	xorl	%r14d, %r14d
	jmp	LBB0_12
LBB0_10:
	movq	8(%r15), %rax
LBB0_11:
	movq	(%r15), %rsi
	movq	_tagCompare@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%rax, %rdi
	movl	$8, %edx
	callq	_qsort
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @_TIFFMergeFields.module
__TIFFMergeFields.module:
	.asciz	"_TIFFMergeFields"

	.p2align	4                               ## @_TIFFMergeFields.reason
__TIFFMergeFields.reason:
	.asciz	"for fields array"

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate fields array"

	.comm	_TIFF_ANY,4,2                   ## @TIFF_ANY
	.comm	_tagCompare,4,2                 ## @tagCompare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__TIFFMergeFields               ; -- Begin function _TIFFMergeFields
	.p2align	2
__TIFFMergeFields:                      ; @_TIFFMergeFields
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	str	xzr, [x0, #24]
	ldr	x1, [x0, #8]
	cbz	x1, LBB0_4
; %bb.1:
	ldr	x8, [x20]
	cbz	x8, LBB0_4
; %bb.2:
	add	x2, x8, x19
Lloh0:
	adrp	x4, __TIFFMergeFields.reason@PAGE
Lloh1:
	add	x4, x4, __TIFFMergeFields.reason@PAGEOFF
	mov	x0, x20
	mov	w3, #8
	bl	__TIFFCheckRealloc
	str	x0, [x20, #8]
	cbnz	x0, LBB0_5
LBB0_3:
	ldr	w0, [x20, #16]
Lloh2:
	adrp	x1, __TIFFMergeFields.module@PAGE
Lloh3:
	add	x1, x1, __TIFFMergeFields.module@PAGEOFF
Lloh4:
	adrp	x2, l_.str@PAGE
Lloh5:
	add	x2, x2, l_.str@PAGEOFF
	bl	_TIFFErrorExt
	mov	w19, #0
	b	LBB0_12
LBB0_4:
Lloh6:
	adrp	x3, __TIFFMergeFields.reason@PAGE
Lloh7:
	add	x3, x3, __TIFFMergeFields.reason@PAGEOFF
	mov	x0, x20
	mov	x1, x19
	mov	w2, #8
	bl	__TIFFCheckMalloc
	str	x0, [x20, #8]
	cbz	x0, LBB0_3
LBB0_5:
	cbz	x19, LBB0_11
; %bb.6:
Lloh8:
	adrp	x22, _TIFF_ANY@GOTPAGE
Lloh9:
	ldr	x22, [x22, _TIFF_ANY@GOTPAGEOFF]
	mov	x23, x19
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x21, x21, #4
	subs	x23, x23, #1
	b.eq	LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	ldr	w2, [x22]
	mov	x0, x20
	bl	_TIFFFindField
	cbnz	x0, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldp	x9, x8, [x20]
	str	x21, [x8, x9, lsl #3]
	add	x8, x9, #1
	str	x8, [x20]
	b	LBB0_7
LBB0_10:
	ldr	x0, [x20, #8]
LBB0_11:
	ldr	x1, [x20]
Lloh10:
	adrp	x8, _tagCompare@GOTPAGE
Lloh11:
	ldr	x8, [x8, _tagCompare@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
	mov	w2, #8
	bl	_qsort
LBB0_12:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
__TIFFMergeFields.module:               ; @_TIFFMergeFields.module
	.asciz	"_TIFFMergeFields"

__TIFFMergeFields.reason:               ; @_TIFFMergeFields.reason
	.asciz	"for fields array"

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate fields array"

	.comm	_TIFF_ANY,4,2                   ; @TIFF_ANY
	.comm	_tagCompare,4,2                 ; @tagCompare
.subsections_via_symbols
