	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function TIFFWriteDirectoryTagShortPerSample
_TIFFWriteDirectoryTagShortPerSample:   ## @TIFFWriteDirectoryTagShortPerSample
	.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	%rsi, %r15
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	%r8, %rbx
	movq	%rdx, %r12
	movq	%rdi, %r13
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %edi
	shll	$3, %edi
	callq	__TIFFmalloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.3:
	movq	%rax, %r14
	movslq	(%r13), %r8
	testq	%r8, %r8
	jle	LBB0_17
## %bb.4:
	cmpl	$4, %r8d
	jae	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	movq	%r14, %rcx
	jmp	LBB0_15
LBB0_1:
	incl	(%r15)
	movl	$1, %eax
	jmp	LBB0_18
LBB0_19:
	movl	4(%r13), %edi
	leaq	_TIFFWriteDirectoryTagShortPerSample.module(%rip), %rsi
	leaq	L_.str(%rip), %rdx
	callq	_TIFFErrorExt
	xorl	%eax, %eax
	jmp	LBB0_18
LBB0_6:
	movq	%r8, %rax
	andq	$-4, %rax
	movq	%rbx, %xmm0
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	leaq	-4(%rax), %rsi
	movq	%rsi, %rdx
	shrq	$2, %rdx
	incq	%rdx
	movl	%edx, %ecx
	andl	$7, %ecx
	cmpq	$28, %rsi
	jae	LBB0_8
## %bb.7:
	xorl	%esi, %esi
	jmp	LBB0_10
LBB0_8:
	andq	$-8, %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%r14,%rsi,8)
	movdqu	%xmm0, 16(%r14,%rsi,8)
	movdqu	%xmm0, 32(%r14,%rsi,8)
	movdqu	%xmm0, 48(%r14,%rsi,8)
	movdqu	%xmm0, 64(%r14,%rsi,8)
	movdqu	%xmm0, 80(%r14,%rsi,8)
	movdqu	%xmm0, 96(%r14,%rsi,8)
	movdqu	%xmm0, 112(%r14,%rsi,8)
	movdqu	%xmm0, 128(%r14,%rsi,8)
	movdqu	%xmm0, 144(%r14,%rsi,8)
	movdqu	%xmm0, 160(%r14,%rsi,8)
	movdqu	%xmm0, 176(%r14,%rsi,8)
	movdqu	%xmm0, 192(%r14,%rsi,8)
	movdqu	%xmm0, 208(%r14,%rsi,8)
	movdqu	%xmm0, 224(%r14,%rsi,8)
	movdqu	%xmm0, 240(%r14,%rsi,8)
	addq	$32, %rsi
	addq	$-8, %rdx
	jne	LBB0_9
LBB0_10:
	testq	%rcx, %rcx
	je	LBB0_13
## %bb.11:
	leaq	(%r14,%rsi,8), %rdx
	addq	$16, %rdx
	shlq	$5, %rcx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -16(%rdx,%rsi)
	movdqu	%xmm0, (%rdx,%rsi)
	addq	$32, %rsi
	cmpq	%rsi, %rcx
	jne	LBB0_12
LBB0_13:
	cmpq	%r8, %rax
	je	LBB0_17
## %bb.14:
	leaq	(%r14,%rax,8), %rcx
LBB0_15:
	movq	%r8, %rdx
	subq	%rax, %rdx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, (%rcx,%rax,8)
	incq	%rax
	cmpq	%rax, %rdx
	jne	LBB0_16
LBB0_17:
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%r14, %r9
	callq	_TIFFWriteDirectoryTagCheckedShortArray
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	__TIFFfree
	movl	%ebx, %eax
LBB0_18:
	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                               ## @TIFFWriteDirectoryTagShortPerSample.module
_TIFFWriteDirectoryTagShortPerSample.module:
	.asciz	"TIFFWriteDirectoryTagShortPerSample"

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Out of memory"

	.no_dead_strip	_TIFFWriteDirectoryTagShortPerSample
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function TIFFWriteDirectoryTagShortPerSample
_TIFFWriteDirectoryTagShortPerSample:   ; @TIFFWriteDirectoryTagShortPerSample
	.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	x20, x1
	cbz	x2, LBB0_5
; %bb.1:
	mov	x22, x4
	mov	x19, x3
	mov	x21, x2
	mov	x23, x0
	ldr	w8, [x0]
	lsl	w0, w8, #3
	bl	__TIFFmalloc
	cbz	x0, LBB0_6
; %bb.2:
	mov	x24, x0
	ldrsw	x4, [x23]
	cmp	w4, #1
	b.lt	LBB0_12
; %bb.3:
	cmp	w4, #8
	b.hs	LBB0_7
; %bb.4:
	mov	x9, #0
	mov	x8, x24
	b	LBB0_10
LBB0_5:
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
	mov	w0, #1
	b	LBB0_13
LBB0_6:
	ldr	w0, [x23, #4]
Lloh0:
	adrp	x1, _TIFFWriteDirectoryTagShortPerSample.module@PAGE
Lloh1:
	add	x1, x1, _TIFFWriteDirectoryTagShortPerSample.module@PAGEOFF
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	bl	_TIFFErrorExt
	mov	w0, #0
	b	LBB0_13
LBB0_7:
	and	x9, x4, #0xfffffffffffffff8
	add	x8, x24, x9, lsl #3
	dup.2d	v0, x22
	add	x10, x24, #32
	mov	x11, x9
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x10, #-32]
	stp	q0, q0, [x10], #64
	subs	x11, x11, #8
	b.ne	LBB0_8
; %bb.9:
	cmp	x9, x4
	b.eq	LBB0_12
LBB0_10:
	sub	x9, x4, x9
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	str	x22, [x8], #8
	subs	x9, x9, #1
	b.ne	LBB0_11
LBB0_12:
	mov	x0, x23
	mov	x1, x20
	mov	x2, x21
	mov	x3, x19
	mov	x5, x24
	bl	_TIFFWriteDirectoryTagCheckedShortArray
	mov	x19, x0
	mov	x0, x24
	bl	__TIFFfree
	mov	x0, x19
LBB0_13:
	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	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_TIFFWriteDirectoryTagShortPerSample.module: ; @TIFFWriteDirectoryTagShortPerSample.module
	.asciz	"TIFFWriteDirectoryTagShortPerSample"

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Out of memory"

	.no_dead_strip	_TIFFWriteDirectoryTagShortPerSample
.subsections_via_symbols
