	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__TIFFReadEncodedTileAndAllocBuffer ## -- Begin function _TIFFReadEncodedTileAndAllocBuffer
	.p2align	4, 0x90
__TIFFReadEncodedTileAndAllocBuffer:    ## @_TIFFReadEncodedTileAndAllocBuffer
	.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	%r8, %r13
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	(%rdx), %rdx
	testq	%rdx, %rdx
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r13, %rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_TIFFReadEncodedTile            ## TAILCALL
LBB0_2:
	movq	%rcx, %r14
	movq	(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_TIFFCheckRead
	movq	$-1, %rcx
	testl	%eax, %eax
	je	LBB0_14
## %bb.3:
	movq	32(%rbx), %r8
	cmpq	%r12, %r8
	jle	LBB0_8
## %bb.4:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_TIFFFillTile
	testl	%eax, %eax
	je	LBB0_9
## %bb.5:
	movq	%r14, %rdi
	callq	__TIFFmalloc
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_10
## %bb.6:
	movq	%rax, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	__TIFFmemset
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	%r13, %rax
	movq	%r13, %r14
	cmovlq	%rax, %r14
	cmpq	$-1, %r13
	cmoveq	%rax, %r14
	movq	16(%rbx), %r8
	movq	40(%rbx), %rcx
	movq	(%r15), %rsi
	movq	%r12, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_11
## %bb.7:
	movq	%r12, %rax
	cqto
	idivq	%rcx
	jmp	LBB0_12
LBB0_8:
	movl	24(%rbx), %edi
	leaq	__TIFFReadEncodedTileAndAllocBuffer.module(%rip), %rsi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_TIFFErrorExt
LBB0_9:
	movq	$-1, %rcx
LBB0_14:
	movq	%rcx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	24(%rbx), %r14d
	movq	%rbx, %rdi
	callq	_TIFFFileName
	movslq	%eax, %rsi
	leaq	L_.str.1(%rip), %rdx
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_TIFFErrorExt
	movq	$-1, %rcx
	jmp	LBB0_14
LBB0_11:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_12:
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movl	%eax, %ecx
	callq	*%r8
	testq	%rax, %rax
	movq	$-1, %rcx
	je	LBB0_14
## %bb.13:
	movq	(%r15), %rsi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	callq	*8(%rbx)
	movq	%r14, %rcx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @_TIFFReadEncodedTileAndAllocBuffer.module
__TIFFReadEncodedTileAndAllocBuffer.module:
	.asciz	"_TIFFReadEncodedTileAndAllocBuffer"

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%lu: Tile out of range, max %lu"

L_.str.1:                               ## @.str.1
	.asciz	"No space for tile buffer"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__TIFFReadEncodedTileAndAllocBuffer ; -- Begin function _TIFFReadEncodedTileAndAllocBuffer
	.p2align	2
__TIFFReadEncodedTileAndAllocBuffer:    ; @_TIFFReadEncodedTileAndAllocBuffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x22, x4
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x2, [x2]
	cbz	x2, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x21
	mov	x3, x22
	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
	add	sp, sp, #80
	b	_TIFFReadEncodedTile
LBB0_2:
	mov	x23, x3
	ldr	x24, [x19]
	mov	x0, x19
	mov	w1, #1
	bl	_TIFFCheckRead
	cbz	w0, LBB0_10
; %bb.3:
	ldr	x8, [x19, #32]
	cmp	x8, x21
	b.le	LBB0_8
; %bb.4:
	mov	x0, x19
	mov	x1, x21
	bl	_TIFFFillTile
	cbz	w0, LBB0_10
; %bb.5:
	mov	x0, x23
	bl	__TIFFmalloc
	str	x0, [x20]
	cbz	x0, LBB0_12
; %bb.6:
	mov	w1, #0
	mov	x2, x23
	bl	__TIFFmemset
	cmp	x24, x22
	csel	x8, x24, x22, lt
	cmn	x22, #1
	csel	x22, x24, x8, eq
	ldr	x8, [x19, #16]
	ldr	x1, [x20]
	ldr	x9, [x19, #40]
	sdiv	x3, x21, x9
	mov	x0, x19
	mov	x2, x22
                                        ; kill: def $w3 killed $w3 killed $x3
	blr	x8
	cbz	x0, LBB0_10
; %bb.7:
	ldr	x8, [x19, #8]
	ldr	x1, [x20]
	mov	x0, x19
	mov	x2, x22
	blr	x8
	b	LBB0_11
LBB0_8:
	ldr	w0, [x19, #24]
Lloh0:
	adrp	x1, __TIFFReadEncodedTileAndAllocBuffer.module@PAGE
Lloh1:
	add	x1, x1, __TIFFReadEncodedTileAndAllocBuffer.module@PAGEOFF
	stp	x21, x8, [sp]
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
LBB0_9:
	bl	_TIFFErrorExt
LBB0_10:
	mov	x22, #-1
LBB0_11:
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
LBB0_12:
	ldr	w20, [x19, #24]
	mov	x0, x19
	bl	_TIFFFileName
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x1, w0
Lloh4:
	adrp	x2, l_.str.1@PAGE
Lloh5:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x20
	b	LBB0_9
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
__TIFFReadEncodedTileAndAllocBuffer.module: ; @_TIFFReadEncodedTileAndAllocBuffer.module
	.asciz	"_TIFFReadEncodedTileAndAllocBuffer"

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%lu: Tile out of range, max %lu"

l_.str.1:                               ; @.str.1
	.asciz	"No space for tile buffer"

.subsections_via_symbols
