	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function put_qcd
_put_qcd:                               ## @put_qcd
	.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
	movl	8(%rdi), %ecx
	movq	_JPEG2000_QSTY_NONE@GOTPCREL(%rip), %r12
	xorl	%eax, %eax
	xorl	%edx, %edx
	cmpl	(%r12), %ecx
	movl	(%rdi), %esi
	sete	%al
	setne	%dl
	leal	(%rdx,%rdx,2), %ecx
	addl	$3, %ecx
	imull	32(%rdi), %ecx
	subl	4(%rdi), %esi
	leal	(%rcx,%rax,2), %edx
	incl	%edx
	movl	$-1, %r15d
	cmpl	%edx, %esi
	jl	LBB0_8
## %bb.1:
	movq	%rdi, %r13
	leal	(%rcx,%rax,2), %r15d
	decl	%r15d
	leaq	4(%rdi), %r14
	movq	_JPEG2000_QCD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_bytestream_put_be16
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_bytestream_put_be16
	movl	12(%r13), %esi
	shll	$5, %esi
	orl	8(%r13), %esi
	movq	%r14, %rdi
	callq	_bytestream_put_byte
	movl	8(%r13), %ecx
	movl	32(%r13), %eax
	leal	(%rax,%rax,2), %eax
	cmpl	(%r12), %ecx
	jne	LBB0_2
## %bb.5:
	xorl	%r15d, %r15d
	cmpl	$3, %eax
	jl	LBB0_8
## %bb.6:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rax
	movl	(%rax,%rbx,4), %esi
	shll	$3, %esi
	movq	%r14, %rdi
	callq	_bytestream_put_byte
	incq	%rbx
	movslq	32(%r13), %rax
	leaq	(%rax,%rax,2), %rax
	addq	$-2, %rax
	cmpq	%rax, %rbx
	jl	LBB0_7
	jmp	LBB0_8
LBB0_2:
	xorl	%r15d, %r15d
	cmpl	$3, %eax
	jl	LBB0_8
## %bb.3:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rax
	movq	24(%r13), %rcx
	movl	(%rax,%rbx,4), %esi
	shll	$11, %esi
	orl	(%rcx,%rbx,4), %esi
	movq	%r14, %rdi
	callq	_bytestream_put_be16
	incq	%rbx
	movslq	32(%r13), %rax
	leaq	(%rax,%rax,2), %rax
	addq	$-2, %rax
	cmpq	%rax, %rbx
	jl	LBB0_4
LBB0_8:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_JPEG2000_QSTY_NONE,4,2         ## @JPEG2000_QSTY_NONE
	.comm	_JPEG2000_QCD,4,2               ## @JPEG2000_QCD
	.no_dead_strip	_put_qcd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function put_qcd
_put_qcd:                               ; @put_qcd
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x22, _JPEG2000_QSTY_NONE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _JPEG2000_QSTY_NONE@GOTPAGEOFF]
	ldr	w8, [x0, #8]
	ldr	w9, [x22]
	ldr	w10, [x0, #32]
	mov	w11, #6
	mov	w12, #3
	cmp	w8, w9
	csel	w11, w12, w11, eq
	mul	w10, w10, w11
	sub	w11, w10, #1
	cmp	w8, w9
	csinc	w21, w11, w10, ne
	ldr	w8, [x0]
	mov	x20, x0
	ldr	w9, [x20, #4]!
	add	w10, w21, #2
	sub	w8, w8, w9
	cmp	w8, w10
	b.ge	LBB0_2
; %bb.1:
	mov	w0, #-1
	b	LBB0_10
LBB0_2:
	mov	x19, x0
Lloh2:
	adrp	x8, _JPEG2000_QCD@GOTPAGE
Lloh3:
	ldr	x8, [x8, _JPEG2000_QCD@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_bytestream_put_be16
	mov	x0, x20
	mov	x1, x21
	bl	_bytestream_put_be16
	ldp	w9, w8, [x19, #8]
	orr	w1, w9, w8, lsl #5
	mov	x0, x20
	bl	_bytestream_put_byte
	ldr	w9, [x19, #8]
	ldr	w10, [x22]
	ldr	w8, [x19, #32]
	add	w8, w8, w8, lsl #1
	cmp	w9, w10
	b.ne	LBB0_6
; %bb.3:
	cmp	w8, #3
	b.lt	LBB0_9
; %bb.4:
	mov	x21, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w8, [x8, x21, lsl #2]
	lsl	w1, w8, #3
	mov	x0, x20
	bl	_bytestream_put_byte
	add	x21, x21, #1
	ldrsw	x8, [x19, #32]
	add	x8, x8, x8, lsl #1
	sub	x8, x8, #2
	cmp	x21, x8
	b.lt	LBB0_5
	b	LBB0_9
LBB0_6:
	cmp	w8, #3
	b.lt	LBB0_9
; %bb.7:
	mov	x21, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x8, x21, #2
	ldp	x9, x10, [x19, #16]
	ldr	w9, [x9, x8]
	ldr	w8, [x10, x8]
	orr	w1, w8, w9, lsl #11
	mov	x0, x20
	bl	_bytestream_put_be16
	add	x21, x21, #1
	ldrsw	x8, [x19, #32]
	add	x8, x8, x8, lsl #1
	sub	x8, x8, #2
	cmp	x21, x8
	b.lt	LBB0_8
LBB0_9:
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_JPEG2000_QSTY_NONE,4,2         ; @JPEG2000_QSTY_NONE
	.comm	_JPEG2000_QCD,4,2               ; @JPEG2000_QCD
	.no_dead_strip	_put_qcd
.subsections_via_symbols
