	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tw5864_h264_gen_slice_head
_tw5864_h264_gen_slice_head:            ## @tw5864_h264_gen_slice_head
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r15d
	movl	%edx, %r12d
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	xorl	%ebx, %ebx
	testl	%ecx, %ecx
	setne	%bl
	leaq	-56(%rbp), %r13
	movq	%r13, %rdi
	callq	_bs_init
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_bs_write_ue
	leal	(%rbx,%rbx,2), %esi
	addl	$2, %esi
	movq	%r13, %rdi
	callq	_bs_write_ue
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_bs_write_ue
	movq	_MAX_GOP_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_ilog2
	movq	%r13, %rdi
	movl	%eax, %esi
	movl	%r15d, %edx
	callq	_bs_write
	testl	%r15d, %r15d
	je	LBB0_1
## %bb.2:
	movl	(%r14), %edi
	callq	_ilog2
	leaq	-56(%rbp), %r12
	movq	%r12, %rdi
	movl	%eax, %esi
	movl	%r15d, %edx
	callq	_bs_write
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_bs_write1
	jmp	LBB0_3
LBB0_1:
	leaq	-56(%rbp), %rbx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_bs_write_ue
	movl	(%r14), %edi
	callq	_ilog2
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_bs_write
LBB0_3:
	leaq	-56(%rbp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_bs_write1
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_bs_write1
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_bs_write_se
	movl	-56(%rbp), %ecx
	cmpl	$8, %ecx
	jne	LBB0_4
## %bb.5:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	jmp	LBB0_6
LBB0_4:
	movq	-48(%rbp), %rax
	movl	(%rax), %eax
	shll	%cl, %eax
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, (%rdx)
	movl	$8, %ebx
	subl	%ecx, %ebx
LBB0_6:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%ebx, (%rax)
	leaq	-56(%rbp), %rdi
	callq	_bs_len
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_GOP_SIZE,4,2               ## @MAX_GOP_SIZE
	.no_dead_strip	_tw5864_h264_gen_slice_head
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tw5864_h264_gen_slice_head
_tw5864_h264_gen_slice_head:            ; @tw5864_h264_gen_slice_head
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x5
	mov	x19, x4
	mov	x21, x3
	mov	x22, x2
	mov	x2, x1
	mov	x1, x0
	mov	x0, sp
	bl	_bs_init
	mov	x0, sp
	mov	w1, #0
	bl	_bs_write_ue
	mov	w8, #5
	mov	w9, #2
	cmp	w21, #0
	csel	w1, w9, w8, eq
	mov	x0, sp
	bl	_bs_write_ue
	mov	x0, sp
	mov	w1, #0
	bl	_bs_write_ue
Lloh0:
	adrp	x23, _MAX_GOP_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MAX_GOP_SIZE@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_ilog2
	mov	x1, x0
	mov	x0, sp
	mov	x2, x21
	bl	_bs_write
	cbz	w21, LBB0_2
; %bb.1:
	ldr	w0, [x23]
	bl	_ilog2
	mov	x1, x0
	mov	x0, sp
	mov	x2, x21
	bl	_bs_write
	mov	x0, sp
	mov	w1, #0
	bl	_bs_write1
	b	LBB0_3
LBB0_2:
	mov	x0, sp
	mov	x1, x22
	bl	_bs_write_ue
	ldr	w0, [x23]
	bl	_ilog2
	mov	x1, x0
	mov	x0, sp
	mov	w2, #0
	bl	_bs_write
LBB0_3:
	mov	x0, sp
	mov	w1, #0
	bl	_bs_write1
	mov	x0, sp
	mov	w1, #0
	bl	_bs_write1
	mov	x0, sp
	mov	w1, #0
	bl	_bs_write_se
	ldr	w8, [sp]
	cmp	w8, #8
	b.ne	LBB0_5
; %bb.4:
	mov	w8, #0
	str	wzr, [x20]
	b	LBB0_6
LBB0_5:
	ldr	x9, [sp, #8]
	ldr	w9, [x9]
	lsl	w9, w9, w8
	str	w9, [x20]
	mov	w9, #8
	sub	w8, w9, w8
LBB0_6:
	str	w8, [x19]
	mov	x0, sp
	bl	_bs_len
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_GOP_SIZE,4,2               ; @MAX_GOP_SIZE
	.no_dead_strip	_tw5864_h264_gen_slice_head
.subsections_via_symbols
