	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function prompeg_write
_prompeg_write:                         ## @prompeg_write
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movq	$0, -48(%rbp)
	cmpq	$0, 56(%r12)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_prompeg_init
	testl	%eax, %eax
	js	LBB0_7
LBB0_2:
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_prompeg_create_bitstring
	testl	%eax, %eax
	js	LBB0_7
## %bb.3:
	movl	(%r12), %ecx
	movl	%ecx, %eax
	cltd
	idivl	4(%r12)
	movl	%edx, %ebx
	cltd
	idivl	8(%r12)
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.4:
	movq	48(%r12), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rsi
	movl	32(%r12), %ecx
	movl	%ebx, %r13d
	movl	%edx, %ebx
	movl	%edi, %edx
	callq	_xor_fast
	movl	%ebx, %eax
	movl	%r13d, %ebx
	xorl	%r13d, %r13d
	testl	%eax, %eax
	je	LBB0_12
LBB0_5:
	movq	40(%r12), %rax
	movslq	%ebx, %rcx
	movq	(%rax,%rcx,8), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rsi
	movl	32(%r12), %ecx
	movl	%edi, %edx
	callq	_xor_fast
	cmpq	$0, 16(%r12)
	jne	LBB0_19
	jmp	LBB0_16
LBB0_8:
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	cmpq	$0, 16(%r12)
	je	LBB0_10
## %bb.9:
	xorl	%r13d, %r13d
	testl	%ecx, %ecx
	jle	LBB0_11
LBB0_10:
	movq	48(%r12), %rsi
	movq	_PROMPEG_FEC_ROW@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_prompeg_write_fec
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_22
LBB0_11:
	movq	48(%r12), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rsi
	movl	32(%r12), %edx
	callq	_memcpy
	leaq	8(%r15), %rdi
	callq	_AV_RB16
	movq	48(%r12), %rcx
	movq	%rax, 16(%rcx)
	leaq	16(%r15), %rdi
	callq	_AV_RB32
	movq	48(%r12), %rcx
	movq	%rax, 8(%rcx)
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	jne	LBB0_5
LBB0_12:
	cmpq	$0, 16(%r12)
	je	LBB0_14
## %bb.13:
	movslq	%ebx, %rbx
	jmp	LBB0_15
LBB0_14:
	movslq	%ebx, %rbx
	movq	24(%r12), %rax
	movq	40(%r12), %rcx
	movq	(%rax,%rbx,8), %rdx
	movq	(%rcx,%rbx,8), %rcx
	movq	%rcx, (%rax,%rbx,8)
	movq	40(%r12), %rax
	movq	%rdx, (%rax,%rbx,8)
LBB0_15:
	movq	40(%r12), %rax
	movq	(%rax,%rbx,8), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rsi
	movl	32(%r12), %edx
	callq	_memcpy
	leaq	8(%r15), %rdi
	callq	_AV_RB16
	movq	40(%r12), %rcx
	movq	(%rcx,%rbx,8), %rcx
	movq	%rax, 16(%rcx)
	addq	$16, %r15
	movq	%r15, %rdi
	callq	_AV_RB32
	movq	40(%r12), %rcx
	movq	(%rcx,%rbx,8), %rcx
	movq	%rax, 8(%rcx)
	cmpq	$0, 16(%r12)
	jne	LBB0_19
LBB0_16:
	movl	(%r12), %eax
	cltd
	idivl	8(%r12)
	testl	%edx, %edx
	jne	LBB0_19
## %bb.17:
	movq	24(%r12), %rcx
	cltq
	movq	(%rcx,%rax,8), %rsi
	movq	_PROMPEG_FEC_COL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_prompeg_write_fec
	testl	%eax, %eax
	js	LBB0_7
## %bb.18:
	addl	%eax, %r13d
LBB0_19:
	movl	(%r12), %eax
	incl	%eax
	movl	%eax, (%r12)
	cmpl	12(%r12), %eax
	jl	LBB0_22
## %bb.20:
	movl	$0, (%r12)
	cmpq	$0, 16(%r12)
	je	LBB0_22
## %bb.21:
	movq	$0, 16(%r12)
	jmp	LBB0_22
LBB0_7:
	movl	%eax, %r13d
LBB0_22:
	movq	-48(%rbp), %rdi
	callq	_av_free
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PROMPEG_FEC_ROW,4,2            ## @PROMPEG_FEC_ROW
	.comm	_PROMPEG_FEC_COL,4,2            ## @PROMPEG_FEC_COL
	.no_dead_strip	_prompeg_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function prompeg_write
