// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/mpeg_print_pcr.c
// Function: main
int main(int i_argc, char **ppsz_argv)
{
    int i;

    if (ppsz_argv[1] != NULL &&
        (!strcmp(ppsz_argv[1], "-h") || !strcmp(ppsz_argv[1], "--help")))
        usage(ppsz_argv[0]);

    setvbuf(stdout, NULL, _IOLBF, 0);

    memset(p_pids, 0, sizeof(p_pids));

    for (i = 0; i < 8192; i++) {
        p_pids[i].i_last_cc = -1;
        psi_assemble_init( &p_pids[i].p_psi_buffer,
                           &p_pids[i].i_psi_buffer_used );
    }

    p_pids[PAT_PID].i_psi_refcount++;

    while (!feof(stdin) && !ferror(stdin)) {
        uint8_t p_ts[TS_SIZE];
        size_t i_ret = fread(p_ts, sizeof(p_ts), 1, stdin);
        if (i_ret != 1) continue;
        if (ts_validate(p_ts)) {
            uint16_t i_pid = ts_get_pid(p_ts);
            ts_pid_t *p_pid = &p_pids[i_pid];
            if (p_pid->i_psi_refcount)
                handle_psi_packet(p_ts);
            p_pid->i_last_cc = ts_get_cc(p_ts);
        }
    }

    return EXIT_FAILURE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1272
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1dc1(%rip), %rsi      # 0x3004
callq 0x1090
cmpl $0x0, %eax
je 0x1266
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1dab(%rip), %rsi      # 0x3007
callq 0x1090
cmpl $0x0, %eax
jne 0x1272
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x1420
movq 0x3d57(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %ecx
movl $0x1, %edx
movq %rcx, %rsi
callq 0x10f0
leaq 0x3e1c(%rip), %rdi      # 0x50b0
xorl %esi, %esi
movl $0x30000, %edx          # imm = 0x30000
callq 0x1070
movl $0x0, -0x14(%rbp)
cmpl $0x2000, -0x14(%rbp)    # imm = 0x2000
jge 0x1302
movslq -0x14(%rbp), %rcx
leaq 0x3df5(%rip), %rax      # 0x50b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movb $-0x1, 0x4(%rax)
movslq -0x14(%rbp), %rax
leaq 0x3ddf(%rip), %rdi      # 0x50b0
imulq $0x18, %rax, %rax
addq %rax, %rdi
addq $0x8, %rdi
movslq -0x14(%rbp), %rax
leaq 0x3dc9(%rip), %rsi      # 0x50b0
imulq $0x18, %rax, %rax
addq %rax, %rsi
addq $0x10, %rsi
callq 0x1460
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x12a7
movl 0x3da8(%rip), %eax      # 0x50b0
addl $0x1, %eax
movl %eax, 0x3d9f(%rip)      # 0x50b0
movq 0x3cc0(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
callq 0x10b0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xe9(%rbp)
jne 0x134c
movq 0x3ca2(%rip), %rax      # 0x4fd8
movq (%rax), %rdi
callq 0x1040
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0xe9(%rbp)
movb -0xe9(%rbp), %al
testb $0x1, %al
jne 0x135b
jmp 0x1406
leaq -0xd0(%rbp), %rdi
movq 0x3c6f(%rip), %rax      # 0x4fd8
movq (%rax), %rcx
movl $0xbc, %esi
movl $0x1, %edx
callq 0x1050
movq %rax, -0xd8(%rbp)
cmpq $0x1, -0xd8(%rbp)
je 0x138e
jmp 0x1311
leaq -0xd0(%rbp), %rdi
callq 0x1490
testb $0x1, %al
jne 0x13a0
jmp 0x1401
leaq -0xd0(%rbp), %rdi
callq 0x14b0
movw %ax, -0xda(%rbp)
movzwl -0xda(%rbp), %eax
movl %eax, %ecx
leaq 0x3ced(%rip), %rax      # 0x50b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
cmpl $0x0, (%rax)
je 0x13e9
leaq -0xd0(%rbp), %rdi
callq 0x14e0
leaq -0xd0(%rbp), %rdi
callq 0x1660
movb %al, %cl
movq -0xe8(%rbp), %rax
movb %cl, 0x4(%rax)
jmp 0x1311
movl $0x1, %eax
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)