#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*/ add_time(int *, int *, int *, int *, int *, int *, int, int);
int code_table_1_2(unsigned char **);
int code_table_4_0(unsigned char **);
int code_table_4_4(unsigned char **);
int forecast_time_in_units(unsigned char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ get_time(unsigned char *, int *, int *, int *, int *, int *,
                            int *);
int /*<<< orphan*/ stderr;
int start_ft(unsigned char **sec, int *year, int *month, int *day, int *hour,
             int *minute, int *second) {
  int units, i;
  int dtime;
  static int error_count = 0;
  static int warning_count = 0;
  i = code_table_4_0(sec);
  get_time(sec[1] + 12, year, month, day, hour, minute, second);
  if ((units = code_table_4_4(sec)) == -1)
    return 0;
  i = code_table_1_2(sec);
  if (i == 2) {
    if (warning_count == 0) {
      fprintf(stderr, "Warning: rt == vt (CodeTable 1.2)\n");
      warning_count++;
    }
    return 0;
  }
  if (i != 0 && i != 1) {
    if (error_count == 0) {
      fprintf(stderr,
              "verifyingtime: Table 1.2=%d not supported "
              " using RT=analysis/start of forecast\n",
              i);
      error_count++;
    }
  }
  dtime = forecast_time_in_units(sec);
  add_time(year, month, day, hour, minute, second, dtime, units);
  return 0;
}


x86 assembly (clang, -O0):
<start_ft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <code_table_4_0@plt>
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
add    $0xc,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <get_time@plt>
mov    -0x10(%rbp),%rdi
call   1080 <code_table_4_4@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0xffffffff,%eax
jne    11ee <start_ft+0x7e>
movl   $0x0,-0x4(%rbp)
jmp    12d1 <start_ft+0x161>
mov    -0x10(%rbp),%rdi
call   1060 <code_table_1_2@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x2,-0x40(%rbp)
jne    1243 <start_ft+0xd3>
cmpl   $0x0,0x2e55(%rip)
jne    1237 <start_ft+0xc7>
mov    0x2dc8(%rip),%rax
mov    (%rax),%edi
lea    0xddf(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e32(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e29(%rip)
movl   $0x0,-0x4(%rbp)
jmp    12d1 <start_ft+0x161>
cmpl   $0x0,-0x40(%rbp)
je     1292 <start_ft+0x122>
cmpl   $0x1,-0x40(%rbp)
je     1292 <start_ft+0x122>
cmpl   $0x0,0x2dfe(%rip)
jne    128d <start_ft+0x11d>
mov    0x2d75(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%edx
lea    0xdac(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2dd8(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2dcf(%rip)
jmp    1292 <start_ft+0x122>
mov    -0x10(%rbp),%rdi
call   1090 <forecast_time_in_units@plt>
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    0x10(%rbp),%r9
mov    -0x44(%rbp),%r10d
mov    -0x3c(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <add_time@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_ft>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%r14
mov    %r8,%rbp
mov    %rcx,%rbx
mov    %rdx,%r13
mov    %rsi,%r15
mov    %rdi,%r12
call   1070 <code_table_4_0@plt>
mov    0x8(%r12),%rdi
add    $0xc,%rdi
sub    $0x8,%rsp
mov    %r15,0x8(%rsp)
mov    %r15,%rsi
mov    %r13,0x10(%rsp)
mov    %r13,%rdx
mov    %rbx,0x18(%rsp)
mov    %rbx,%rcx
mov    0x68(%rsp),%rbx
mov    %rbp,0x20(%rsp)
mov    %rbp,%r8
mov    %r14,0x28(%rsp)
mov    %r14,%r9
push   %rbx
call   1040 <get_time@plt>
add    $0x10,%rsp
mov    %r12,%rdi
call   1080 <code_table_4_4@plt>
cmp    $0xffffffff,%eax
je     127d <start_ft+0x10d>
mov    %eax,%r14d
mov    %r12,%rdi
call   1060 <code_table_1_2@plt>
cmp    $0x2,%eax
jne    1223 <start_ft+0xb3>
cmpl   $0x0,0x2e5f(%rip)
jne    127d <start_ft+0x10d>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
lea    0xded(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
addl   $0x1,0x2e3f(%rip)
jmp    127d <start_ft+0x10d>
jb     124e <start_ft+0xde>
cmpl   $0x0,0x2e30(%rip)
jne    124e <start_ft+0xde>
mov    0x2dab(%rip),%rcx
mov    (%rcx),%edi
lea    0xde5(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
addl   $0x1,0x2e0e(%rip)
mov    %r12,%rdi
call   1090 <forecast_time_in_units@plt>
mov    (%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    0x10(%rsp),%rdx
mov    0x18(%rsp),%rcx
mov    0x20(%rsp),%r8
mov    %rbx,%r9
push   %r14
push   %rax
call   1030 <add_time@plt>
add    $0x10,%rsp
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@start_ft.error_count = internal global i32 0
@start_ft.warning_count = internal global i32 0
@stderr = global i32 0
@.str = [35 x i8] c"Warning: rt == vt (CodeTable 1.2)\0A\00"
@.str.1 = [80 x i8] c"verifyingtime: Table 1.2=%d not supported using RT=analysis/start of forecast\0A\00"
define i32 @start_ft(i8** %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i8** %0, i8*** %9
store i32* %1, i32** %10
store i32* %2, i32** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store i32* %5, i32** %14
store i32* %6, i32** %15
%19 = load i8**, i8*** %9
%20 = call i32 @code_table_4_0(i8** %19)
store i32 %20, i32* %17
%21 = load i8**, i8*** %9
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 12
%25 = load i32*, i32** %10
%26 = load i32*, i32** %11
%27 = load i32*, i32** %12
%28 = load i32*, i32** %13
%29 = load i32*, i32** %14
%30 = load i32*, i32** %15
%31 = call i32 @get_time(i8* %24, i32* %25, i32* %26, i32* %27, i32* %28, i32* %29, i32* %30)
%32 = load i8**, i8*** %9
%33 = call i32 @code_table_4_4(i8** %32)
store i32 %33, i32* %16
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %36
35: ; preds = %7
store i32 0, i32* %8
br label %78
36: ; preds = %7
%37 = load i8**, i8*** %9
%38 = call i32 @code_table_1_2(i8** %37)
store i32 %38, i32* %17
%39 = load i32, i32* %17
%40 = icmp eq i32 %39, 2
br i1 %40, label %41, label %50
41: ; preds = %36
%42 = load i32, i32* @start_ft.warning_count
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = load i32, i32* @stderr
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%47 = load i32, i32* @start_ft.warning_count
%48 = add nsw i32 %47, 1
store i32 %48, i32* @start_ft.warning_count
br label %49
49: ; preds = %44, %41
store i32 0, i32* %8
br label %78
50: ; preds = %36
%51 = load i32, i32* %17
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %66
53: ; preds = %50
%54 = load i32, i32* %17
%55 = icmp ne i32 %54, 1
br i1 %55, label %56, label %66
56: ; preds = %53
%57 = load i32, i32* @start_ft.error_count
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %65
59: ; preds = %56
%60 = load i32, i32* @stderr
%61 = load i32, i32* %17
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0), i32 %61)
%63 = load i32, i32* @start_ft.error_count
%64 = add nsw i32 %63, 1
store i32 %64, i32* @start_ft.error_count
br label %65
65: ; preds = %59, %56
br label %66
66: ; preds = %65, %53, %50
%67 = load i8**, i8*** %9
%68 = call i32 @forecast_time_in_units(i8** %67)
store i32 %68, i32* %18
%69 = load i32*, i32** %10
%70 = load i32*, i32** %11
%71 = load i32*, i32** %12
%72 = load i32*, i32** %13
%73 = load i32*, i32** %14
%74 = load i32*, i32** %15
%75 = load i32, i32* %18
%76 = load i32, i32* %16
%77 = call i32 @add_time(i32* %69, i32* %70, i32* %71, i32* %72, i32* %73, i32* %74, i32 %75, i32 %76)
store i32 0, i32* %8
br label %78
78: ; preds = %66, %49, %35
%79 = load i32, i32* %8
ret i32 %79
}

LLVM IR (-O2):
@start_ft.error_count = internal unnamed_addr global i32 0
@start_ft.warning_count = internal unnamed_addr global i32 0
@stderr = global i32 0
@.str = [35 x i8] c"Warning: rt == vt (CodeTable 1.2)\0A\00"
@.str.1 = [80 x i8] c"verifyingtime: Table 1.2=%d not supported using RT=analysis/start of forecast\0A\00"
define i32 @start_ft(i8** %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = tail call i32 @code_table_4_0(i8** %0)
%9 = getelementptr inbounds i8*, i8** %0, i64 1
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i64 12
%12 = tail call i32 @get_time(i8* %11, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%13 = tail call i32 @code_table_4_4(i8** %0)
%14 = icmp eq i32 %13, -1
br i1 %14, label %39, label %15
15: ; preds = %7
%16 = tail call i32 @code_table_1_2(i8** %0)
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %26
18: ; preds = %15
%19 = load i32, i32* @start_ft.warning_count
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %39
21: ; preds = %18
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%24 = load i32, i32* @start_ft.warning_count
%25 = add nsw i32 %24, 1
store i32 %25, i32* @start_ft.warning_count
br label %39
26: ; preds = %15
%27 = icmp ugt i32 %16, 1
%28 = load i32, i32* @start_ft.error_count
%29 = icmp eq i32 %28, 0
%30 = select i1 %27, i1 %29, i1 false
br i1 %30, label %31, label %36
31: ; preds = %26
%32 = load i32, i32* @stderr
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%34 = load i32, i32* @start_ft.error_count
%35 = add nsw i32 %34, 1
store i32 %35, i32* @start_ft.error_count
br label %36
36: ; preds = %31, %26
%37 = tail call i32 @forecast_time_in_units(i8** %0)
%38 = tail call i32 @add_time(i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32 %37, i32 %13)
br label %39
39: ; preds = %18, %21, %7, %36
ret i32 0
}