// File: /workspace/github_c_makefile_star2_O1/videolan[P]bitstream/examples/dvb_ecmg.c
// Function: send_channel_status
static void send_channel_status(void)
{
    uint8_t p_tlv_h[MAX_TLV_SIZE];
    uint8_t *p_tlv = tlvh_get_tlv(p_tlv_h);
    uint8_t *p_tlv_n;

    tlvh_set_version(p_tlv_h, i_version);
    ecmg_init(p_tlv);
    tlv_set_type(p_tlv, ECMG_TYPE_CHANNEL_STATUS);
    /* length will be written at the end */
    tlv_set_length(p_tlv, MAX_TLV_SIZE - TLV_HEADER_SIZE - TLVH_HEADER_SIZE);

    ecmg_append_channelid(p_tlv, i_channelid);
    ecmg_append_sectiontspkt(p_tlv, 0x0); /* sections */
    ecmg_append_delaystart(p_tlv, DELAY_START);
    ecmg_append_delaystop(p_tlv, DELAY_STOP);
    ecmg_append_repperiod(p_tlv, REP_PERIOD);
    ecmg_append_maxstreams(p_tlv, MAX_STREAMS);
    ecmg_append_mincpdur(p_tlv, MIN_CP_DUR);
    ecmg_append_leadcw(p_tlv, LEAD_CW);
    ecmg_append_cwpermsg(p_tlv, CW_PER_MSG);
    ecmg_append_maxcomptime(p_tlv, MAX_COMP_TIME);

    p_tlv_n = tlv_find_param(p_tlv, TLV_PARAM_EMPTY, 0);
    tlv_set_length(p_tlv, p_tlv_n - p_tlv - TLV_HEADER_SIZE);
    write_wrapper(p_tlv_h, p_tlv_n - p_tlv_h);
}