_prompeg_write:                         ; @prompeg_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x22, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x23, [x0]
	str	xzr, [sp, #8]
	ldr	x8, [x23, #56]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_prompeg_init
	tbnz	w0, #31, LBB0_22
LBB0_2:
	add	x3, sp, #8
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_prompeg_create_bitstring
	tbnz	w0, #31, LBB0_22
; %bb.3:
	ldp	w8, w9, [x23]
	sdiv	w24, w8, w9
	msub	w22, w24, w9, w8
	ldr	w25, [x23, #8]
	cbz	w22, LBB0_5
; %bb.4:
	ldr	x8, [x23, #48]
	ldr	w0, [x8]
	ldr	x1, [sp, #8]
	ldr	w3, [x23, #32]
	mov	x2, x0
	bl	_xor_fast
	mov	w20, #0
	b	LBB0_10
LBB0_5:
	ldr	x9, [x23, #16]
	cbz	x9, LBB0_8
; %bb.6:
	cmp	w8, #1
	b.ge	LBB0_8
; %bb.7:
	mov	w20, #0
	b	LBB0_9
LBB0_8:
	ldr	x1, [x23, #48]
Lloh0:
	adrp	x8, _PROMPEG_FEC_ROW@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PROMPEG_FEC_ROW@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_prompeg_write_fec
	mov	x20, x0
	tbnz	w0, #31, LBB0_23
LBB0_9:
	ldr	x8, [x23, #48]
	ldr	w0, [x8]
	ldr	x1, [sp, #8]
	ldr	w2, [x23, #32]
	bl	_memcpy
	add	x0, x21, #8
	bl	_AV_RB16
	ldr	x8, [x23, #48]
	str	x0, [x8, #16]
	add	x0, x21, #16
	bl	_AV_RB32
	ldr	x8, [x23, #48]
	str	x0, [x8, #8]
LBB0_10:
	sdiv	w8, w24, w25
	msub	w8, w8, w25, w24
	cbz	w8, LBB0_12
; %bb.11:
	ldr	x8, [x23, #40]
	ldr	x8, [x8, w22, sxtw #3]
	ldr	w0, [x8]
	ldr	x1, [sp, #8]
	ldr	w3, [x23, #32]
	mov	x2, x0
	bl	_xor_fast
	ldr	x8, [x23, #16]
	cbnz	x8, LBB0_19
	b	LBB0_16
LBB0_12:
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_14
; %bb.13:
	sxtw	x8, w22
	b	LBB0_15
LBB0_14:
	ldr	x9, [x23, #24]
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	sbfiz	x10, x22, #3, #32
	ldr	x11, [x9, x10]
	ldr	x8, [x23, #40]
	ldr	x12, [x8, x10]
	sxtw	x8, w22
	str	x12, [x9, x10]
	ldr	x9, [x23, #40]
	str	x11, [x9, x10]
LBB0_15:
	ldr	x9, [x23, #40]
	lsl	x22, x8, #3
	ldr	x8, [x9, x22]
	ldr	w0, [x8]
	ldr	x1, [sp, #8]
	ldr	w2, [x23, #32]
	bl	_memcpy
	add	x0, x21, #8
	bl	_AV_RB16
	ldr	x8, [x23, #40]
	ldr	x8, [x8, x22]
	str	x0, [x8, #16]
	add	x0, x21, #16
	bl	_AV_RB32
	ldr	x8, [x23, #40]
	ldr	x8, [x8, x22]
	str	x0, [x8, #8]
	ldr	x8, [x23, #16]
	cbnz	x8, LBB0_19
LBB0_16:
	ldr	w9, [x23]
	ldr	w10, [x23, #8]
	sdiv	w8, w9, w10
	msub	w9, w8, w10, w9
	cbnz	w9, LBB0_19
; %bb.17:
	ldr	x9, [x23, #24]
	ldr	x1, [x9, w8, sxtw #3]
Lloh3:
	adrp	x8, _PROMPEG_FEC_COL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PROMPEG_FEC_COL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_prompeg_write_fec
	tbnz	w0, #31, LBB0_22
; %bb.18:
	add	w20, w0, w20
LBB0_19:
	ldr	w8, [x23]
	add	w8, w8, #1
	str	w8, [x23]
	ldr	w9, [x23, #12]
	cmp	w8, w9
	b.lt	LBB0_23
; %bb.20:
	str	wzr, [x23]
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_23
; %bb.21:
	str	xzr, [x23, #16]
	b	LBB0_23
LBB0_22:
	mov	x20, x0
LBB0_23:
	ldr	x0, [sp, #8]
	bl	_av_free
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PROMPEG_FEC_ROW,4,2            ; @PROMPEG_FEC_ROW
	.comm	_PROMPEG_FEC_COL,4,2            ; @PROMPEG_FEC_COL
	.no_dead_strip	_prompeg_write
.subsections_via_symbols
