	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_qcx
_get_qcx:                               ## @get_qcx
	.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	%rdx, %r15
	movl	%esi, %r12d
	movq	%rdi, %r14
	callq	_bytestream2_get_bytes_left
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	callq	_bytestream2_get_byteu
	movl	%eax, %ecx
	sarl	$5, %ecx
	movl	%ecx, (%r15)
	andl	$31, %eax
	movl	%eax, 4(%r15)
	movq	_JPEG2000_QSTY_NONE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_8
## %bb.3:
	leal	-3(%r12), %ebx
	movq	%r14, %rdi
	callq	_bytestream2_get_bytes_left
	cmpl	%ebx, %eax
	jl	LBB0_1
## %bb.4:
	movq	_JPEG2000_MAX_DECLEVELS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%rax,2), %eax
	cmpl	%eax, %ebx
	jg	LBB0_1
## %bb.5:
	xorl	%r13d, %r13d
	cmpl	$4, %r12d
	jl	LBB0_18
## %bb.6:
	movl	%ebx, %r12d
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_bytestream2_get_byteu
	sarl	$3, %eax
	movq	8(%r15), %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_7
	jmp	LBB0_18
LBB0_8:
	movq	_JPEG2000_QSTY_SI@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_13
## %bb.9:
	movq	%r14, %rdi
	callq	_bytestream2_get_bytes_left
	cmpl	$1, %eax
	jle	LBB0_1
## %bb.10:
	movq	%r14, %rdi
	callq	_bytestream2_get_be16u
	movl	%eax, %edx
	sarl	$11, %edx
	movq	8(%r15), %rcx
	movl	%edx, (%rcx)
	andl	$2047, %eax                     ## imm = 0x7FF
	movq	16(%r15), %rdx
	movl	%eax, (%rdx)
	movq	_JPEG2000_MAX_DECLEVELS@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	leal	(%rax,%rax,2), %eax
	xorl	%r13d, %r13d
	cmpl	$2, %eax
	jl	LBB0_18
## %bb.11:
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	leaq	-1(%rbx), %rax
	cltq
	imulq	$1431655765, %rax, %rsi         ## imm = 0x55555555
	shrq	$32, %rsi
	subl	%eax, %esi
	movl	%esi, %eax
	shrl	$31, %eax
	sarl	%esi
	addl	%eax, %esi
	addl	(%rcx), %esi
	xorl	%r13d, %r13d
	xorl	%edi, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_FFMAX
	movq	8(%r15), %rcx
	movl	%eax, (%rcx,%rbx,4)
	movq	16(%r15), %rax
	movl	(%rax), %edx
	movl	%edx, (%rax,%rbx,4)
	incq	%rbx
	movslq	(%r14), %rax
	leaq	(%rax,%rax,2), %rax
	cmpq	%rax, %rbx
	jl	LBB0_12
	jmp	LBB0_18
LBB0_13:
	leal	-3(%r12), %ebx
	movq	%r14, %rdi
	callq	_bytestream2_get_bytes_left
	movl	%ebx, %ecx
	andl	$-2, %ecx
	cmpl	%ecx, %eax
	jl	LBB0_1
## %bb.14:
	sarl	%ebx
	movq	_JPEG2000_MAX_DECLEVELS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%rax,2), %eax
	cmpl	%eax, %ebx
	jle	LBB0_15
LBB0_1:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_18:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	xorl	%r13d, %r13d
	cmpl	$5, %r12d
	jl	LBB0_18
