// File: /workspace/github_c_makefile_star2_O0/tvlabs[P]edge264/./edge264_slice.c
// Function: parse_coded_block_pattern_cabac
static void CAFUNC(parse_coded_block_pattern, const uint8_t *map_me)
{
	// Luma prefix
	#if !CABAC
		int cbp = map_me[get_ue16(&ctx->t._gb, 47)];
		mb->bits[0] |= cbp & 0xac;
	#else
		int bits = mb->bits[0];
		bits |= get_ae(ctx, 76 - (bits      & 3)) << 5;
		bits |= get_ae(ctx, 76 - (bits >> 5 & 3)) << 3;
		bits |= get_ae(ctx, 76 - (bits >> 4 & 3)) << 2;
		bits |= get_ae(ctx, 76 - (bits >> 2 & 3)) << 7;
		mb->bits[0] = bits;
	#endif
	
	// Chroma suffix
	if ((ctx->t.ChromaArrayType == 1 || ctx->t.ChromaArrayType == 2) &&
		CACOND(cbp & 3, get_ae(ctx, 77 + ctx->inc.CodedBlockPatternChromaDC)))
	{
		mb->f.CodedBlockPatternChromaDC = 1;
		mb->f.CodedBlockPatternChromaAC = CACOND(cbp >> 1 & 1, get_ae(ctx, 81 + ctx->inc.CodedBlockPatternChromaAC));
	}
	
	log_mb(ctx, "    coded_block_pattern: %u\n",
		(mb->bits[0] >> 5 & 1) | (mb->bits[0] >> 2 & 2) | (mb->bits[0] & 4) | (mb->bits[0] >> 4 & 8) |
		(mb->f.CodedBlockPatternChromaDC + mb->f.CodedBlockPatternChromaAC) << 4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x680(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
andl $0x3, %eax
movl $0x4c, %esi
subl %eax, %esi
callq 0xae5c0
shll $0x5, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
sarl $0x5, %eax
andl $0x3, %eax
movl $0x4c, %esi
subl %eax, %esi
callq 0xae5c0
shll $0x3, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
sarl $0x4, %eax
andl $0x3, %eax
movl $0x4c, %esi
subl %eax, %esi
callq 0xae5c0
shll $0x2, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
sarl $0x2, %eax
andl $0x3, %eax
movl $0x4c, %esi
subl %eax, %esi
callq 0xae5c0
shll $0x7, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movq 0x680(%rax), %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movsbl 0x2a(%rax), %eax
cmpl $0x1, %eax
je 0xb0361
movq -0x8(%rbp), %rax
movsbl 0x2a(%rax), %eax
cmpl $0x2, %eax
jne 0xb03b3
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movsbl 0x6c6(%rax), %esi
addl $0x4d, %esi
callq 0xae5c0
cmpl $0x0, %eax
je 0xb03b3
movq -0x8(%rbp), %rax
movq 0x680(%rax), %rax
movb $0x1, 0x26(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movsbl 0x6c7(%rax), %esi
addl $0x51, %esi
callq 0xae5c0
movb %al, %cl
movq -0x8(%rbp), %rax
movq 0x680(%rax), %rax
movb %cl, 0x27(%rax)
movq -0x8(%rbp), %rax
movswq 0x1cd0(%rax), %rax
cmpq $0x1000, %rax           # imm = 0x1000
jae 0xb0496
movq -0x8(%rbp), %rdi
addq $0x1cd2, %rdi           # imm = 0x1CD2
movq -0x8(%rbp), %rax
movswl 0x1cd0(%rax), %eax
cltq
addq %rax, %rdi
movq -0x8(%rbp), %rax
movswq 0x1cd0(%rax), %rax
movl $0x1000, %esi           # imm = 0x1000
subq %rax, %rsi
movq -0x8(%rbp), %rax
movq 0x680(%rax), %rax
movl 0x8(%rax), %ecx
shrl $0x5, %ecx
andl $0x1, %ecx
movq -0x8(%rbp), %rax
movq 0x680(%rax), %rax
movl 0x8(%rax), %eax
shrl $0x2, %eax
andl $0x2, %eax
orl %eax, %ecx
movq -0x8(%rbp), %rax
movq 0x680(%rax), %rax
movl 0x8(%rax), %eax
andl $0x4, %eax
orl %eax, %ecx
movq -0x8(%rbp), %rax
movq 0x680(%rax), %rax
movl 0x8(%rax), %eax
shrl $0x4, %eax
andl $0x8, %eax
orl %eax, %ecx
movq -0x8(%rbp), %rax
movq 0x680(%rax), %rax
movsbl 0x26(%rax), %eax
movq -0x8(%rbp), %rdx
movq 0x680(%rdx), %rdx
movsbl 0x27(%rdx), %edx
addl %edx, %eax
shll $0x4, %eax
orl %eax, %ecx
leaq 0x20525(%rip), %rdx     # 0xd099e
movb $0x0, %al
callq 0x7070
movl %eax, %edx
movq -0x8(%rbp), %rax
movswl 0x1cd0(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x1cd0(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)