// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
leaq 0x1(%rsp), %rax
movb 0x34cf(%rip), %cl       # 0x6078
movb %cl, -0x1(%rax)
leaq 0x5(%rsp), %rcx
movw $0x0, (%rcx)
movl $0xf7030300, -0x4(%rcx) # imm = 0xF7030300
movzwl 0x34c6(%rip), %ebx      # 0x608a
xorl %edx, %edx
movq %rcx, %rsi
testb %dl, %dl
je 0x2bfc
movzbl %dl, %edi
movq %rcx, %rsi
movq %rsi, %r8
subq %rax, %r8
cmpq $0x3f7, %r8             # imm = 0x3F7
jg 0x2c1c
movzwl 0x2(%rsi), %r8d
rolw $0x8, %r8w
movzwl %r8w, %r8d
addq %r8, %rsi
addq $0x4, %rsi
decw %di
jne 0x2bd3
movq %rsi, %rdi
subq %rax, %rdi
addq $-0x4, %rdi
cmpq $0x3f6, %rdi            # imm = 0x3F6
jg 0x2c1c
incb %dl
movb 0x1(%rsi), %dil
orb (%rsi), %dil
jne 0x2bc6
jmp 0x2c1e
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
movl $0x3f7, %edx            # imm = 0x3F7
cmpq $0x3f7, %rdi            # imm = 0x3F7
jg 0x2c54
movl $0x2000e00, (%rsi)      # imm = 0x2000E00
movb %bh, 0x4(%rsi)
movb %bl, 0x5(%rsi)
movw $0x0, 0x6(%rsi)
movzwl 0x3(%rsp), %edx
rolw $0x8, %dx
movzwl %dx, %edx
xorl %edi, %edi
movq %rcx, %rsi
testb %dil, %dil
je 0x2c8b
movzbl %dil, %r8d
movq %rcx, %rsi
movq %rsi, %r9
subq %rax, %r9
cmpq %rdx, %r9
jg 0x2ca8
movzwl 0x2(%rsi), %r9d
rolw $0x8, %r9w
movzwl %r9w, %r9d
addq %r9, %rsi
addq $0x4, %rsi
decw %r8w
jne 0x2c65
movq %rsi, %r8
subq %rax, %r8
addq $-0x4, %r8
cmpq %rdx, %r8
jge 0x2ca8
incb %dil
movb 0x1(%rsi), %r8b
orb (%rsi), %r8b
jne 0x2c56
jmp 0x2caa
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x3, %rdi
cmpq %rdx, %rdi
jg 0x2cd5
movl $0x1000200, (%rsi)      # imm = 0x1000200
movw $0x0, 0x4(%rsi)
movb $0x0, 0x6(%rsi)
movzwl 0x3(%rsp), %edx
rolw $0x8, %dx
movzwl %dx, %edx
xorl %edi, %edi
movq %rcx, %rsi
testb %dil, %dil
je 0x2d0c
movzbl %dil, %r8d
movq %rcx, %rsi
movq %rsi, %r9
subq %rax, %r9
cmpq %rdx, %r9
jg 0x2d29
movzwl 0x2(%rsi), %r9d
rolw $0x8, %r9w
movzwl %r9w, %r9d
addq %r9, %rsi
addq $0x4, %rsi
decw %r8w
jne 0x2ce6
movq %rsi, %r8
subq %rax, %r8
addq $-0x4, %r8
cmpq %rdx, %r8
jge 0x2d29
incb %dil
movb 0x1(%rsi), %r8b
orb (%rsi), %r8b
jne 0x2cd7
jmp 0x2d2b
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
cmpq %rdx, %rdi
jg 0x2d53
movabsq $0xc80002000300, %rdx   # imm = 0xC80002000300
movq %rdx, (%rsi)
movzwl 0x3(%rsp), %edx
rolw $0x8, %dx
movzwl %dx, %edx
xorl %edi, %edi
movq %rcx, %rsi
testb %dil, %dil
je 0x2d8a
movzbl %dil, %r8d
movq %rcx, %rsi
movq %rsi, %r9
subq %rax, %r9
cmpq %rdx, %r9
jg 0x2da7
movzwl 0x2(%rsi), %r9d
rolw $0x8, %r9w
movzwl %r9w, %r9d
addq %r9, %rsi
addq $0x4, %rsi
decw %r8w
jne 0x2d64
movq %rsi, %r8
subq %rax, %r8
addq $-0x4, %r8
cmpq %rdx, %r8
jge 0x2da7
incb %dil
movb 0x1(%rsi), %r8b
orb (%rsi), %r8b
jne 0x2d55
jmp 0x2da9
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
cmpq %rdx, %rdi
jg 0x2dcb
movq $0x2000400, (%rsi)      # imm = 0x2000400
movzwl 0x3(%rsp), %edx
rolw $0x8, %dx
movzwl %dx, %edx
xorl %edi, %edi
movq %rcx, %rsi
testb %dil, %dil
je 0x2e02
movzbl %dil, %r8d
movq %rcx, %rsi
movq %rsi, %r9
subq %rax, %r9
cmpq %rdx, %r9
jg 0x2e1f
movzwl 0x2(%rsi), %r9d
rolw $0x8, %r9w
movzwl %r9w, %r9d
addq %r9, %rsi
addq $0x4, %rsi
decw %r8w
jne 0x2ddc
movq %rsi, %r8
subq %rax, %r8
addq $-0x4, %r8
cmpq %rdx, %r8
jge 0x2e1f
incb %dil
movb 0x1(%rsi), %r8b
orb (%rsi), %r8b
jne 0x2dcd
jmp 0x2e21
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
cmpq %rdx, %rdi
jg 0x2e49
movabsq $0x2c0102000700, %rdx   # imm = 0x2C0102000700
movq %rdx, (%rsi)
movzwl 0x3(%rsp), %edx
rolw $0x8, %dx
movzwl %dx, %edx
xorl %edi, %edi
movq %rcx, %rsi
testb %dil, %dil
je 0x2e80
movzbl %dil, %r8d
movq %rcx, %rsi
movq %rsi, %r9
subq %rax, %r9
cmpq %rdx, %r9
jg 0x2e9d
movzwl 0x2(%rsi), %r9d
rolw $0x8, %r9w
movzwl %r9w, %r9d
addq %r9, %rsi
addq $0x4, %rsi
decw %r8w
jne 0x2e5a
movq %rsi, %r8
subq %rax, %r8
addq $-0x4, %r8
cmpq %rdx, %r8
jge 0x2e9d
incb %dil
movb 0x1(%rsi), %r8b
orb (%rsi), %r8b
jne 0x2e4b
jmp 0x2e9f
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
cmpq %rdx, %rdi
jg 0x2ec7
movabsq $0xf40102000800, %rdx   # imm = 0xF40102000800
movq %rdx, (%rsi)
movzwl 0x3(%rsp), %edx
rolw $0x8, %dx
movzwl %dx, %edx
xorl %edi, %edi
movq %rcx, %rsi
testb %dil, %dil
je 0x2efe
movzbl %dil, %r8d
movq %rcx, %rsi
movq %rsi, %r9
subq %rax, %r9
cmpq %rdx, %r9
jg 0x2f1b
movzwl 0x2(%rsi), %r9d
rolw $0x8, %r9w
movzwl %r9w, %r9d
addq %r9, %rsi
addq $0x4, %rsi
decw %r8w
jne 0x2ed8
movq %rsi, %r8
subq %rax, %r8
addq $-0x4, %r8
cmpq %rdx, %r8
jge 0x2f1b
incb %dil
movb 0x1(%rsi), %r8b
orb (%rsi), %r8b
jne 0x2ec9
jmp 0x2f1d
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
cmpq %rdx, %rdi
jg 0x2f45
movabsq $0x30002000900, %rdx    # imm = 0x30002000900
movq %rdx, (%rsi)
movzwl 0x3(%rsp), %edx
rolw $0x8, %dx
movzwl %dx, %edx
xorl %edi, %edi
movq %rcx, %rsi
testb %dil, %dil
je 0x2f7c
movzbl %dil, %r8d
movq %rcx, %rsi
movq %rsi, %r9
subq %rax, %r9
cmpq %rdx, %r9
jg 0x2f99
movzwl 0x2(%rsi), %r9d
rolw $0x8, %r9w
movzwl %r9w, %r9d
addq %r9, %rsi
addq $0x4, %rsi
decw %r8w
jne 0x2f56
movq %rsi, %r8
subq %rax, %r8
addq $-0x4, %r8
cmpq %rdx, %r8
jge 0x2f99
incb %dil
movb 0x1(%rsi), %r8b
orb (%rsi), %r8b
jne 0x2f47
jmp 0x2f9b
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x3, %rdi
cmpq %rdx, %rdi
jg 0x2fc6
movl $0x1000a00, (%rsi)      # imm = 0x1000A00
movw $0x1, 0x4(%rsi)
movb $0x0, 0x6(%rsi)
movzwl 0x3(%rsp), %edx
rolw $0x8, %dx
movzwl %dx, %edx
xorl %edi, %edi
movq %rcx, %rsi
testb %dil, %dil
je 0x2ffd
movzbl %dil, %r8d
movq %rcx, %rsi
movq %rsi, %r9
subq %rax, %r9
cmpq %rdx, %r9
jg 0x301a
movzwl 0x2(%rsi), %r9d
rolw $0x8, %r9w
movzwl %r9w, %r9d
addq %r9, %rsi
addq $0x4, %rsi
decw %r8w
jne 0x2fd7
movq %rsi, %r8
subq %rax, %r8
addq $-0x4, %r8
cmpq %rdx, %r8
jge 0x301a
incb %dil
movb 0x1(%rsi), %r8b
orb (%rsi), %r8b
jne 0x2fc8
jmp 0x301c
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x3, %rdi
cmpq %rdx, %rdi
jg 0x3047
movl $0x1000b00, (%rsi)      # imm = 0x1000B00
movw $0x2, 0x4(%rsi)
movb $0x0, 0x6(%rsi)
movzwl 0x3(%rsp), %edx
rolw $0x8, %dx
movzwl %dx, %edx
xorl %edi, %edi
movq %rcx, %rsi
testb %dil, %dil
je 0x307e
movzbl %dil, %r8d
movq %rcx, %rsi
movq %rsi, %r9
subq %rax, %r9
cmpq %rdx, %r9
jg 0x309b
movzwl 0x2(%rsi), %r9d
rolw $0x8, %r9w
movzwl %r9w, %r9d
addq %r9, %rsi
addq $0x4, %rsi
decw %r8w
jne 0x3058
movq %rsi, %r8
subq %rax, %r8
addq $-0x4, %r8
cmpq %rdx, %r8
jge 0x309b
incb %dil
movb 0x1(%rsi), %r8b
orb (%rsi), %r8b
jne 0x3049
jmp 0x309d
xorl %esi, %esi
movq %rsi, %rdi
subq %rax, %rdi
addq $0x4, %rdi
cmpq %rdx, %rdi
jg 0x30c5
movabsq $0x640002000c00, %rdx   # imm = 0x640002000C00
movq %rdx, (%rsi)
movzwl 0x3(%rsp), %edx
rolw $0x8, %dx
movzwl %dx, %edx
xorl %edi, %edi
movq %rcx, %rsi
testb %dil, %dil
je 0x30fc
movzbl %dil, %r8d
movq %rcx, %rsi
movq %rsi, %r9
subq %rax, %r9
cmpq %rdx, %r9
jg 0x3119
movzwl 0x2(%rsi), %r9d
rolw $0x8, %r9w
movzwl %r9w, %r9d
addq %r9, %rsi
addq $0x4, %rsi
decw %r8w
jne 0x30d6
movq %rsi, %r8
subq %rax, %r8
addq $-0x4, %r8
cmpq %rdx, %r8
jge 0x3119
incb %dil
movb 0x1(%rsi), %r8b
orb (%rsi), %r8b
jne 0x30c7
jmp 0x311b
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 0x195e
addq $0x400, %rsp            # imm = 0x400
popq %rbx
retq