## %bb.16:
	cmpl	$2, %ebx
	movl	$1, %r12d
	cmovgel	%ebx, %r12d
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_bytestream2_get_be16u
	movl	%eax, %ecx
	sarl	$11, %ecx
	movq	8(%r15), %rdx
	movl	%ecx, (%rdx,%rbx,4)
	andl	$2047, %eax                     ## imm = 0x7FF
	movq	16(%r15), %rcx
	movl	%eax, (%rcx,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_17
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_JPEG2000_QSTY_NONE,4,2         ## @JPEG2000_QSTY_NONE
	.comm	_JPEG2000_MAX_DECLEVELS,4,2     ## @JPEG2000_MAX_DECLEVELS
	.comm	_JPEG2000_QSTY_SI,4,2           ## @JPEG2000_QSTY_SI
	.no_dead_strip	_get_qcx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_qcx
_get_qcx:                               ; @get_qcx
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	bl	_bytestream2_get_bytes_left
	cmp	w0, #0
	b.le	LBB0_14
; %bb.1:
	mov	x0, x20
	bl	_bytestream2_get_byteu
	asr	w9, w0, #5
	and	w8, w0, #0x1f
	stp	w9, w8, [x19]
Lloh0:
	adrp	x9, _JPEG2000_QSTY_NONE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _JPEG2000_QSTY_NONE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.2:
	sub	w22, w21, #3
	mov	x0, x20
	bl	_bytestream2_get_bytes_left
	cmp	w0, w22
	b.lt	LBB0_14
; %bb.3:
Lloh3:
	adrp	x8, _JPEG2000_MAX_DECLEVELS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _JPEG2000_MAX_DECLEVELS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w8, w8, w8, lsl #1
	cmp	w22, w8
	b.gt	LBB0_14
; %bb.4:
	cmp	w21, #4
	b.lt	LBB0_19
; %bb.5:
	mov	x21, #0
	lsl	x22, x22, #2
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_bytestream2_get_byteu
	asr	w8, w0, #3
	ldr	x9, [x19, #8]
	str	w8, [x9, x21]
	add	x21, x21, #4
	cmp	x22, x21
	b.ne	LBB0_6
	b	LBB0_19
LBB0_7:
Lloh6:
	adrp	x9, _JPEG2000_QSTY_SI@GOTPAGE
Lloh7:
	ldr	x9, [x9, _JPEG2000_QSTY_SI@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.8:
	mov	x0, x20
	bl	_bytestream2_get_bytes_left
	cmp	w0, #1
	b.le	LBB0_14
; %bb.9:
	mov	x0, x20
	bl	_bytestream2_get_be16u
	asr	w9, w0, #11
	ldp	x8, x10, [x19, #8]
	str	w9, [x8]
	and	w9, w0, #0x7ff
	str	w9, [x10]
Lloh9:
	adrp	x20, _JPEG2000_MAX_DECLEVELS@GOTPAGE
Lloh10:
	ldr	x20, [x20, _JPEG2000_MAX_DECLEVELS@GOTPAGEOFF]
	ldr	w9, [x20]
	add	w9, w9, w9, lsl #1
	cmp	w9, #2
	b.lt	LBB0_19
; %bb.10:
	mov	w21, #1
	mov	w22, #1431655765
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x8]
	sub	x9, x21, #1
	smull	x10, w9, w22
	lsr	x10, x10, #32
	sub	w9, w10, w9
	asr	w10, w9, #1
	add	w9, w10, w9, lsr #31
	add	w1, w8, w9
	mov	w0, #0
	bl	_FFMAX
	lsl	x9, x21, #2
	ldp	x8, x10, [x19, #8]
	str	w0, [x8, x9]
	ldr	w11, [x10]
	str	w11, [x10, x9]
	add	x21, x21, #1
	ldrsw	x9, [x20]
	add	x9, x9, x9, lsl #1
	cmp	x21, x9
	b.lt	LBB0_11
	b	LBB0_19
LBB0_12:
	sub	w22, w21, #3
	mov	x0, x20
	bl	_bytestream2_get_bytes_left
	and	w8, w22, #0xfffffffe
	cmp	w0, w8
	b.lt	LBB0_14
; %bb.13:
	asr	w8, w22, #1
Lloh11:
	adrp	x9, _JPEG2000_MAX_DECLEVELS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _JPEG2000_MAX_DECLEVELS@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	add	w9, w9, w9, lsl #1
	cmp	w8, w9
	b.le	LBB0_16
LBB0_14:
Lloh14:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
LBB0_15:
	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
LBB0_16:
	cmp	w21, #5
	b.lt	LBB0_19
; %bb.17:
	mov	x21, #0
	cmp	w8, #1
	csinc	w8, w8, wzr, gt
	lsl	x22, x8, #2
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_bytestream2_get_be16u
	mov	x8, x0
	mov	w0, #0
	asr	w9, w8, #11
	ldp	x10, x11, [x19, #8]
	str	w9, [x10, x21]
	and	w8, w8, #0x7ff
	str	w8, [x11, x21]
	add	x21, x21, #4
	cmp	x22, x21
	b.ne	LBB0_18
	b	LBB0_15
LBB0_19:
	mov	w0, #0
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_JPEG2000_QSTY_NONE,4,2         ; @JPEG2000_QSTY_NONE
	.comm	_JPEG2000_MAX_DECLEVELS,4,2     ; @JPEG2000_MAX_DECLEVELS
	.comm	_JPEG2000_QSTY_SI,4,2           ; @JPEG2000_QSTY_SI
	.no_dead_strip	_get_qcx
.subsections_via_symbols
