#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 */
double parse_npt(char const *);
double parse_smpte(char const *, double);
int sscanf(char const *, char *, char *);
double cmml_sec_parse(const char *str) {
  char timespec[16];
  if (str == NULL)
    return -1.0;
  if (sscanf(str, "npt:%16s", timespec) == 1) {
    return parse_npt(str + 4);
  }
  if (sscanf(str, "smpte-24:%16s", timespec) == 1) {
    return parse_smpte(str + 9, 24.0);
  }
  if (sscanf(str, "smpte-24-drop:%16s", timespec) == 1) {
    return parse_smpte(str + 14, 23.976);
  }
  if (sscanf(str, "smpte-25:%16s", timespec) == 1) {
    return parse_smpte(str + 9, 25.0);
  }
  if (sscanf(str, "smpte-30:%16s", timespec) == 1) {
    return parse_smpte(str + 9, 30.0);
  }
  if (sscanf(str, "smpte-30-drop:%16s", timespec) == 1) {
    return parse_smpte(str + 14, 29.97);
  }
  if (sscanf(str, "smpte-50:%16s", timespec) == 1) {
    return parse_smpte(str + 9, 50.0);
  }
  if (sscanf(str, "smpte-60:%16s", timespec) == 1) {
    return parse_smpte(str + 9, 60);
  }
  if (sscanf(str, "smpte-60-drop:%16s", timespec) == 1) {
    return parse_smpte(str + 14, 59.94);
  }
  return parse_npt(str);
}


