	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dnxhd_encode_thread
_dnxhd_encode_thread:                   ## @dnxhd_encode_thread
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movq	88(%rax), %rax
	movslq	%ecx, %rcx
	movq	(%rax,%rcx,8), %rbx
	leaq	64(%rbx), %r14
	movslq	(%rbx), %rax
	leaq	(%rsi,%rax,4), %rax
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movslq	%edx, %rcx
	movq	8(%rbx), %rdx
	movq	80(%rbx), %rdi
	movslq	(%rdx,%rcx,4), %rdx
	leaq	(%rax,%rdx,4), %rsi
	movl	(%rdi,%rcx,4), %edx
	movq	%r14, %rdi
	callq	_init_put_bits
	movb	16(%rbx), %cl
	addb	$2, %cl
	movl	$1, %eax
	shll	%cl, %eax
	movq	40(%rbx), %rcx
	movl	%eax, 8(%rcx)
	movl	%eax, 4(%rcx)
	movl	%eax, (%rcx)
	movl	48(%rbx), %eax
	testl	%eax, %eax
	jle	LBB0_9
## %bb.1:
	leaq	40(%rbx), %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	incl	%r12d
	movl	48(%rbx), %eax
	cmpl	%eax, %r12d
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jge	LBB0_9
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	imull	%r15d, %eax
	addl	%r12d, %eax
	movq	24(%rbx), %rcx
	movl	(%rcx,%rax,4), %edx
	movq	%r14, %rdi
	movl	$11, %esi
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	callq	_put_bits
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	xorl	%edx, %edx
	movq	_AV_PIX_FMT_YUV444P10@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%dl
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_put_bits
	movq	%rbx, %rdi
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	movl	%r12d, %esi
	movl	%r15d, %edx
	callq	_dnxhd_get_blocks
	cmpl	$-1, 32(%rbx)
	jl	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	movl	%r12d, %edx
	andl	$4, %edx
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	leaq	-84(%rbp), %r8
	callq	*56(%rbx)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	movl	%r13d, %ecx
	callq	_dnxhd_encode_block
	leaq	1(%r14), %rax
	movslq	32(%rbx), %rcx
	leaq	7(,%rcx,4), %rcx
	addl	$2, %r12d
	cmpq	%rcx, %r14
	movq	%rax, %r14
	jge	LBB0_8
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	72(%rbx), %rax
	movq	(%rax,%r14,8), %r15
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_dnxhd_switch_matrix
	movl	%eax, %r13d
	cmpl	$0, 32(%rbx)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%r14d, %eax
	shrl	%eax
	imull	$-1431655765, %eax, %eax        ## imm = 0xAAAAAAAB
	xorl	%edx, %edx
	cmpl	$1431655766, %eax               ## imm = 0x55555556
	setae	%dl
	shll	$2, %edx
	jmp	LBB0_7
LBB0_9:
	movq	%r14, %rdi
	callq	_put_bits_count
	testb	$31, %al
	je	LBB0_11
## %bb.10:
	movq	%r14, %rdi
	callq	_put_bits_count
	andl	$31, %eax
	movl	$32, %esi
	subl	%eax, %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_put_bits
LBB0_11:
	movq	%r14, %rdi
	callq	_flush_put_bits
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_PIX_FMT_YUV444P10,8,3       ## @AV_PIX_FMT_YUV444P10
	.no_dead_strip	_dnxhd_encode_thread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dnxhd_encode_thread
_dnxhd_encode_thread:                   ; @dnxhd_encode_thread
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
                                        ; kill: def $w2 killed $w2 def $x2
	stp	x0, x2, [sp, #8]                ; 16-byte Folded Spill
	ldr	x8, [x0, #8]
	ldr	x8, [x8, #88]
	ldr	x22, [x8, w3, sxtw #3]
	add	x20, x22, #64
	ldrsw	x8, [x22]
	add	x8, x1, x8, lsl #2
	ldr	x9, [x22, #8]
	sbfiz	x10, x2, #2, #32
	ldrsw	x9, [x9, x10]
	add	x1, x8, x9, lsl #2
	ldr	x8, [x22, #80]
	ldr	w2, [x8, x10]
	mov	x0, x20
	bl	_init_put_bits
	mov	x23, x22
	ldr	x8, [x23, #40]!
	ldr	w9, [x22, #16]
	add	w9, w9, #2
	mov	w10, #1
	lsl	w9, w10, w9
	stp	w9, w9, [x8, #4]
	str	w9, [x8]
	ldr	w8, [x22, #48]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w24, #0
	mov	w21, #43691
	movk	w21, #43690, lsl #16
	mov	w19, #1431655765
	str	x20, [sp]                       ; 8-byte Folded Spill
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w24, w24, #1
	ldr	w8, [x22, #48]
	cmp	w24, w8
	ldr	x20, [sp]                       ; 8-byte Folded Reload
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldr	x26, [sp, #16]                  ; 8-byte Folded Reload
	madd	w8, w8, w26, w24
	ldr	x9, [x22, #24]
	ldr	w25, [x9, w8, uxtw #2]
	mov	x0, x20
	mov	w1, #11
	mov	x2, x25
	bl	_put_bits
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _AV_PIX_FMT_YUV444P10@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AV_PIX_FMT_YUV444P10@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w2, eq
	mov	x0, x20
	mov	w1, #1
	bl	_put_bits
	mov	x0, x22
	mov	x1, x24
	mov	x2, x26
	bl	_dnxhd_get_blocks
	ldr	w8, [x22, #32]
	cmn	w8, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w20, #0
	mov	x26, #0
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x22, #72]
	ldr	x27, [x8, x26, lsl #3]
	mov	x0, x22
	mov	x1, x26
	bl	_dnxhd_switch_matrix
	mov	x28, x0
	ldr	x8, [x22, #56]
	ldr	w9, [x22, #32]
	and	w10, w20, #0x4
	ubfx	x11, x26, #1, #31
	mul	w11, w11, w21
	cmp	w11, w19
	cset	w11, hi
	lsl	w11, w11, #2
	cmp	w9, #0
	csel	w2, w10, w11, eq
	add	x4, sp, #28
	mov	x0, x23
	mov	x1, x27
	mov	x3, x25
	blr	x8
	mov	x2, x0
	mov	x0, x22
	mov	x1, x27
	mov	x3, x28
	bl	_dnxhd_encode_block
	add	x8, x26, #1
	ldrsw	x9, [x22, #32]
	lsl	x9, x9, #2
	add	x9, x9, #7
	add	w20, w20, #2
	cmp	x26, x9
	mov	x26, x8
	b.lt	LBB0_5
	b	LBB0_2
LBB0_6:
	mov	x0, x20
	bl	_put_bits_count
	tst	w0, #0x1f
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x20
	bl	_put_bits_count
	and	w8, w0, #0x1f
	mov	w9, #32
	sub	w1, w9, w8
	mov	x0, x20
	mov	w2, #0
	bl	_put_bits
LBB0_8:
	mov	x0, x20
	bl	_flush_put_bits
	mov	w0, #0
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_PIX_FMT_YUV444P10,8,3       ; @AV_PIX_FMT_YUV444P10
	.no_dead_strip	_dnxhd_encode_thread
.subsections_via_symbols
