	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aspeed_video_calc_compressed_size
_aspeed_video_calc_compressed_size:     ## @aspeed_video_calc_compressed_size
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	shrl	%esi
	movq	_UINT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%r8d, (%rdi)
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_1 Depth=1
	incl	%ecx
	addl	$8, %eax
	cmpl	$48, %eax
	je	LBB0_26
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	$4, %ebx
	shll	%cl, %ebx
	movl	%ebx, %edi
	shll	$10, %edi
	cmpl	%esi, %edi
	jb	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r8d, %edi
	jae	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%edi, (%r14)
	movl	%edi, %r8d
	movl	%eax, %edx
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, %edi
	shll	$11, %edi
	cmpl	%esi, %edi
	jb	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r8d, %edi
	jae	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	1(%rax), %edx
	movl	%edi, (%r14)
	movl	%edi, %r8d
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, %edi
	shll	$12, %edi
	cmpl	%esi, %edi
	jb	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r8d, %edi
	jae	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	2(%rax), %edx
	movl	%edi, (%r14)
	movl	%edi, %r8d
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, %edi
	shll	$13, %edi
	cmpl	%esi, %edi
	jb	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r8d, %edi
	jae	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	leal	3(%rax), %edx
	movl	%edi, (%r14)
	movl	%edi, %r8d
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, %edi
	shll	$14, %edi
	cmpl	%esi, %edi
	jb	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r8d, %edi
	jae	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_1 Depth=1
	leal	4(%rax), %edx
	movl	%edi, (%r14)
	movl	%edi, %r8d
LBB0_16:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, %edi
	shll	$15, %edi
	cmpl	%esi, %edi
	jb	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r8d, %edi
	jae	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_1 Depth=1
	leal	5(%rax), %edx
	movl	%edi, (%r14)
	movl	%edi, %r8d
LBB0_19:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, %edi
	shll	$16, %edi
	cmpl	%esi, %edi
	jb	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r8d, %edi
	jae	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_1 Depth=1
	leal	6(%rax), %edx
	movl	%edi, (%r14)
	movl	%edi, %r8d
LBB0_22:                                ##   in Loop: Header=BB0_1 Depth=1
	shll	$17, %ebx
	cmpl	%esi, %ebx
	jb	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r8d, %ebx
	jae	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_1 Depth=1
	leal	7(%rax), %edx
	movl	%ebx, (%r14)
	movl	%ebx, %r8d
	jmp	LBB0_25
LBB0_26:
	movq	_VE_STREAM_BUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_aspeed_video_write
	movl	(%r14), %edx
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_dev_dbg                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_UINT_MAX,4,2                   ## @UINT_MAX
	.comm	_VE_STREAM_BUF_SIZE,4,2         ## @VE_STREAM_BUF_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Max compressed size: %x\n"

	.no_dead_strip	_aspeed_video_calc_compressed_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aspeed_video_calc_compressed_size
_aspeed_video_calc_compressed_size:     ; @aspeed_video_calc_compressed_size
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	mov	w8, #0
	mov	w9, #0
	mov	w2, #0
	lsr	w10, w1, #1
Lloh0:
	adrp	x11, _UINT_MAX@GOTPAGE
Lloh1:
	ldr	x11, [x11, _UINT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w12, [x11]
	str	w12, [x0]
	mov	w11, #4
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	w9, w9, #1
	add	w8, w8, #8
	cmp	w8, #48
	b.eq	LBB0_25
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	lsl	w13, w11, w9
	lsl	w14, w13, #10
	cmp	w14, w10
	ccmp	w14, w12, #2, hs
	b.hs	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	str	w14, [x19]
	mov	x12, x14
	mov	x2, x8
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	lsl	w14, w13, #11
	cmp	w14, w10
	b.lo	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w14, w12
	b.hs	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w2, w8, #1
	str	w14, [x19]
	mov	x12, x14
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	lsl	w14, w13, #12
	cmp	w14, w10
	b.lo	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w14, w12
	b.hs	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w2, w8, #2
	str	w14, [x19]
	mov	x12, x14
LBB0_10:                                ;   in Loop: Header=BB0_2 Depth=1
	lsl	w14, w13, #13
	cmp	w14, w10
	b.lo	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_2 Depth=1
	cmp	w14, w12
	b.hs	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_2 Depth=1
	add	w2, w8, #3
	str	w14, [x19]
	mov	x12, x14
LBB0_13:                                ;   in Loop: Header=BB0_2 Depth=1
	lsl	w14, w13, #14
	cmp	w14, w10
	b.lo	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_2 Depth=1
	cmp	w14, w12
	b.hs	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_2 Depth=1
	add	w2, w8, #4
	str	w14, [x19]
	mov	x12, x14
LBB0_16:                                ;   in Loop: Header=BB0_2 Depth=1
	lsl	w14, w13, #15
	cmp	w14, w10
	b.lo	LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_2 Depth=1
	cmp	w14, w12
	b.hs	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_2 Depth=1
	add	w2, w8, #5
	str	w14, [x19]
	mov	x12, x14
LBB0_19:                                ;   in Loop: Header=BB0_2 Depth=1
	lsl	w14, w13, #16
	cmp	w14, w10
	b.lo	LBB0_22
; %bb.20:                               ;   in Loop: Header=BB0_2 Depth=1
	cmp	w14, w12
	b.hs	LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_2 Depth=1
	add	w2, w8, #6
	str	w14, [x19]
	mov	x12, x14
LBB0_22:                                ;   in Loop: Header=BB0_2 Depth=1
	lsl	w13, w13, #17
	cmp	w13, w10
	b.lo	LBB0_1
; %bb.23:                               ;   in Loop: Header=BB0_2 Depth=1
	cmp	w13, w12
	b.hs	LBB0_1
; %bb.24:                               ;   in Loop: Header=BB0_2 Depth=1
	add	w2, w8, #7
	str	w13, [x19]
	mov	x12, x13
	b	LBB0_1
LBB0_25:
Lloh3:
	adrp	x8, _VE_STREAM_BUF_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VE_STREAM_BUF_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_aspeed_video_write
	ldp	w2, w0, [x19]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dev_dbg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_UINT_MAX,4,2                   ; @UINT_MAX
	.comm	_VE_STREAM_BUF_SIZE,4,2         ; @VE_STREAM_BUF_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Max compressed size: %x\n"

	.no_dead_strip	_aspeed_video_calc_compressed_size
.subsections_via_symbols
