	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function php_handle_jp2
_php_handle_jp2:                        ## @php_handle_jp2
	.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
	movq	%rdi, %r13
	movl	$1664249962, -52(%rbp)          ## imm = 0x6332706A
	leaq	-56(%rbp), %r15
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	-52(%rbp), %r12
	movq	_SEEK_CUR@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_php_read4
	movl	%eax, %ebx
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	$4, %edx
	callq	_php_stream_read
	cmpl	$4, %eax
	jne	LBB0_7
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$1, %ebx
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_memcmp
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%ebx, %ebx
	jle	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	addl	$-8, %ebx
	movl	(%r14), %edx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_php_stream_seek
	testq	%rax, %rax
	je	LBB0_1
	jmp	LBB0_7
LBB0_6:
	movl	(%r14), %edx
	movq	%r13, %rdi
	movl	$3, %esi
	callq	_php_stream_seek
	movq	%r13, %rdi
	callq	_php_handle_jpc
	movq	%rax, %rcx
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	jne	LBB0_8
LBB0_7:
	movq	_E_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%edi, %edi
	callq	_php_error_docref
LBB0_8:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.comm	_E_WARNING,4,2                  ## @E_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"JP2 file has no codestreams at root level"

	.no_dead_strip	_php_handle_jp2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function php_handle_jp2
_php_handle_jp2:                        ; @php_handle_jp2
	.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, x0
	mov	w8, #28778
	movk	w8, #25394, lsl #16
	str	w8, [sp, #8]
Lloh0:
	adrp	x21, _SEEK_CUR@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SEEK_CUR@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_php_read4
	mov	x20, x0
	add	x1, sp, #12
	mov	x0, x19
	mov	w2, #4
	bl	_php_stream_read
	cmp	w0, #4
	b.ne	LBB0_7
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w20, #1
	b.eq	LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	add	x0, sp, #12
	add	x1, sp, #8
	mov	w2, #4
	bl	_memcmp
	cbz	w0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w20, #1
	b.lt	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	sub	w1, w20, #8
	ldr	w2, [x21]
	mov	x0, x19
	bl	_php_stream_seek
	cbz	x0, LBB0_1
	b	LBB0_7
LBB0_6:
	ldr	w2, [x21]
	mov	x0, x19
	mov	w1, #3
	bl	_php_stream_seek
	mov	x0, x19
	bl	_php_handle_jpc
	cbnz	x0, LBB0_9
LBB0_7:
Lloh2:
	adrp	x8, _E_WARNING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _E_WARNING@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, #0
	bl	_php_error_docref
LBB0_8:
	mov	x0, #0
LBB0_9:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.comm	_E_WARNING,4,2                  ; @E_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"JP2 file has no codestreams at root level"

	.no_dead_strip	_php_handle_jp2
.subsections_via_symbols
