	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function libopenjpeg_copy_to_packed16
_libopenjpeg_copy_to_packed16:          ## @libopenjpeg_copy_to_packed16
	.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	%rsi, %r15
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	24(%rdi), %edi
	callq	_av_pix_fmt_desc_get
	movl	(%r15), %ecx
	testl	%ecx, %ecx
	jle	LBB0_3
## %bb.1:
	movq	%rax, %rbx
	movq	(%rax), %rdx
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rdx,%r12,4), %rdi
	movq	8(%r15), %rax
	movslq	(%rax,%r12,4), %rax
	subq	%rax, %rdi
	movl	$8, %esi
	callq	_FFMIN
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_FFMAX
	movq	(%rbx), %rdx
	addl	(%rdx,%r12,4), %eax
	movl	%eax, -64(%rbp,%r12)
	incq	%r13
	movslq	(%r15), %rcx
	addq	$4, %r12
	cmpq	%rcx, %r13
	jl	LBB0_2
LBB0_3:
	movl	(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_14
## %bb.4:
	movq	16(%r14), %rdx
	movq	(%rdx), %r8
	movq	8(%r14), %r9
	movl	4(%r14), %edi
	xorl	%r10d, %r10d
	movl	%edi, %edx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r14), %eax
	movl	%edi, %edx
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	incl	%r10d
	cmpl	%eax, %r10d
	jge	LBB0_14
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
                                        ##       Child Loop BB0_9 Depth 3
	testl	%edx, %edx
	jle	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movslq	(%r9), %rsi
	movslq	%r10d, %rax
	imulq	%rsi, %rax
	addq	%r8, %rax
	imull	%r10d, %edx
	movslq	%edx, %rdx
	xorl	%r11d, %r11d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=2
	incl	%r11d
	incq	%rdx
	cmpl	%edi, %r11d
	jge	LBB0_12
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_9 Depth 3
	testl	%ecx, %ecx
	jle	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	movq	8(%r15), %rdi
	addq	$8, %rdi
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_7 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movzbl	-8(%rdi), %ecx
	movl	-4(%rdi), %ebx
	decb	%cl
	shll	%cl, %ebx
	movq	(%rdi), %rcx
	addl	(%rcx,%rdx,8), %ebx
	movzbl	-64(%rbp,%rsi,4), %ecx
	shll	%cl, %ebx
	movl	%ebx, (%rax)
	addq	$4, %rax
	incq	%rsi
	movslq	(%r15), %rcx
	addq	$16, %rdi
	cmpq	%rcx, %rsi
	jl	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=2
	movl	4(%r14), %edi
	jmp	LBB0_11
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_libopenjpeg_copy_to_packed16
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function libopenjpeg_copy_to_packed16
_libopenjpeg_copy_to_packed16:          ; @libopenjpeg_copy_to_packed16
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	w0, [x0, #24]
	bl	_av_pix_fmt_desc_get
	ldr	w12, [x19]
	cmp	w12, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x21, x0
	mov	x22, #0
	mov	x23, #0
	ldr	x8, [x0]
	add	x24, sp, #8
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x8, x8, x22
	ldr	x8, [x8, #8]
	ldr	x9, [x19, #8]
	ldrsw	x9, [x9, x22]
	sub	x0, x8, x9
	mov	w1, #8
	bl	_FFMIN
	mov	w1, #0
	bl	_FFMAX
	ldr	x8, [x21]
	ldr	w9, [x8, x22]
	add	w9, w9, w0
	str	w9, [x24, x23, lsl #2]
	add	x23, x23, #1
	ldrsw	x12, [x19]
	add	x22, x22, #16
	cmp	x23, x12
	b.lt	LBB0_2
; %bb.3:
                                        ; kill: def $w12 killed $w12 killed $x12 def $x12
LBB0_4:
	ldr	w14, [x20]
	cmp	w14, #1
	b.lt	LBB0_15
; %bb.5:
	mov	w8, #0
	ldp	x9, x10, [x20, #8]
	ldr	x10, [x10]
	ldr	w13, [x20, #4]
	add	x11, sp, #8
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	w14, [x20]
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	w8, w8, #1
	cmp	w8, w14
	b.ge	LBB0_15
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
                                        ;       Child Loop BB0_13 Depth 3
	cmp	w13, #1
	b.lt	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w14, #0
	ldrsw	x15, [x9]
	sxtw	x16, w8
	madd	x15, x15, x16, x10
	mul	w16, w13, w8
	sxtw	x16, w16
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=2
	add	w14, w14, #1
	add	x16, x16, #1
	cmp	w14, w13
	b.ge	LBB0_6
LBB0_11:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_13 Depth 3
	cmp	w12, #1
	b.lt	LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	mov	x13, #0
	ldr	x12, [x19, #8]
	add	x17, x12, #4
LBB0_13:                                ;   Parent Loop BB0_8 Depth=1
                                        ;     Parent Loop BB0_11 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldp	w12, w0, [x17, #-4]
	sub	w12, w12, #1
	lsl	w12, w0, w12
	ldur	x0, [x17, #4]
	ldr	x0, [x0, x16, lsl #3]
	add	w12, w12, w0
	ldr	w0, [x11, x13, lsl #2]
	lsl	w12, w12, w0
	str	w12, [x15], #4
	add	x13, x13, #1
	ldrsw	x12, [x19]
	add	x17, x17, #16
	cmp	x13, x12
	b.lt	LBB0_13
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=2
	ldr	w13, [x20, #4]
	b	LBB0_10
LBB0_15:
	ldr	x8, [sp, #24]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_libopenjpeg_copy_to_packed16
.subsections_via_symbols
