	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function h264_encode_sps
_h264_encode_sps:                       ## @h264_encode_sps
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_mtk_vcodec_debug_enter
	movq	_H264_BS_MODE_SPS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	movq	%r15, %rcx
	movq	%r14, %r8
	callq	_vpu_enc_encode
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	movq	%rbx, %rdi
	callq	_h264_enc_wait_venc_done
	movq	_MTK_VENC_IRQ_STATUS_SPS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	%edx, %eax
	jne	LBB0_2
## %bb.3:
	movq	_VENC_PIC_BITSTREAM_BYTE_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_h264_read_reg
	movl	%eax, (%r14)
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_mtk_vcodec_debug
	xorl	%eax, %eax
	jmp	LBB0_4
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_mtk_vcodec_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_H264_BS_MODE_SPS,4,2           ## @H264_BS_MODE_SPS
	.comm	_MTK_VENC_IRQ_STATUS_SPS,4,2    ## @MTK_VENC_IRQ_STATUS_SPS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"expect irq status %d"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VENC_PIC_BITSTREAM_BYTE_CNT,4,2 ## @VENC_PIC_BITSTREAM_BYTE_CNT
L_.str.1:                               ## @.str.1
	.asciz	"bs size %d <-"

	.no_dead_strip	_h264_encode_sps
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function h264_encode_sps
_h264_encode_sps:                       ; @h264_encode_sps
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_mtk_vcodec_debug_enter
Lloh0:
	adrp	x8, _H264_BS_MODE_SPS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _H264_BS_MODE_SPS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	mov	x3, x21
	mov	x4, x20
	bl	_vpu_enc_encode
	cbnz	w0, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_h264_enc_wait_venc_done
Lloh3:
	adrp	x8, _MTK_VENC_IRQ_STATUS_SPS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MTK_VENC_IRQ_STATUS_SPS@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	cmp	w0, w2
	b.ne	LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _VENC_PIC_BITSTREAM_BYTE_CNT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VENC_PIC_BITSTREAM_BYTE_CNT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_h264_read_reg
	mov	x2, x0
	str	w0, [x20]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_mtk_vcodec_debug
	mov	w0, #0
	b	LBB0_4
LBB0_3:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mtk_vcodec_err
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_H264_BS_MODE_SPS,4,2           ; @H264_BS_MODE_SPS
	.comm	_MTK_VENC_IRQ_STATUS_SPS,4,2    ; @MTK_VENC_IRQ_STATUS_SPS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"expect irq status %d"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VENC_PIC_BITSTREAM_BYTE_CNT,4,2 ; @VENC_PIC_BITSTREAM_BYTE_CNT
l_.str.1:                               ; @.str.1
	.asciz	"bs size %d <-"

	.no_dead_strip	_h264_encode_sps
.subsections_via_symbols