x86 assembly (clang, -O0):
<cmml_sec_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1159 <cmml_sec_parse+0x29>
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    137b <cmml_sec_parse+0x24b>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rdx
lea    0xee0(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    118d <cmml_sec_parse+0x5d>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
call   1040 <parse_npt@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    137b <cmml_sec_parse+0x24b>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    11c9 <cmml_sec_parse+0x99>
mov    -0x10(%rbp),%rdi
add    $0x9,%rdi
movsd  0xe7e(%rip),%xmm0
call   1030 <parse_smpte@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    137b <cmml_sec_parse+0x24b>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rdx
lea    0xe87(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1205 <cmml_sec_parse+0xd5>
mov    -0x10(%rbp),%rdi
add    $0xe,%rdi
movsd  0xe3a(%rip),%xmm0
call   1030 <parse_smpte@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    137b <cmml_sec_parse+0x24b>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rdx
lea    0xe5e(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1241 <cmml_sec_parse+0x111>
mov    -0x10(%rbp),%rdi
add    $0x9,%rdi
movsd  0xdf6(%rip),%xmm0
call   1030 <parse_smpte@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    137b <cmml_sec_parse+0x24b>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rdx
lea    0xe30(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    127d <cmml_sec_parse+0x14d>
mov    -0x10(%rbp),%rdi
add    $0x9,%rdi
movsd  0xdb2(%rip),%xmm0
call   1030 <parse_smpte@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    137b <cmml_sec_parse+0x24b>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rdx
lea    0xe02(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    12b9 <cmml_sec_parse+0x189>
mov    -0x10(%rbp),%rdi
add    $0xe,%rdi
movsd  0xd6e(%rip),%xmm0
call   1030 <parse_smpte@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    137b <cmml_sec_parse+0x24b>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rdx
lea    0xdd9(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    12f5 <cmml_sec_parse+0x1c5>
mov    -0x10(%rbp),%rdi
add    $0x9,%rdi
movsd  0xd2a(%rip),%xmm0
call   1030 <parse_smpte@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    137b <cmml_sec_parse+0x24b>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rdx
lea    0xdab(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1331 <cmml_sec_parse+0x201>
mov    -0x10(%rbp),%rdi
add    $0x9,%rdi
movsd  0xce6(%rip),%xmm0
call   1030 <parse_smpte@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    137b <cmml_sec_parse+0x24b>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rdx
lea    0xd7d(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    136d <cmml_sec_parse+0x23d>
mov    -0x10(%rbp),%rdi
add    $0xe,%rdi
movsd  0xca2(%rip),%xmm0
call   1030 <parse_smpte@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    137b <cmml_sec_parse+0x24b>
mov    -0x10(%rbp),%rdi
call   1040 <parse_npt@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmml_sec_parse>:
push   %rbx
sub    $0x10,%rsp
test   %rdi,%rdi
je     1162 <cmml_sec_parse+0x32>
mov    %rdi,%rbx
lea    0xf04(%rip),%rsi
mov    %rsp,%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    116f <cmml_sec_parse+0x3f>
add    $0x4,%rbx
mov    %rbx,%rdi
call   1040 <parse_npt@plt>
jmp    12ad <cmml_sec_parse+0x17d>
movsd  0xe96(%rip),%xmm0
jmp    12ad <cmml_sec_parse+0x17d>
lea    0xedb(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1197 <cmml_sec_parse+0x67>
add    $0x9,%rbx
movsd  0xeae(%rip),%xmm0
jmp    12a5 <cmml_sec_parse+0x175>
lea    0xec1(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    11bf <cmml_sec_parse+0x8f>
add    $0xe,%rbx
movsd  0xe7e(%rip),%xmm0
jmp    12a5 <cmml_sec_parse+0x175>
lea    0xeac(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    11e7 <cmml_sec_parse+0xb7>
add    $0x9,%rbx
movsd  0xe4e(%rip),%xmm0
jmp    12a5 <cmml_sec_parse+0x175>
lea    0xe92(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    120f <cmml_sec_parse+0xdf>
add    $0x9,%rbx
movsd  0xe1e(%rip),%xmm0
jmp    12a5 <cmml_sec_parse+0x175>
lea    0xe78(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1234 <cmml_sec_parse+0x104>
add    $0xe,%rbx
movsd  0xdee(%rip),%xmm0
jmp    12a5 <cmml_sec_parse+0x175>
lea    0xe66(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1259 <cmml_sec_parse+0x129>
add    $0x9,%rbx
movsd  0xdc1(%rip),%xmm0
jmp    12a5 <cmml_sec_parse+0x175>
lea    0xe4f(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    127e <cmml_sec_parse+0x14e>
add    $0x9,%rbx
movsd  0xd94(%rip),%xmm0
jmp    12a5 <cmml_sec_parse+0x175>
lea    0xe38(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1155 <cmml_sec_parse+0x25>
add    $0xe,%rbx
movsd  0xd63(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <parse_smpte@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"npt:%16s\00"
@.str.1 = [14 x i8] c"smpte-24:%16s\00"
@.str.2 = [19 x i8] c"smpte-24-drop:%16s\00"
@.str.3 = [14 x i8] c"smpte-25:%16s\00"
@.str.4 = [14 x i8] c"smpte-30:%16s\00"
@.str.5 = [19 x i8] c"smpte-30-drop:%16s\00"
@.str.6 = [14 x i8] c"smpte-50:%16s\00"
@.str.7 = [14 x i8] c"smpte-60:%16s\00"
@.str.8 = [19 x i8] c"smpte-60-drop:%16s\00"
define double @cmml_sec_parse(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca [16 x i8]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store double -1.000000e+00, double* %2
br label %92
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%11 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 4
%16 = call double @parse_npt(i8* %15)
store double %16, double* %2
br label %92
17: ; preds = %8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%20 = call i32 @sscanf(i8* %18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %26
22: ; preds = %17
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 9
%25 = call double @parse_smpte(i8* %24, double 2.400000e+01)
store double %25, double* %2
br label %92
26: ; preds = %17
%27 = load i8*, i8** %3
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%29 = call i32 @sscanf(i8* %27, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %28)
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %35
31: ; preds = %26
%32 = load i8*, i8** %3
%33 = getelementptr inbounds i8, i8* %32, i64 14
%34 = call double @parse_smpte(i8* %33, double 2.397600e+01)
store double %34, double* %2
br label %92
35: ; preds = %26
%36 = load i8*, i8** %3
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%38 = call i32 @sscanf(i8* %36, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %37)
%39 = icmp eq i32 %38, 1
br i1 %39, label %40, label %44
40: ; preds = %35
%41 = load i8*, i8** %3
%42 = getelementptr inbounds i8, i8* %41, i64 9
%43 = call double @parse_smpte(i8* %42, double 2.500000e+01)
store double %43, double* %2
br label %92
44: ; preds = %35
%45 = load i8*, i8** %3
%46 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%47 = call i32 @sscanf(i8* %45, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %46)
%48 = icmp eq i32 %47, 1
br i1 %48, label %49, label %53
49: ; preds = %44
%50 = load i8*, i8** %3
%51 = getelementptr inbounds i8, i8* %50, i64 9
%52 = call double @parse_smpte(i8* %51, double 3.000000e+01)
store double %52, double* %2
br label %92
53: ; preds = %44
%54 = load i8*, i8** %3
%55 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%56 = call i32 @sscanf(i8* %54, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %55)
%57 = icmp eq i32 %56, 1
br i1 %57, label %58, label %62
58: ; preds = %53
%59 = load i8*, i8** %3
%60 = getelementptr inbounds i8, i8* %59, i64 14
%61 = call double @parse_smpte(i8* %60, double 2.997000e+01)
store double %61, double* %2
br label %92
62: ; preds = %53
%63 = load i8*, i8** %3
%64 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%65 = call i32 @sscanf(i8* %63, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %64)
%66 = icmp eq i32 %65, 1
br i1 %66, label %67, label %71
67: ; preds = %62
%68 = load i8*, i8** %3
%69 = getelementptr inbounds i8, i8* %68, i64 9
%70 = call double @parse_smpte(i8* %69, double 5.000000e+01)
store double %70, double* %2
br label %92
71: ; preds = %62
%72 = load i8*, i8** %3
%73 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%74 = call i32 @sscanf(i8* %72, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %73)
%75 = icmp eq i32 %74, 1
br i1 %75, label %76, label %80
76: ; preds = %71
%77 = load i8*, i8** %3
%78 = getelementptr inbounds i8, i8* %77, i64 9
%79 = call double @parse_smpte(i8* %78, double 6.000000e+01)
store double %79, double* %2
br label %92
80: ; preds = %71
%81 = load i8*, i8** %3
%82 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%83 = call i32 @sscanf(i8* %81, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* %82)
%84 = icmp eq i32 %83, 1
br i1 %84, label %85, label %89
85: ; preds = %80
%86 = load i8*, i8** %3
%87 = getelementptr inbounds i8, i8* %86, i64 14
%88 = call double @parse_smpte(i8* %87, double 0x404DF851EB851EB8)
store double %88, double* %2
br label %92
89: ; preds = %80
%90 = load i8*, i8** %3
%91 = call double @parse_npt(i8* %90)
store double %91, double* %2
br label %92
92: ; preds = %89, %85, %76, %67, %58, %49, %40, %31, %22, %13, %7
%93 = load double, double* %2
ret double %93
}

LLVM IR (-O2):
@.str = [9 x i8] c"npt:%16s\00"
@.str.1 = [14 x i8] c"smpte-24:%16s\00"
@.str.2 = [19 x i8] c"smpte-24-drop:%16s\00"
@.str.3 = [14 x i8] c"smpte-25:%16s\00"
@.str.4 = [14 x i8] c"smpte-30:%16s\00"
@.str.5 = [19 x i8] c"smpte-30-drop:%16s\00"
@.str.6 = [14 x i8] c"smpte-50:%16s\00"
@.str.7 = [14 x i8] c"smpte-60:%16s\00"
@.str.8 = [19 x i8] c"smpte-60-drop:%16s\00"
define double @cmml_sec_parse(i8* %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = icmp eq i8* %0, null
br i1 %4, label %61, label %5
5: ; preds = %1
%6 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %0, i64 4
%10 = call double @parse_npt(i8* %9)
br label %61
11: ; preds = %5
%12 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = getelementptr inbounds i8, i8* %0, i64 9
%16 = call double @parse_smpte(i8* %15, double 2.400000e+01)
br label %61
17: ; preds = %11
%18 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = getelementptr inbounds i8, i8* %0, i64 14
%22 = call double @parse_smpte(i8* %21, double 2.397600e+01)
br label %61
23: ; preds = %17
%24 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = getelementptr inbounds i8, i8* %0, i64 9
%28 = call double @parse_smpte(i8* %27, double 2.500000e+01)
br label %61
29: ; preds = %23
%30 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = getelementptr inbounds i8, i8* %0, i64 9
%34 = call double @parse_smpte(i8* %33, double 3.000000e+01)
br label %61
35: ; preds = %29
%36 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%37 = icmp eq i32 %36, 1
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = getelementptr inbounds i8, i8* %0, i64 14
%40 = call double @parse_smpte(i8* %39, double 2.997000e+01)
br label %61
41: ; preds = %35
%42 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%43 = icmp eq i32 %42, 1
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = getelementptr inbounds i8, i8* %0, i64 9
%46 = call double @parse_smpte(i8* %45, double 5.000000e+01)
br label %61
47: ; preds = %41
%48 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%49 = icmp eq i32 %48, 1
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = getelementptr inbounds i8, i8* %0, i64 9
%52 = call double @parse_smpte(i8* %51, double 6.000000e+01)
br label %61
53: ; preds = %47
%54 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i8* %3)
%55 = icmp eq i32 %54, 1
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = getelementptr inbounds i8, i8* %0, i64 14
%58 = call double @parse_smpte(i8* %57, double 0x404DF851EB851EB8)
br label %61
59: ; preds = %53
%60 = call double @parse_npt(i8* %0)
br label %61
61: ; preds = %1, %59, %56, %50, %44, %38, %32, %26, %20, %14, %8
%62 = phi double [ %10, %8 ], [ %16, %14 ], [ %22, %20 ], [ %28, %26 ], [ %34, %32 ], [ %40, %38 ], [ %46, %44 ], [ %52, %50 ], [ %58, %56 ], [ %60, %59 ], [ -1.000000e+00, %1 ]
ret double %62
}