#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ mvpstb_get_aud_pts(unsigned long long *);
int /*<<< orphan*/ mvpstb_get_aud_stc(unsigned long long *);
int /*<<< orphan*/ mvpstb_get_vid_pts(unsigned long long *);
int /*<<< orphan*/ mvpstb_get_vid_stc(unsigned long long *);
int /*<<< orphan*/ printf(char *, unsigned int, ...);
int /*<<< orphan*/ stderr;
unsigned int strtoul(char *, int /*<<< orphan*/ *, int);
int get_ts(int argc, char **argv) {
  unsigned int mask, hour, minute, second, ms;
  unsigned long long ts;
  if (argc == 1) {
    fprintf(stderr, "   %s  <vid_stc=1 | vid_pts=2 | aud_stc=4 | aud_pts=8>\n",
            argv[0]);
    return (0);
  }
  mask = strtoul((argv[1]), NULL, 16);
  if (mask & 0x01) {
    mvpstb_get_vid_stc(&ts);
    printf("vid_stc=%09llX ", ts);
    second = ts / (1000 * 90);
    hour = second / 3600;
    minute = second / 60 - hour * 60;
    second = second % 60;
    ms = (ts / ((1000 * 90) / 1000)) % 1000;
    printf("(%02d:%02d:%02d.%03d)\n", hour, minute, second, ms);
  }
  if (mask & 0x02) {
    mvpstb_get_vid_pts(&ts);
    printf("vid_pts=%09llX ", ts);
    second = ts / (1000 * 90);
    hour = second / 3600;
    minute = second / 60 - hour * 60;
    second = second % 60;
    ms = (ts / ((1000 * 90) / 1000)) % 1000;
    printf("(%02d:%02d:%02d.%03d)\n", hour, minute, second, ms);
  }
  if (mask & 0x04) {
    mvpstb_get_aud_stc(&ts);
    printf("aud_stc=%09llX ", ts);
    second = ts / (1000 * 90);
    hour = second / 3600;
    minute = second / 60 - hour * 60;
    second = second % 60;
    ms = (ts / ((1000 * 90) / 1000)) % 1000;
    printf("(%02d:%02d:%02d.%03d)\n", hour, minute, second, ms);
  }
  if (mask & 0x08) {
    mvpstb_get_aud_pts(&ts);
    printf("aud_pts=%09llX ", ts);
    second = ts / (1000 * 90);
    hour = second / 3600;
    minute = second / 60 - hour * 60;
    second = second % 60;
    ms = (ts / ((1000 * 90) / 1000)) % 1000;
    printf("(%02d:%02d:%02d.%03d)\n", hour, minute, second, ms);
  }
  return (0);
}


