	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxf_write_d10_audio_packet
_mxf_write_d10_audio_packet:            ## @mxf_write_d10_audio_packet
	.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, %rcx
	movq	%rsi, %r14
	movq	(%rdi), %r15
	movq	8(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movslq	(%rdx), %r13
	movq	(%rsi), %rsi
	movl	%r13d, %eax
	cltd
	idivl	(%rsi)
	movl	%eax, %ebx
	movq	8(%rcx), %r12
	movl	%eax, %esi
	shll	$5, %esi
	orl	$4, %esi
	movq	%r15, %rdi
	callq	_klv_encode_ber4_length
	xorl	%esi, %esi
	cmpl	$1920, %ebx                     ## imm = 0x780
	je	LBB0_2
## %bb.1:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	decl	%eax
	movslq	%eax, %rsi
	imulq	$1717986919, %rsi, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$33, %rax
	addl	%ecx, %eax
	leal	(%rax,%rax,4), %eax
	subl	%eax, %esi
	incl	%esi
LBB0_2:
	movq	%r15, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_avio_w8
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_avio_wl16
	movq	(%r14), %rax
	movb	4(%rax), %cl
	movl	$-1, %esi
	shll	%cl, %esi
	notl	%esi
	movq	%r15, %rdi
	callq	_avio_w8
	testl	%r13d, %r13d
	jle	LBB0_15
## %bb.3:
	leaq	(%r12,%r13,4), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	cmpq	-48(%rbp), %r12                 ## 8-byte Folded Reload
	jae	LBB0_15
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
                                        ##     Child Loop BB0_7 Depth 2
	movq	(%r14), %rax
	cmpl	$0, 4(%rax)
	jle	LBB0_6
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	$-1, %r13d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=2
	movq	%r12, %rdi
	callq	_AV_RL16
	movl	%eax, %esi
	shll	$12, %esi
	movl	$2, %eax
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=2
	leaq	(%r12,%rax,4), %r12
	orl	%ebx, %esi
	movq	%r15, %rdi
	callq	_avio_wl32
	movq	(%r14), %rax
	addl	$2, %r13d
	cmpl	4(%rax), %r13d
	movl	%ebx, %r13d
	jge	LBB0_8
LBB0_11:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	1(%r13), %ebx
	movq	8(%rax), %rax
	movq	_AV_CODEC_ID_PCM_S24LE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	%r12, %rdi
	callq	_AV_RL24
	movl	%eax, %esi
	shll	$4, %esi
	movl	$3, %eax
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$6, %ebx
	ja	LBB0_4
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	%ebx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_avio_wl32
	incl	%ebx
	cmpl	$8, %ebx
	jne	LBB0_7
	jmp	LBB0_4
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_CODEC_ID_PCM_S24LE,8,3      ## @AV_CODEC_ID_PCM_S24LE
	.no_dead_strip	_mxf_write_d10_audio_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxf_write_d10_audio_packet
_mxf_write_d10_audio_packet:            ; @mxf_write_d10_audio_packet
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldp	x20, x24, [x0]
	ldrsw	x23, [x2]
	ldr	x8, [x1]
	ldr	w8, [x8]
	sdiv	w22, w23, w8
	ldr	x21, [x2, #8]
	mov	w1, #4
	bfi	w1, w22, #5, #27
	mov	x0, x20
	bl	_klv_encode_ber4_length
	cmp	w22, #1920
	b.ne	LBB0_2
; %bb.1:
	mov	w1, #0
	b	LBB0_3
LBB0_2:
	ldr	w8, [x24]
	sub	w8, w8, #1
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	asr	x9, x9, #33
	add	w9, w9, w10
	add	w9, w9, w9, lsl #2
	sub	w8, w8, w9
	add	w1, w8, #1
LBB0_3:
	mov	x0, x20
	bl	_avio_w8
	mov	x0, x20
	mov	x1, x22
	bl	_avio_wl16
	ldr	x8, [x19]
	ldr	w8, [x8, #4]
	mov	w9, #-1
	lsl	w8, w9, w8
	mvn	w1, w8
	mov	x0, x20
	bl	_avio_w8
	cmp	w23, #1
	b.lt	LBB0_16
; %bb.4:
	add	x23, x21, x23, lsl #2
Lloh0:
	adrp	x24, _AV_CODEC_ID_PCM_S24LE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _AV_CODEC_ID_PCM_S24LE@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	cmp	x21, x23
	b.hs	LBB0_16
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
                                        ;     Child Loop BB0_15 Depth 2
	ldr	x8, [x19]
	ldr	w9, [x8, #4]
	cmp	w9, #1
	b.lt	LBB0_14
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w22, #-1
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=2
	bl	_AV_RL16
	lsl	w8, w0, #12
	mov	w9, #2
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	add	w10, w22, #1
	add	x21, x21, x9, lsl #2
	orr	w1, w8, w10
	mov	x0, x20
	bl	_avio_wl32
	ldr	x8, [x19]
	ldr	w10, [x8, #4]
	add	w9, w22, #1
	add	w11, w22, #2
	mov	x22, x9
	cmp	w11, w10
	b.ge	LBB0_12
LBB0_10:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x8, #8]
	ldr	x9, [x24]
	mov	x0, x21
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	bl	_AV_RL24
	lsl	w8, w0, #4
	mov	w9, #3
	b	LBB0_9
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w9, #6
	b.hi	LBB0_5
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	add	w22, w9, #1
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w22, #0
LBB0_15:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	mov	x1, x22
	bl	_avio_wl32
	add	w22, w22, #1
	cmp	w22, #8
	b.ne	LBB0_15
	b	LBB0_5
LBB0_16:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_CODEC_ID_PCM_S24LE,8,3      ; @AV_CODEC_ID_PCM_S24LE
	.no_dead_strip	_mxf_write_d10_audio_packet
.subsections_via_symbols