// Assembly:
subq $0x408, %rsp            # imm = 0x408
leaq 0x1(%rsp), %rax
movb 0x3e8f(%rip), %cl       # 0x7078
movb %cl, -0x1(%rax)
leaq 0x5(%rsp), %rdx
movw $0x0, (%rdx)
movl $0xf7030300, -0x4(%rdx) # imm = 0xF7030300
movzwl 0x3e86(%rip), %esi      # 0x708a
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rdx, %rdi
testb %r8b, %r8b
je 0x3242
movzbl %r8b, %r9d
movq %rdx, %rdi
movq %rdi, %r10
subq %rax, %r10
cmpq $0x3f7, %r10            # imm = 0x3F7
jg 0x3259
movzwl 0x2(%rdi), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %rdi
addq $0x4, %rdi
decw %r9w
jne 0x3218
movq %rdi, %r9
subq %rax, %r9
addq $-0x4, %r9
cmpq $0x3f7, %r9             # imm = 0x3F7
cmovgeq %rcx, %rdi
jmp 0x325b
xorl %edi, %edi
testq %rdi, %rdi
je 0x326e
incb %r8b
movb 0x1(%rdi), %r9b
orb (%rdi), %r9b
jne 0x3209
jmp 0x3270
xorl %edi, %edi
movq %rdi, %rcx
subq %rax, %rcx
addq $0x4, %rcx
cmpq $0x3f7, %rcx            # imm = 0x3F7
jg 0x32b6
movl $0x2000e00, (%rdi)      # imm = 0x2000E00
leaq 0x4(%rdi), %r8
movl $0x8, %ecx
movl %esi, %r9d
shrl %cl, %r9d
movb %r9b, (%r8)
incq %r8
addq $-0x8, %rcx
je 0x3292
movzwl 0x2(%rdi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movw $0x0, 0x4(%rdi,%rcx)
movzwl 0x3(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
movq %rdx, %rsi
testb %r8b, %r8b
je 0x32fc
movzbl %r8b, %r9d
movq %rdx, %rsi
movq %rsi, %r10
subq %rax, %r10
cmpq %rcx, %r10
jg 0x330f
movzwl 0x2(%rsi), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %rsi
addq $0x4, %rsi
decw %r9w
jne 0x32d6
movq %rsi, %r9
subq %rax, %r9
addq $-0x4, %r9
cmpq %rcx, %r9
cmovgeq %rdi, %rsi
jmp 0x3311
xorl %esi, %esi
testq %rsi, %rsi
je 0x3324
incb %r8b
movb 0x1(%rsi), %r9b
orb (%rsi), %r9b
jne 0x32c7
jmp 0x3326
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x3, %rdi
cmpq %rcx, %rdi
jg 0x3345
movl $0x1000200, (%rsi)      # imm = 0x1000200
movw $0x0, 0x4(%rsi)
movb $0x0, 0x6(%rsi)
movzwl 0x3(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
movq %rdx, %rsi
testb %r8b, %r8b
je 0x338b
movzbl %r8b, %r9d
movq %rdx, %rsi
movq %rsi, %r10
subq %rax, %r10
cmpq %rcx, %r10
jg 0x339e
movzwl 0x2(%rsi), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %rsi
addq $0x4, %rsi
decw %r9w
jne 0x3365
movq %rsi, %r9
subq %rax, %r9
addq $-0x4, %r9
cmpq %rcx, %r9
cmovgeq %rdi, %rsi
jmp 0x33a0
xorl %esi, %esi
testq %rsi, %rsi
je 0x33b3
incb %r8b
movb 0x1(%rsi), %r9b
orb (%rsi), %r9b
jne 0x3356
jmp 0x33b5
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
cmpq %rcx, %rdi
jg 0x33fa
movl $0x2000300, (%rsi)      # imm = 0x2000300
leaq 0x4(%rsi), %rdi
movl $0x8, %ecx
movl $0xc8, %r8d
shrl %cl, %r8d
movb %r8b, (%rdi)
incq %rdi
addq $-0x8, %rcx
je 0x33d3
movzwl 0x2(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movw $0x0, 0x4(%rsi,%rcx)
movzwl 0x3(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
movq %rdx, %rsi
testb %r8b, %r8b
je 0x3440
movzbl %r8b, %r9d
movq %rdx, %rsi
movq %rsi, %r10
subq %rax, %r10
cmpq %rcx, %r10
jg 0x3453
movzwl 0x2(%rsi), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %rsi
addq $0x4, %rsi
decw %r9w
jne 0x341a
movq %rsi, %r9
subq %rax, %r9
addq $-0x4, %r9
cmpq %rcx, %r9
cmovgeq %rdi, %rsi
jmp 0x3455
xorl %esi, %esi
testq %rsi, %rsi
je 0x3468
incb %r8b
movb 0x1(%rsi), %r9b
orb (%rsi), %r9b
jne 0x340b
jmp 0x346a
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
cmpq %rcx, %rdi
jg 0x3480
movq $0x2000400, (%rsi)      # imm = 0x2000400
movzwl 0x3(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
movq %rdx, %rsi
testb %r8b, %r8b
je 0x34c6
movzbl %r8b, %r9d
movq %rdx, %rsi
movq %rsi, %r10
subq %rax, %r10
cmpq %rcx, %r10
jg 0x34d9
movzwl 0x2(%rsi), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %rsi
addq $0x4, %rsi
decw %r9w
jne 0x34a0
movq %rsi, %r9
subq %rax, %r9
addq $-0x4, %r9
cmpq %rcx, %r9
cmovgeq %rdi, %rsi
jmp 0x34db
xorl %esi, %esi
testq %rsi, %rsi
je 0x34ee
incb %r8b
movb 0x1(%rsi), %r9b
orb (%rsi), %r9b
jne 0x3491
jmp 0x34f0
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
cmpq %rcx, %rdi
jg 0x3535
movl $0x2000700, (%rsi)      # imm = 0x2000700
leaq 0x4(%rsi), %rdi
movl $0x8, %ecx
movl $0x12c, %r8d            # imm = 0x12C
shrl %cl, %r8d
movb %r8b, (%rdi)
incq %rdi
addq $-0x8, %rcx
je 0x350e
movzwl 0x2(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movw $0x0, 0x4(%rsi,%rcx)
movzwl 0x3(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
movq %rdx, %rsi
testb %r8b, %r8b
je 0x357b
movzbl %r8b, %r9d
movq %rdx, %rsi
movq %rsi, %r10
subq %rax, %r10
cmpq %rcx, %r10
jg 0x358e
movzwl 0x2(%rsi), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %rsi
addq $0x4, %rsi
decw %r9w
jne 0x3555
movq %rsi, %r9
subq %rax, %r9
addq $-0x4, %r9
cmpq %rcx, %r9
cmovgeq %rdi, %rsi
jmp 0x3590
xorl %esi, %esi
testq %rsi, %rsi
je 0x35a3
incb %r8b
movb 0x1(%rsi), %r9b
orb (%rsi), %r9b
jne 0x3546
jmp 0x35a5
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
cmpq %rcx, %rdi
jg 0x35ea
movl $0x2000800, (%rsi)      # imm = 0x2000800
leaq 0x4(%rsi), %rdi
movl $0x8, %ecx
movl $0x1f4, %r8d            # imm = 0x1F4
shrl %cl, %r8d
movb %r8b, (%rdi)
incq %rdi
addq $-0x8, %rcx
je 0x35c3
movzwl 0x2(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movw $0x0, 0x4(%rsi,%rcx)
movzwl 0x3(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
movq %rdx, %rsi
testb %r8b, %r8b
je 0x3630
movzbl %r8b, %r9d
movq %rdx, %rsi
movq %rsi, %r10
subq %rax, %r10
cmpq %rcx, %r10
jg 0x3643
movzwl 0x2(%rsi), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %rsi
addq $0x4, %rsi
decw %r9w
jne 0x360a
movq %rsi, %r9
subq %rax, %r9
addq $-0x4, %r9
cmpq %rcx, %r9
cmovgeq %rdi, %rsi
jmp 0x3645
xorl %esi, %esi
testq %rsi, %rsi
je 0x3658
incb %r8b
movb 0x1(%rsi), %r9b
orb (%rsi), %r9b
jne 0x35fb
jmp 0x365a
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
cmpq %rcx, %rdi
jg 0x369f
movl $0x2000900, (%rsi)      # imm = 0x2000900
leaq 0x4(%rsi), %rdi
movl $0x8, %ecx
movl $0x3, %r8d
shrl %cl, %r8d
movb %r8b, (%rdi)
incq %rdi
addq $-0x8, %rcx
je 0x3678
movzwl 0x2(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movw $0x0, 0x4(%rsi,%rcx)
movzwl 0x3(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
movq %rdx, %rsi
testb %r8b, %r8b
je 0x36e5
movzbl %r8b, %r9d
movq %rdx, %rsi
movq %rsi, %r10
subq %rax, %r10
cmpq %rcx, %r10
jg 0x36f8
movzwl 0x2(%rsi), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %rsi
addq $0x4, %rsi
decw %r9w
jne 0x36bf
movq %rsi, %r9
subq %rax, %r9
addq $-0x4, %r9
cmpq %rcx, %r9
cmovgeq %rdi, %rsi
jmp 0x36fa
xorl %esi, %esi
testq %rsi, %rsi
je 0x370d
incb %r8b
movb 0x1(%rsi), %r9b
orb (%rsi), %r9b
jne 0x36b0
jmp 0x370f
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x3, %rdi
cmpq %rcx, %rdi
jg 0x372e
movl $0x1000a00, (%rsi)      # imm = 0x1000A00
movw $0x1, 0x4(%rsi)
movb $0x0, 0x6(%rsi)
movzwl 0x3(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
movq %rdx, %rsi
testb %r8b, %r8b
je 0x3774
movzbl %r8b, %r9d
movq %rdx, %rsi
movq %rsi, %r10
subq %rax, %r10
cmpq %rcx, %r10
jg 0x3787
movzwl 0x2(%rsi), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %rsi
addq $0x4, %rsi
decw %r9w
jne 0x374e
movq %rsi, %r9
subq %rax, %r9
addq $-0x4, %r9
cmpq %rcx, %r9
cmovgeq %rdi, %rsi
jmp 0x3789
xorl %esi, %esi
testq %rsi, %rsi
je 0x379c
incb %r8b
movb 0x1(%rsi), %r9b
orb (%rsi), %r9b
jne 0x373f
jmp 0x379e
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x3, %rdi
cmpq %rcx, %rdi
jg 0x37bd
movl $0x1000b00, (%rsi)      # imm = 0x1000B00
movw $0x2, 0x4(%rsi)
movb $0x0, 0x6(%rsi)
movzwl 0x3(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
movq %rdx, %rsi
testb %r8b, %r8b
je 0x3803
movzbl %r8b, %r9d
movq %rdx, %rsi
movq %rsi, %r10
subq %rax, %r10
cmpq %rcx, %r10
jg 0x3816
movzwl 0x2(%rsi), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %rsi
addq $0x4, %rsi
decw %r9w
jne 0x37dd
movq %rsi, %r9
subq %rax, %r9
addq $-0x4, %r9
cmpq %rcx, %r9
cmovgeq %rdi, %rsi
jmp 0x3818
xorl %esi, %esi
testq %rsi, %rsi
je 0x382b
incb %r8b
movb 0x1(%rsi), %r9b
orb (%rsi), %r9b
jne 0x37ce
jmp 0x382d
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
cmpq %rcx, %rdi
jg 0x3872
movl $0x2000c00, (%rsi)      # imm = 0x2000C00
leaq 0x4(%rsi), %rdi
movl $0x8, %ecx
movl $0x64, %r8d
shrl %cl, %r8d
movb %r8b, (%rdi)
incq %rdi
addq $-0x8, %rcx
je 0x384b
movzwl 0x2(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movw $0x0, 0x4(%rsi,%rcx)
movzwl 0x3(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
movq %rdx, %rsi
testb %r8b, %r8b
je 0x38b8
movzbl %r8b, %r9d
movq %rdx, %rsi
movq %rsi, %r10
subq %rax, %r10
cmpq %rcx, %r10
jg 0x38cb
movzwl 0x2(%rsi), %r10d
rolw $0x8, %r10w
movzwl %r10w, %r10d
addq %r10, %rsi
addq $0x4, %rsi
decw %r9w
jne 0x3892
movq %rsi, %r9
subq %rax, %r9
addq $-0x4, %r9
cmpq %rcx, %r9
cmovgeq %rdi, %rsi
jmp 0x38cd
xorl %esi, %esi
testq %rsi, %rsi
je 0x38e0
incb %r8b
movb 0x1(%rsi), %r9b
orb (%rsi), %r9b
jne 0x3883
jmp 0x38e2
xorl %esi, %esi
movl %esi, %ecx
subl %eax, %ecx
addl $-0x4, %ecx
rolw $0x8, %cx
movq %rsp, %rdi
movw %cx, 0x3(%rdi)
subq %rdi, %rsi
callq 0x1c0d
addq $0x408, %rsp            # imm = 0x408
retq