x86 assembly (clang, -O0):
<get_ts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11b1 <get_ts+0x41>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe60(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1471 <get_ts+0x301>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1090 <strtoul@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1272 <get_ts+0x102>
lea    -0x30(%rbp),%rdi
call   1030 <mvpstb_get_vid_stc@plt>
mov    -0x30(%rbp),%rax
mov    %eax,%esi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rax
mov    $0x15f90,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    $0xe10,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
imul   $0x3c,-0x18(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x5a,%ecx
xor    %edx,%edx
div    %rcx
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     131a <get_ts+0x1aa>
lea    -0x30(%rbp),%rdi
call   1070 <mvpstb_get_vid_pts@plt>
mov    -0x30(%rbp),%rax
mov    %eax,%esi
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rax
mov    $0x15f90,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    $0xe10,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
imul   $0x3c,-0x18(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x5a,%ecx
xor    %edx,%edx
div    %rcx
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xd35(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     13c2 <get_ts+0x252>
lea    -0x30(%rbp),%rdi
call   1040 <mvpstb_get_aud_stc@plt>
mov    -0x30(%rbp),%rax
mov    %eax,%esi
lea    0xd30(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rax
mov    $0x15f90,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    $0xe10,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
imul   $0x3c,-0x18(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x5a,%ecx
xor    %edx,%edx
div    %rcx
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xc8d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     146a <get_ts+0x2fa>
lea    -0x30(%rbp),%rdi
call   1050 <mvpstb_get_aud_pts@plt>
mov    -0x30(%rbp),%rax
mov    %eax,%esi
lea    0xc98(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rax
mov    $0x15f90,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    $0xe10,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
imul   $0x3c,-0x18(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x5a,%ecx
xor    %edx,%edx
div    %rcx
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xbe5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ts>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    119d <get_ts+0x2d>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe6d(%rip),%rsi
call   1080 <fprintf@plt>
jmp    127a <get_ts+0x10a>
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1090 <strtoul@plt>
mov    %eax,%r13d
movabs $0xba69dbdd3ac13d7d,%r12
db 69 ba
movabs $0x2d82d82d82d82d83,%r15
d8 82 2d
movabs $0x20c49ba5e353f7cf,%r14
9b c4 20
test   $0x1,%r13b
jne    128b <get_ts+0x11b>
test   $0x2,%r13b
jne    1319 <get_ts+0x1a9>
test   $0x4,%r13b
jne    13a7 <get_ts+0x237>
test   $0x8,%r13b
je     127a <get_ts+0x10a>
mov    %rsp,%rdi
call   1050 <mvpstb_get_aud_pts@plt>
mov    (%rsp),%esi
lea    0xe77(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rsp),%rdi
mov    %rdi,%rax
mul    %r12
mov    %rdx,%rcx
shr    $0x10,%rcx
mov    %ecx,%eax
mov    $0x91a2b3c5,%esi
imul   %rax,%rsi
shr    $0x2b,%rsi
imul   $0xffffffc4,%esi,%ebp
mov    $0x88888889,%edx
imul   %rax,%rdx
shr    $0x25,%rdx
add    %edx,%ebp
imul   $0x3c,%edx,%ebx
mov    %rdi,%rax
mul    %r15
mov    %rdx,%rax
sub    %ebx,%ecx
mov    %rdx,%r8
shr    $0x7,%rax
mul    %r14
shr    $0x4,%r8
shr    $0x4,%rdx
imul   $0x3e8,%edx,%eax
sub    %eax,%r8d
lea    0xdd7(%rip),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsp,%rdi
call   1030 <mvpstb_get_vid_stc@plt>
mov    (%rsp),%esi
lea    0xd9b(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rsp),%rdi
mov    %rdi,%rax
mul    %r12
mov    %rdx,%rcx
shr    $0x10,%rcx
mov    %ecx,%eax
mov    $0x91a2b3c5,%esi
imul   %rax,%rsi
shr    $0x2b,%rsi
imul   $0xffffffc4,%esi,%ebx
mov    $0x88888889,%edx
imul   %rax,%rdx
shr    $0x25,%rdx
add    %edx,%ebx
imul   $0x3c,%edx,%ebp
mov    %rdi,%rax
mul    %r15
mov    %rdx,%rax
sub    %ebp,%ecx
mov    %rdx,%r8
shr    $0x7,%rax
mul    %r14
shr    $0x4,%r8
shr    $0x4,%rdx
imul   $0x3e8,%edx,%eax
sub    %eax,%r8d
lea    0xd42(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <printf@plt>
test   $0x2,%r13b
je     11e2 <get_ts+0x72>
mov    %rsp,%rdi
call   1070 <mvpstb_get_vid_pts@plt>
mov    (%rsp),%esi
lea    0xd34(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rsp),%rdi
mov    %rdi,%rax
mul    %r12
mov    %rdx,%rcx
shr    $0x10,%rcx
mov    %ecx,%eax
mov    $0x91a2b3c5,%esi
imul   %rax,%rsi
shr    $0x2b,%rsi
imul   $0xffffffc4,%esi,%ebx
mov    $0x88888889,%edx
imul   %rax,%rdx
shr    $0x25,%rdx
add    %edx,%ebx
imul   $0x3c,%edx,%ebp
mov    %rdi,%rax
mul    %r15
mov    %rdx,%rax
sub    %ebp,%ecx
mov    %rdx,%r8
shr    $0x7,%rax
mul    %r14
shr    $0x4,%r8
shr    $0x4,%rdx
imul   $0x3e8,%edx,%eax
sub    %eax,%r8d
lea    0xcb4(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <printf@plt>
test   $0x4,%r13b
je     11ec <get_ts+0x7c>
mov    %rsp,%rdi
call   1040 <mvpstb_get_aud_stc@plt>
mov    (%rsp),%esi
lea    0xcb6(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rsp),%rdi
mov    %rdi,%rax
mul    %r12
mov    %rdx,%rcx
shr    $0x10,%rcx
mov    %ecx,%eax
mov    $0x91a2b3c5,%esi
imul   %rax,%rsi
shr    $0x2b,%rsi
imul   $0xffffffc4,%esi,%ebx
mov    $0x88888889,%edx
imul   %rax,%rdx
shr    $0x25,%rdx
add    %edx,%ebx
imul   $0x3c,%edx,%ebp
mov    %rdi,%rax
mul    %r15
mov    %rdx,%rax
sub    %ebp,%ecx
mov    %rdx,%r8
shr    $0x7,%rax
mul    %r14
shr    $0x4,%r8
shr    $0x4,%rdx
imul   $0x3e8,%edx,%eax
sub    %eax,%r8d
lea    0xc26(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <printf@plt>
test   $0x8,%r13b
jne    11f6 <get_ts+0x86>
jmp    127a <get_ts+0x10a>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c" %s <vid_stc=1 | vid_pts=2 | aud_stc=4 | aud_pts=8>\0A\00"
@.str.1 = [16 x i8] c"vid_stc=%09llX \00"
@.str.2 = [23 x i8] c"(%02d:%02d:%02d.%03d)\0A\00"
@.str.3 = [16 x i8] c"vid_pts=%09llX \00"
@.str.4 = [16 x i8] c"aud_stc=%09llX \00"
@.str.5 = [16 x i8] c"aud_pts=%09llX \00"
define i32 @get_ts(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %18)
store i32 0, i32* %3
br label %145
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @strtoul(i8* %23, i32* null, i32 16)
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = and i32 %25, 1
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %54
28: ; preds = %20
%29 = call i32 @mvpstb_get_vid_stc(i64* %11)
%30 = load i64, i64* %11
%31 = trunc i64 %30 to i32
%32 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = load i64, i64* %11
%34 = udiv i64 %33, 90000
%35 = trunc i64 %34 to i32
store i32 %35, i32* %9
%36 = load i32, i32* %9
%37 = udiv i32 %36, 3600
store i32 %37, i32* %7
%38 = load i32, i32* %9
%39 = udiv i32 %38, 60
%40 = load i32, i32* %7
%41 = mul i32 %40, 60
%42 = sub i32 %39, %41
store i32 %42, i32* %8
%43 = load i32, i32* %9
%44 = urem i32 %43, 60
store i32 %44, i32* %9
%45 = load i64, i64* %11
%46 = udiv i64 %45, 90
%47 = urem i64 %46, 1000
%48 = trunc i64 %47 to i32
store i32 %48, i32* %10
%49 = load i32, i32* %7
%50 = load i32, i32* %8
%51 = load i32, i32* %9
%52 = load i32, i32* %10
%53 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %49, i32 %50, i32 %51, i32 %52)
br label %54
54: ; preds = %28, %20
%55 = load i32, i32* %6
%56 = and i32 %55, 2
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %84
58: ; preds = %54
%59 = call i32 @mvpstb_get_vid_pts(i64* %11)
%60 = load i64, i64* %11
%61 = trunc i64 %60 to i32
%62 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %61)
%63 = load i64, i64* %11
%64 = udiv i64 %63, 90000
%65 = trunc i64 %64 to i32
store i32 %65, i32* %9
%66 = load i32, i32* %9
%67 = udiv i32 %66, 3600
store i32 %67, i32* %7
%68 = load i32, i32* %9
%69 = udiv i32 %68, 60
%70 = load i32, i32* %7
%71 = mul i32 %70, 60
%72 = sub i32 %69, %71
store i32 %72, i32* %8
%73 = load i32, i32* %9
%74 = urem i32 %73, 60
store i32 %74, i32* %9
%75 = load i64, i64* %11
%76 = udiv i64 %75, 90
%77 = urem i64 %76, 1000
%78 = trunc i64 %77 to i32
store i32 %78, i32* %10
%79 = load i32, i32* %7
%80 = load i32, i32* %8
%81 = load i32, i32* %9
%82 = load i32, i32* %10
%83 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %79, i32 %80, i32 %81, i32 %82)
br label %84
84: ; preds = %58, %54
%85 = load i32, i32* %6
%86 = and i32 %85, 4
%87 = icmp ne i32 %86, 0
br i1 %87, label %88, label %114
88: ; preds = %84
%89 = call i32 @mvpstb_get_aud_stc(i64* %11)
%90 = load i64, i64* %11
%91 = trunc i64 %90 to i32
%92 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %91)
%93 = load i64, i64* %11
%94 = udiv i64 %93, 90000
%95 = trunc i64 %94 to i32
store i32 %95, i32* %9
%96 = load i32, i32* %9
%97 = udiv i32 %96, 3600
store i32 %97, i32* %7
%98 = load i32, i32* %9
%99 = udiv i32 %98, 60
%100 = load i32, i32* %7
%101 = mul i32 %100, 60
%102 = sub i32 %99, %101
store i32 %102, i32* %8
%103 = load i32, i32* %9
%104 = urem i32 %103, 60
store i32 %104, i32* %9
%105 = load i64, i64* %11
%106 = udiv i64 %105, 90
%107 = urem i64 %106, 1000
%108 = trunc i64 %107 to i32
store i32 %108, i32* %10
%109 = load i32, i32* %7
%110 = load i32, i32* %8
%111 = load i32, i32* %9
%112 = load i32, i32* %10
%113 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %109, i32 %110, i32 %111, i32 %112)
br label %114
114: ; preds = %88, %84
%115 = load i32, i32* %6
%116 = and i32 %115, 8
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %144
118: ; preds = %114
%119 = call i32 @mvpstb_get_aud_pts(i64* %11)
%120 = load i64, i64* %11
%121 = trunc i64 %120 to i32
%122 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %121)
%123 = load i64, i64* %11
%124 = udiv i64 %123, 90000
%125 = trunc i64 %124 to i32
store i32 %125, i32* %9
%126 = load i32, i32* %9
%127 = udiv i32 %126, 3600
store i32 %127, i32* %7
%128 = load i32, i32* %9
%129 = udiv i32 %128, 60
%130 = load i32, i32* %7
%131 = mul i32 %130, 60
%132 = sub i32 %129, %131
store i32 %132, i32* %8
%133 = load i32, i32* %9
%134 = urem i32 %133, 60
store i32 %134, i32* %9
%135 = load i64, i64* %11
%136 = udiv i64 %135, 90
%137 = urem i64 %136, 1000
%138 = trunc i64 %137 to i32
store i32 %138, i32* %10
%139 = load i32, i32* %7
%140 = load i32, i32* %8
%141 = load i32, i32* %9
%142 = load i32, i32* %10
%143 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %139, i32 %140, i32 %141, i32 %142)
br label %144
144: ; preds = %118, %114
store i32 0, i32* %3
br label %145
145: ; preds = %144, %14
%146 = load i32, i32* %3
ret i32 %146
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c" %s <vid_stc=1 | vid_pts=2 | aud_stc=4 | aud_pts=8>\0A\00"
@.str.1 = [16 x i8] c"vid_stc=%09llX \00"
@.str.2 = [23 x i8] c"(%02d:%02d:%02d.%03d)\0A\00"
@.str.3 = [16 x i8] c"vid_pts=%09llX \00"
@.str.4 = [16 x i8] c"aud_stc=%09llX \00"
@.str.5 = [16 x i8] c"aud_pts=%09llX \00"
define i32 @get_ts(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = icmp eq i32 %0, 1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %93
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @strtoul(i8* nocapture %12, i32* null, i32 16)
%14 = and i32 %13, 1
%15 = icmp eq i32 %14, 0
br i1 %15, label %33, label %16
16: ; preds = %10
%17 = call i32 @mvpstb_get_vid_stc(i64* %3)
%18 = load i64, i64* %3
%19 = trunc i64 %18 to i32
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i64, i64* %3
%22 = udiv i64 %21, 90000
%23 = trunc i64 %22 to i32
%24 = udiv i32 %23, 3600
%25 = udiv i32 %23, 60
%26 = mul nsw i32 %24, -60
%27 = add nsw i32 %26, %25
%28 = urem i32 %23, 60
%29 = udiv i64 %21, 90
%30 = urem i64 %29, 1000
%31 = trunc i64 %30 to i32
%32 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %24, i32 %27, i32 %28, i32 %31)
br label %33
33: ; preds = %16, %10
%34 = and i32 %13, 2
%35 = icmp eq i32 %34, 0
br i1 %35, label %53, label %36
36: ; preds = %33
%37 = call i32 @mvpstb_get_vid_pts(i64* %3)
%38 = load i64, i64* %3
%39 = trunc i64 %38 to i32
%40 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %39)
%41 = load i64, i64* %3
%42 = udiv i64 %41, 90000
%43 = trunc i64 %42 to i32
%44 = udiv i32 %43, 3600
%45 = udiv i32 %43, 60
%46 = mul nsw i32 %44, -60
%47 = add nsw i32 %46, %45
%48 = urem i32 %43, 60
%49 = udiv i64 %41, 90
%50 = urem i64 %49, 1000
%51 = trunc i64 %50 to i32
%52 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %44, i32 %47, i32 %48, i32 %51)
br label %53
53: ; preds = %36, %33
%54 = and i32 %13, 4
%55 = icmp eq i32 %54, 0
br i1 %55, label %73, label %56
56: ; preds = %53
%57 = call i32 @mvpstb_get_aud_stc(i64* %3)
%58 = load i64, i64* %3
%59 = trunc i64 %58 to i32
%60 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %59)
%61 = load i64, i64* %3
%62 = udiv i64 %61, 90000
%63 = trunc i64 %62 to i32
%64 = udiv i32 %63, 3600
%65 = udiv i32 %63, 60
%66 = mul nsw i32 %64, -60
%67 = add nsw i32 %66, %65
%68 = urem i32 %63, 60
%69 = udiv i64 %61, 90
%70 = urem i64 %69, 1000
%71 = trunc i64 %70 to i32
%72 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %64, i32 %67, i32 %68, i32 %71)
br label %73
73: ; preds = %56, %53
%74 = and i32 %13, 8
%75 = icmp eq i32 %74, 0
br i1 %75, label %93, label %76
76: ; preds = %73
%77 = call i32 @mvpstb_get_aud_pts(i64* %3)
%78 = load i64, i64* %3
%79 = trunc i64 %78 to i32
%80 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %79)
%81 = load i64, i64* %3
%82 = udiv i64 %81, 90000
%83 = trunc i64 %82 to i32
%84 = udiv i32 %83, 3600
%85 = udiv i32 %83, 60
%86 = mul nsw i32 %84, -60
%87 = add nsw i32 %86, %85
%88 = urem i32 %83, 60
%89 = udiv i64 %81, 90
%90 = urem i64 %89, 1000
%91 = trunc i64 %90 to i32
%92 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %84, i32 %87, i32 %88, i32 %91)
br label %93
93: ; preds = %73, %76, %6
ret i32 0
}