// File: /workspace/github_c_makefile_star2_O0/tvlabs[P]edge264/./edge264_slice.c
// Function: parse_total_zeros
static inline int parse_total_zeros(Edge264Context *ctx, int endIdx, int TotalCoeff) {
		static const uint8_t codes[27][9 * 4] = { // [tzVlcIndex][leadingZeroBits][suffix]
			// 2x2 blocks
			{16, 16, 16, 16, 33, 33, 33, 33, 50, 50, 50, 50, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51},
			{16, 16, 16, 16, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34},
			{16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17},
			{}, // 2x4 blocks
			{16, 16, 16, 16, 49, 49, 50, 50, 67, 67, 68, 68, 69, 69, 69, 69, 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87},
			{51, 52, 53, 54, 33, 33, 33, 33, 50, 50, 50, 50, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48},
			{35, 35, 52, 53, 34, 34, 34, 34, 49, 49, 49, 49, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48},
			{35, 35, 48, 52, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33},
			{34, 34, 35, 35, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32},
			{18, 18, 18, 18, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32},
			{17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16},
			{}, // 4x4 blocks
			{16, 16, 16, 16, 50, 50, 49, 49, 68, 68, 67, 67, 86, 86, 85, 85, 104, 104, 103, 103, 122, 122, 121, 121, 140, 140, 139, 139, 158, 158, 157, 157, 159, 159, 159, 159},
			{51, 50, 49, 48, 70, 69, 52, 52, 72, 72, 71, 71, 90, 90, 89, 89, 108, 108, 107, 107, 109, 109, 109, 109, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110},
			{54, 51, 50, 49, 68, 64, 55, 55, 72, 72, 69, 69, 90, 90, 89, 89, 92, 92, 92, 92, 107, 107, 107, 107, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109},
			{54, 53, 52, 49, 67, 66, 56, 56, 73, 73, 71, 71, 90, 90, 80, 80, 91, 91, 91, 91, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92},
			{54, 53, 52, 51, 65, 64, 55, 55, 72, 72, 66, 66, 74, 74, 74, 74, 89, 89, 89, 89, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91},
			{53, 52, 51, 50, 55, 55, 54, 54, 57, 57, 57, 57, 72, 72, 72, 72, 81, 81, 81, 81, 96, 96, 96, 96, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106},
			{51, 50, 37, 37, 54, 54, 52, 52, 56, 56, 56, 56, 71, 71, 71, 71, 81, 81, 81, 81, 96, 96, 96, 96, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105},
			{37, 37, 36, 36, 54, 54, 51, 51, 55, 55, 55, 55, 65, 65, 65, 65, 82, 82, 82, 82, 96, 96, 96, 96, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104},
			{36, 36, 35, 35, 38, 38, 38, 38, 53, 53, 53, 53, 66, 66, 66, 66, 87, 87, 87, 87, 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97},
			{36, 36, 35, 35, 37, 37, 37, 37, 50, 50, 50, 50, 70, 70, 70, 70, 80, 80, 80, 80, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81},
			{20, 20, 20, 20, 51, 51, 53, 53, 50, 50, 50, 50, 65, 65, 65, 65, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},
			{19, 19, 19, 19, 34, 34, 34, 34, 52, 52, 52, 52, 65, 65, 65, 65, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},
			{18, 18, 18, 18, 35, 35, 35, 35, 49, 49, 49, 49, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48},
			{18, 18, 18, 18, 33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32},
			{17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16},
		};
		int leadingZeroBits = clz(ctx->t._gb.msb_cache | (size_t)1 << (SIZE_BIT - 9));
		int suffix = ctx->t._gb.msb_cache >> ((leadingZeroBits + 2) ^ (SIZE_BIT - 1)) & 3;
		assert(endIdx + TotalCoeff - 4 < 27 && leadingZeroBits * 4 + suffix < 36);
		int code = codes[endIdx + TotalCoeff - 4][leadingZeroBits * 4 + suffix];
		int v = code >> 4;
		ctx->t._gb.msb_cache = shld(ctx->t._gb.lsb_cache, ctx->t._gb.msb_cache, v);
		ctx->t._gb.lsb_cache <<= v;
		return code & 15;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x20(%rbp)
movl %esi, -0x24(%rbp)
movl %edx, -0x28(%rbp)
movq -0x20(%rbp), %rcx
movabsq $0x80000000000000, %rax # imm = 0x80000000000000
orq 0x18(%rcx), %rax
lzcntq %rax, %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x2c(%rbp), %ecx
addl $0x2, %ecx
xorl $0x3f, %ecx
movl %ecx, %ecx
shrq %cl, %rax
andq $0x3, %rax
movl %eax, -0x30(%rbp)
movl -0x24(%rbp), %eax
addl -0x28(%rbp), %eax
subl $0x4, %eax
cmpl $0x1b, %eax
jge 0x3dc27
movl -0x2c(%rbp), %eax
shll $0x2, %eax
addl -0x30(%rbp), %eax
cmpl $0x24, %eax
jge 0x3dc27
jmp 0x3dc46
leaq 0x8fc09(%rip), %rdi     # 0xcd837
leaq 0x8fba7(%rip), %rsi     # 0xcd7dc
movl $0x75, %edx
leaq 0x8fc38(%rip), %rcx     # 0xcd879
callq 0x7080
movl -0x24(%rbp), %eax
addl -0x28(%rbp), %eax
subl $0x4, %eax
movslq %eax, %rcx
leaq 0x8e8a7(%rip), %rax     # 0xcc500
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movl -0x2c(%rbp), %ecx
shll $0x2, %ecx
addl -0x30(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
sarl $0x4, %eax
movl %eax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
movl -0x38(%rbp), %eax
movq %rdx, -0x8(%rbp)
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
movl -0x14(%rbp), %ecx
shldq %cl, %rdx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x38(%rbp), %ecx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
movl %ecx, %ecx
shlq %cl, %rdx
movq %rdx, %rcx
movq %rcx, 0x10(%rax)
movl -0x34(%rbp), %eax
andl $0xf, %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)