	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function libopenjpeg_copyto16
_libopenjpeg_copyto16:                  ## @libopenjpeg_copyto16
	.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	$40, %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	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	16(%rdi), %edi
	callq	_av_pix_fmt_desc_get
	cmpl	$0, (%r15)
	jle	LBB0_14
## %bb.1:
	movq	%rax, %r12
	movq	(%rax), %rdx
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rdx,%rbx,4), %rdi
	movq	8(%r15), %rax
	movslq	(%rax,%rbx,8), %rax
	subq	%rax, %rdi
	movl	$8, %esi
	callq	_FFMIN
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_FFMAX
	movq	(%r12), %rdx
	addl	(%rdx,%rbx,4), %eax
	movl	%eax, -64(%rbp,%rbx)
	incq	%r13
	movslq	(%r15), %rcx
	addq	$4, %rbx
	cmpq	%rcx, %r13
	jl	LBB0_2
## %bb.3:
	testl	%ecx, %ecx
	jle	LBB0_14
## %bb.4:
	movq	8(%r15), %r8
	xorl	%r11d, %r11d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r15), %ecx
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	%r11
	movslq	%ecx, %rax
	cmpq	%rax, %r11
	jge	LBB0_14
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
                                        ##       Child Loop BB0_9 Depth 3
	movq	%r11, %rsi
	shlq	$5, %rsi
	movl	16(%r8,%rsi), %eax
	testl	%eax, %eax
	jle	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	leaq	(%r8,%rsi), %rdi
	addq	$16, %rdi
	leaq	(%r8,%rsi), %r13
	movq	8(%r8,%rsi), %rdx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %r9
	movq	8(%rcx), %rcx
	movq	(%rcx,%r11,8), %r10
	movl	20(%r8,%rsi), %ecx
	xorl	%r12d, %r12d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=2
	incl	%r12d
	cmpl	%eax, %r12d
	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
	movslq	(%r9,%r11,4), %rax
	movslq	%r12d, %rsi
	imulq	%rax, %rsi
	addq	%r10, %rsi
	movl	-64(%rbp,%r11,4), %eax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_5 Depth=1
                                        ##     Parent Loop BB0_7 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movzbl	(%r13), %ecx
	movl	8(%rdi), %r14d
	decb	%cl
	shll	%cl, %r14d
	addl	(%rdx), %r14d
	movl	%eax, %ecx
	shll	%cl, %r14d
	movl	%r14d, (%rsi)
	addq	$4, %rsi
	addq	$4, %rdx
	incl	%ebx
	movl	4(%rdi), %ecx
	cmpl	%ecx, %ebx
	jl	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=2
	movl	(%rdi), %eax
	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	$40, %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_copyto16
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function libopenjpeg_copyto16
_libopenjpeg_copyto16:                  ; @libopenjpeg_copyto16
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	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, #16]
	bl	_av_pix_fmt_desc_get
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x21, x0
	mov	x22, #0
	mov	x23, #0
	mov	x24, #0
	ldr	x8, [x0]
	add	x25, sp, #8
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x8, x8, x23
	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, x23]
	add	w9, w9, w0
	str	w9, [x25, x24, lsl #2]
	add	x24, x24, #1
	ldrsw	x13, [x19]
	add	x23, x23, #16
	add	x22, x22, #32
	cmp	x24, x13
	b.lt	LBB0_2
; %bb.3:
	cmp	w13, #1
	b.lt	LBB0_14
; %bb.4:
	mov	x8, #0
	ldr	x9, [x19, #8]
	add	x10, sp, #8
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w13, [x19]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x8, x8, #1
	cmp	x8, w13, sxtw
	b.ge	LBB0_14
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
                                        ;       Child Loop BB0_12 Depth 3
	add	x11, x9, x8, lsl #5
	mov	x12, x11
	ldr	w1, [x12, #16]!
	cmp	w1, #1
	b.lt	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w13, #0
	ldr	x14, [x11, #8]
	ldp	x15, x16, [x20]
	ldr	x16, [x16, x8, lsl #3]
	mov	x17, x11
	ldr	w2, [x17, #20]!
	add	x0, x11, #24
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	add	w13, w13, #1
	cmp	w13, w1
	b.ge	LBB0_5
LBB0_10:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_12 Depth 3
	cmp	w2, #1
	b.lt	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	w1, #0
	lsl	x2, x8, #2
	ldrsw	x3, [x15, x2]
	sxtw	x4, w13
	madd	x3, x3, x4, x16
	ldr	w4, [x10, x2]
LBB0_12:                                ;   Parent Loop BB0_7 Depth=1
                                        ;     Parent Loop BB0_10 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w2, [x11]
	sub	w2, w2, #1
	ldr	w5, [x0]
	lsl	w2, w5, w2
	ldr	w5, [x14], #4
	add	w2, w2, w5
	lsl	w2, w2, w4
	str	w2, [x3], #4
	add	w1, w1, #1
	ldr	w2, [x17]
	cmp	w1, w2
	b.lt	LBB0_12
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	w1, [x12]
	b	LBB0_9
LBB0_14:
	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_16
; %bb.15:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_libopenjpeg_copyto16
.subsections_via_symbols
