#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 */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct TYPE_4__ {
  scalar_t__ tm_wday;
  int tm_hour;
  int tm_min;
  long tm_sec;
};
struct TYPE_3__ {
  scalar_t__ tm_wday;
  int tm_hour;
  int tm_min;
  long tm_sec;
};

/* Variables and functions */
TYPE_2__ *gmtime(int /*<<< orphan*/ *);
TYPE_1__ *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
long get_tz_offset(void) {
  time_t now;
  time(&now);
  if (localtime(&now)->tm_wday == gmtime(&now)->tm_wday)
    return (localtime(&now)->tm_hour - gmtime(&now)->tm_hour) * 3600 +
           (localtime(&now)->tm_min - gmtime(&now)->tm_min) * 60 +
           localtime(&now)->tm_sec - gmtime(&now)->tm_sec;
  if ((localtime(&now)->tm_wday - gmtime(&now)->tm_wday == -1) ||
      (localtime(&now)->tm_wday - gmtime(&now)->tm_wday == 1))
    return (localtime(&now)->tm_wday - gmtime(&now)->tm_wday) * 86400 +
           (localtime(&now)->tm_hour - gmtime(&now)->tm_hour) * 3600 +
           (localtime(&now)->tm_min - gmtime(&now)->tm_min) * 60 +
           localtime(&now)->tm_sec - gmtime(&now)->tm_sec;
  if ((localtime(&now)->tm_wday - gmtime(&now)->tm_wday == 6) ||
      (localtime(&now)->tm_wday - gmtime(&now)->tm_wday == -6))
    return (localtime(&now)->tm_wday - gmtime(&now)->tm_wday) * -14400 +
           (localtime(&now)->tm_hour - gmtime(&now)->tm_hour) * 3600 +
           (localtime(&now)->tm_min - gmtime(&now)->tm_min) * 60 +
           localtime(&now)->tm_sec - gmtime(&now)->tm_sec;
  return 0;
}


x86 assembly (clang, -O0):
<get_tz_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    (%rcx),%rax
jne    11fb <get_tz_offset+0xcb>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    0x8(%rax),%eax
mov    %eax,-0x34(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,%rcx
mov    -0x34(%rbp),%eax
sub    0x8(%rcx),%eax
imul   $0xe10,%eax,%eax
mov    %eax,-0x2c(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    0xc(%rax),%eax
mov    %eax,-0x30(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    -0x30(%rbp),%ecx
mov    %rax,%rdx
mov    -0x2c(%rbp),%eax
sub    0xc(%rdx),%ecx
imul   $0x3c,%ecx,%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x28(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    0x10(%rcx),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    0x10(%rcx),%rax
mov    %rax,-0x8(%rbp)
jmp    1481 <get_tz_offset+0x351>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
sub    (%rcx),%rax
cmp    $0xffffffffffffffff,%rax
je     1255 <get_tz_offset+0x125>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
sub    (%rcx),%rax
cmp    $0x1,%rax
jne    131f <get_tz_offset+0x1ef>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%rax
mov    %rax,-0x80(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,%rcx
mov    -0x80(%rbp),%rax
sub    (%rcx),%rax
imul   $0x15180,%rax,%rax
mov    %rax,-0x70(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    0x8(%rax),%eax
mov    %eax,-0x74(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    -0x74(%rbp),%ecx
mov    %rax,%rdx
mov    -0x70(%rbp),%rax
sub    0x8(%rdx),%ecx
imul   $0xe10,%ecx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    0xc(%rax),%eax
mov    %eax,-0x64(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    -0x64(%rbp),%ecx
mov    %rax,%rdx
mov    -0x60(%rbp),%rax
sub    0xc(%rdx),%ecx
imul   $0x3c,%ecx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
add    0x10(%rcx),%rax
mov    %rax,-0x50(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
sub    0x10(%rcx),%rax
mov    %rax,-0x8(%rbp)
jmp    1481 <get_tz_offset+0x351>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%rax
mov    %rax,-0x88(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,%rcx
mov    -0x88(%rbp),%rax
sub    (%rcx),%rax
cmp    $0x6,%rax
je     1385 <get_tz_offset+0x255>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%rax
mov    %rax,-0x90(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,%rcx
mov    -0x90(%rbp),%rax
sub    (%rcx),%rax
cmp    $0xfffffffffffffffa,%rax
jne    1479 <get_tz_offset+0x349>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%rax
mov    %rax,-0xc8(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,%rcx
mov    -0xc8(%rbp),%rax
sub    (%rcx),%rax
imul   $0xffffffffffffc7c0,%rax,%rax
mov    %rax,-0xb8(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    0x8(%rax),%eax
mov    %eax,-0xbc(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    -0xbc(%rbp),%ecx
mov    %rax,%rdx
mov    -0xb8(%rbp),%rax
sub    0x8(%rdx),%ecx
imul   $0xe10,%ecx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0xa8(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    0xc(%rax),%eax
mov    %eax,-0xac(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    -0xac(%rbp),%ecx
mov    %rax,%rdx
mov    -0xa8(%rbp),%rax
sub    0xc(%rdx),%ecx
imul   $0x3c,%ecx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0xa0(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rcx
mov    -0xa0(%rbp),%rax
add    0x10(%rcx),%rax
mov    %rax,-0x98(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,%rcx
mov    -0x98(%rbp),%rax
sub    0x10(%rcx),%rax
mov    %rax,-0x8(%rbp)
jmp    1481 <get_tz_offset+0x351>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tz_offset>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%r15
mov    %r15,%rdi
call   1040 <time@plt>
mov    %r15,%rdi
call   1030 <localtime@plt>
mov    (%rax),%r14
mov    %r15,%rdi
call   1050 <gmtime@plt>
mov    (%rax),%rbx
mov    %r15,%rdi
call   1030 <localtime@plt>
cmp    %rbx,%r14
jne    11af <get_tz_offset+0x7f>
mov    0x8(%rax),%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <gmtime@plt>
sub    0x8(%rax),%ebx
imul   $0xe10,%ebx,%ebx
mov    %r14,%rdi
call   1030 <localtime@plt>
mov    0xc(%rax),%ebp
mov    %r14,%rdi
call   1050 <gmtime@plt>
sub    0xc(%rax),%ebp
imul   $0x3c,%ebp,%eax
add    %ebx,%eax
movslq %eax,%rbx
mov    %r14,%rdi
call   1030 <localtime@plt>
add    0x10(%rax),%rbx
jmp    12c5 <get_tz_offset+0x195>
mov    (%rax),%rbx
lea    0x4(%rsp),%rdi
call   1050 <gmtime@plt>
sub    (%rax),%rbx
cmp    $0xffffffffffffffff,%rbx
je     11e6 <get_tz_offset+0xb6>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%rbp
mov    %rbx,%rdi
call   1050 <gmtime@plt>
sub    (%rax),%rbp
cmp    $0x1,%rbp
jne    120a <get_tz_offset+0xda>
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <localtime@plt>
mov    (%rax),%rbx
mov    %r14,%rdi
call   1050 <gmtime@plt>
sub    (%rax),%rbx
imul   $0x15180,%rbx,%rbp
jmp    1272 <get_tz_offset+0x142>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%rbp
mov    %rbx,%rdi
call   1050 <gmtime@plt>
sub    (%rax),%rbp
cmp    $0x6,%rbp
je     1250 <get_tz_offset+0x120>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%rbp
mov    %rbx,%rdi
call   1050 <gmtime@plt>
sub    (%rax),%rbp
cmp    $0xfffffffffffffffa,%rbp
jne    12df <get_tz_offset+0x1af>
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <localtime@plt>
mov    (%rax),%rbx
mov    %r14,%rdi
call   1050 <gmtime@plt>
sub    (%rax),%rbx
imul   $0xffffffffffffc7c0,%rbx,%rbp
mov    %r14,%rdi
call   1030 <localtime@plt>
movslq 0x8(%rax),%rbx
mov    %r14,%rdi
call   1050 <gmtime@plt>
movslq 0x8(%rax),%rax
sub    %rax,%rbx
imul   $0xe10,%rbx,%rbx
add    %rbp,%rbx
mov    %r14,%rdi
call   1030 <localtime@plt>
movslq 0xc(%rax),%rbp
mov    %r14,%rdi
call   1050 <gmtime@plt>
movslq 0xc(%rax),%rax
sub    %rax,%rbp
imul   $0x3c,%rbp,%rbp
mov    %r14,%rdi
call   1030 <localtime@plt>
add    0x10(%rax),%rbx
add    %rbp,%rbx
mov    %r14,%rdi
call   1050 <gmtime@plt>
sub    0x10(%rax),%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebx,%ebx
jmp    12d1 <get_tz_offset+0x1a1>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i32, i32, i64 }
%struct.TYPE_4__ = type { i64, i32, i32, i64 }
define i64 @get_tz_offset() {
%1 = alloca i64
%2 = alloca i32
%3 = call i32 @time(i32* %2)
%4 = call %struct.TYPE_3__* @localtime(i32* %2)
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = call %struct.TYPE_4__* @gmtime(i32* %2)
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = icmp eq i64 %6, %9
br i1 %10, label %11, label %38
11: ; preds = %0
%12 = call %struct.TYPE_3__* @localtime(i32* %2)
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = call %struct.TYPE_4__* @gmtime(i32* %2)
%16 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %15, i32 0, i32 1
%17 = load i32, i32* %16
%18 = sub nsw i32 %14, %17
%19 = mul nsw i32 %18, 3600
%20 = call %struct.TYPE_3__* @localtime(i32* %2)
%21 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %20, i32 0, i32 2
%22 = load i32, i32* %21
%23 = call %struct.TYPE_4__* @gmtime(i32* %2)
%24 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %23, i32 0, i32 2
%25 = load i32, i32* %24
%26 = sub nsw i32 %22, %25
%27 = mul nsw i32 %26, 60
%28 = add nsw i32 %19, %27
%29 = sext i32 %28 to i64
%30 = call %struct.TYPE_3__* @localtime(i32* %2)
%31 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %30, i32 0, i32 3
%32 = load i64, i64* %31
%33 = add nsw i64 %29, %32
%34 = call %struct.TYPE_4__* @gmtime(i32* %2)
%35 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %34, i32 0, i32 3
%36 = load i64, i64* %35
%37 = sub nsw i64 %33, %36
store i64 %37, i64* %1
br label %149
38: ; preds = %0
%39 = call %struct.TYPE_3__* @localtime(i32* %2)
%40 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %39, i32 0, i32 0
%41 = load i64, i64* %40
%42 = call %struct.TYPE_4__* @gmtime(i32* %2)
%43 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %42, i32 0, i32 0
%44 = load i64, i64* %43
%45 = sub nsw i64 %41, %44
%46 = icmp eq i64 %45, -1
br i1 %46, label %56, label %47
47: ; preds = %38
%48 = call %struct.TYPE_3__* @localtime(i32* %2)
%49 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %48, i32 0, i32 0
%50 = load i64, i64* %49
%51 = call %struct.TYPE_4__* @gmtime(i32* %2)
%52 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %51, i32 0, i32 0
%53 = load i64, i64* %52
%54 = sub nsw i64 %50, %53
%55 = icmp eq i64 %54, 1
br i1 %55, label %56, label %93
56: ; preds = %47, %38
%57 = call %struct.TYPE_3__* @localtime(i32* %2)
%58 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %57, i32 0, i32 0
%59 = load i64, i64* %58
%60 = call %struct.TYPE_4__* @gmtime(i32* %2)
%61 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %60, i32 0, i32 0
%62 = load i64, i64* %61
%63 = sub nsw i64 %59, %62
%64 = mul nsw i64 %63, 86400
%65 = call %struct.TYPE_3__* @localtime(i32* %2)
%66 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %65, i32 0, i32 1
%67 = load i32, i32* %66
%68 = call %struct.TYPE_4__* @gmtime(i32* %2)
%69 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %68, i32 0, i32 1
%70 = load i32, i32* %69
%71 = sub nsw i32 %67, %70
%72 = mul nsw i32 %71, 3600
%73 = sext i32 %72 to i64
%74 = add nsw i64 %64, %73
%75 = call %struct.TYPE_3__* @localtime(i32* %2)
%76 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %75, i32 0, i32 2
%77 = load i32, i32* %76
%78 = call %struct.TYPE_4__* @gmtime(i32* %2)
%79 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %78, i32 0, i32 2
%80 = load i32, i32* %79
%81 = sub nsw i32 %77, %80
%82 = mul nsw i32 %81, 60
%83 = sext i32 %82 to i64
%84 = add nsw i64 %74, %83
%85 = call %struct.TYPE_3__* @localtime(i32* %2)
%86 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %85, i32 0, i32 3
%87 = load i64, i64* %86
%88 = add nsw i64 %84, %87
%89 = call %struct.TYPE_4__* @gmtime(i32* %2)
%90 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %89, i32 0, i32 3
%91 = load i64, i64* %90
%92 = sub nsw i64 %88, %91
store i64 %92, i64* %1
br label %149
93: ; preds = %47
%94 = call %struct.TYPE_3__* @localtime(i32* %2)
%95 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %94, i32 0, i32 0
%96 = load i64, i64* %95
%97 = call %struct.TYPE_4__* @gmtime(i32* %2)
%98 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %97, i32 0, i32 0
%99 = load i64, i64* %98
%100 = sub nsw i64 %96, %99
%101 = icmp eq i64 %100, 6
br i1 %101, label %111, label %102
102: ; preds = %93
%103 = call %struct.TYPE_3__* @localtime(i32* %2)
%104 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %103, i32 0, i32 0
%105 = load i64, i64* %104
%106 = call %struct.TYPE_4__* @gmtime(i32* %2)
%107 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %106, i32 0, i32 0
%108 = load i64, i64* %107
%109 = sub nsw i64 %105, %108
%110 = icmp eq i64 %109, -6
br i1 %110, label %111, label %148
111: ; preds = %102, %93
%112 = call %struct.TYPE_3__* @localtime(i32* %2)
%113 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %112, i32 0, i32 0
%114 = load i64, i64* %113
%115 = call %struct.TYPE_4__* @gmtime(i32* %2)
%116 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %115, i32 0, i32 0
%117 = load i64, i64* %116
%118 = sub nsw i64 %114, %117
%119 = mul nsw i64 %118, -14400
%120 = call %struct.TYPE_3__* @localtime(i32* %2)
%121 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %120, i32 0, i32 1
%122 = load i32, i32* %121
%123 = call %struct.TYPE_4__* @gmtime(i32* %2)
%124 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %123, i32 0, i32 1
%125 = load i32, i32* %124
%126 = sub nsw i32 %122, %125
%127 = mul nsw i32 %126, 3600
%128 = sext i32 %127 to i64
%129 = add nsw i64 %119, %128
%130 = call %struct.TYPE_3__* @localtime(i32* %2)
%131 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %130, i32 0, i32 2
%132 = load i32, i32* %131
%133 = call %struct.TYPE_4__* @gmtime(i32* %2)
%134 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %133, i32 0, i32 2
%135 = load i32, i32* %134
%136 = sub nsw i32 %132, %135
%137 = mul nsw i32 %136, 60
%138 = sext i32 %137 to i64
%139 = add nsw i64 %129, %138
%140 = call %struct.TYPE_3__* @localtime(i32* %2)
%141 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %140, i32 0, i32 3
%142 = load i64, i64* %141
%143 = add nsw i64 %139, %142
%144 = call %struct.TYPE_4__* @gmtime(i32* %2)
%145 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %144, i32 0, i32 3
%146 = load i64, i64* %145
%147 = sub nsw i64 %143, %146
store i64 %147, i64* %1
br label %149
148: ; preds = %102
store i64 0, i64* %1
br label %149
149: ; preds = %148, %111, %56, %11
%150 = load i64, i64* %1
ret i64 %150
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i32, i32, i64 }
%struct.TYPE_4__ = type { i64, i32, i32, i64 }
define i64 @get_tz_offset() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.TYPE_3__* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 0
%6 = load i64, i64* %5
%7 = call %struct.TYPE_4__* @gmtime(i32* %1)
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i64 0, i32 0
%9 = load i64, i64* %8
%10 = icmp eq i64 %6, %9
%11 = call %struct.TYPE_3__* @localtime(i32* %1)
br i1 %10, label %12, label %38
12: ; preds = %0
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i64 0, i32 1
%14 = load i32, i32* %13
%15 = call %struct.TYPE_4__* @gmtime(i32* %1)
%16 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %15, i64 0, i32 1
%17 = load i32, i32* %16
%18 = sub nsw i32 %14, %17
%19 = mul nsw i32 %18, 3600
%20 = call %struct.TYPE_3__* @localtime(i32* %1)
%21 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %20, i64 0, i32 2
%22 = load i32, i32* %21
%23 = call %struct.TYPE_4__* @gmtime(i32* %1)
%24 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %23, i64 0, i32 2
%25 = load i32, i32* %24
%26 = sub nsw i32 %22, %25
%27 = mul nsw i32 %26, 60
%28 = add nsw i32 %27, %19
%29 = sext i32 %28 to i64
%30 = call %struct.TYPE_3__* @localtime(i32* %1)
%31 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %30, i64 0, i32 3
%32 = load i64, i64* %31
%33 = add nsw i64 %32, %29
%34 = call %struct.TYPE_4__* @gmtime(i32* %1)
%35 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %34, i64 0, i32 3
%36 = load i64, i64* %35
%37 = sub i64 %33, %36
br label %147
38: ; preds = %0
%39 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i64 0, i32 0
%40 = load i64, i64* %39
%41 = call %struct.TYPE_4__* @gmtime(i32* %1)
%42 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %41, i64 0, i32 0
%43 = load i64, i64* %42
%44 = sub nsw i64 %40, %43
%45 = icmp eq i64 %44, -1
br i1 %45, label %55, label %46
46: ; preds = %38
%47 = call %struct.TYPE_3__* @localtime(i32* %1)
%48 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %47, i64 0, i32 0
%49 = load i64, i64* %48
%50 = call %struct.TYPE_4__* @gmtime(i32* %1)
%51 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %50, i64 0, i32 0
%52 = load i64, i64* %51
%53 = sub nsw i64 %49, %52
%54 = icmp eq i64 %53, 1
br i1 %54, label %55, label %92
55: ; preds = %46, %38
%56 = call %struct.TYPE_3__* @localtime(i32* %1)
%57 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %56, i64 0, i32 0
%58 = load i64, i64* %57
%59 = call %struct.TYPE_4__* @gmtime(i32* %1)
%60 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %59, i64 0, i32 0
%61 = load i64, i64* %60
%62 = sub nsw i64 %58, %61
%63 = mul nsw i64 %62, 86400
%64 = call %struct.TYPE_3__* @localtime(i32* %1)
%65 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %64, i64 0, i32 1
%66 = load i32, i32* %65
%67 = call %struct.TYPE_4__* @gmtime(i32* %1)
%68 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %67, i64 0, i32 1
%69 = load i32, i32* %68
%70 = sub nsw i32 %66, %69
%71 = mul nsw i32 %70, 3600
%72 = sext i32 %71 to i64
%73 = add nsw i64 %63, %72
%74 = call %struct.TYPE_3__* @localtime(i32* %1)
%75 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %74, i64 0, i32 2
%76 = load i32, i32* %75
%77 = call %struct.TYPE_4__* @gmtime(i32* %1)
%78 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %77, i64 0, i32 2
%79 = load i32, i32* %78
%80 = sub nsw i32 %76, %79
%81 = mul nsw i32 %80, 60
%82 = sext i32 %81 to i64
%83 = call %struct.TYPE_3__* @localtime(i32* %1)
%84 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %83, i64 0, i32 3
%85 = load i64, i64* %84
%86 = call %struct.TYPE_4__* @gmtime(i32* %1)
%87 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %86, i64 0, i32 3
%88 = load i64, i64* %87
%89 = add i64 %73, %85
%90 = add i64 %89, %82
%91 = sub i64 %90, %88
br label %147
92: ; preds = %46
%93 = call %struct.TYPE_3__* @localtime(i32* %1)
%94 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %93, i64 0, i32 0
%95 = load i64, i64* %94
%96 = call %struct.TYPE_4__* @gmtime(i32* %1)
%97 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %96, i64 0, i32 0
%98 = load i64, i64* %97
%99 = sub nsw i64 %95, %98
%100 = icmp eq i64 %99, 6
br i1 %100, label %110, label %101
101: ; preds = %92
%102 = call %struct.TYPE_3__* @localtime(i32* %1)
%103 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %102, i64 0, i32 0
%104 = load i64, i64* %103
%105 = call %struct.TYPE_4__* @gmtime(i32* %1)
%106 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %105, i64 0, i32 0
%107 = load i64, i64* %106
%108 = sub nsw i64 %104, %107
%109 = icmp eq i64 %108, -6
br i1 %109, label %110, label %147
110: ; preds = %101, %92
%111 = call %struct.TYPE_3__* @localtime(i32* %1)
%112 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %111, i64 0, i32 0
%113 = load i64, i64* %112
%114 = call %struct.TYPE_4__* @gmtime(i32* %1)
%115 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %114, i64 0, i32 0
%116 = load i64, i64* %115
%117 = sub nsw i64 %113, %116
%118 = mul nsw i64 %117, -14400
%119 = call %struct.TYPE_3__* @localtime(i32* %1)
%120 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %119, i64 0, i32 1
%121 = load i32, i32* %120
%122 = call %struct.TYPE_4__* @gmtime(i32* %1)
%123 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %122, i64 0, i32 1
%124 = load i32, i32* %123
%125 = sub nsw i32 %121, %124
%126 = mul nsw i32 %125, 3600
%127 = sext i32 %126 to i64
%128 = add nsw i64 %118, %127
%129 = call %struct.TYPE_3__* @localtime(i32* %1)
%130 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %129, i64 0, i32 2
%131 = load i32, i32* %130
%132 = call %struct.TYPE_4__* @gmtime(i32* %1)
%133 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %132, i64 0, i32 2
%134 = load i32, i32* %133
%135 = sub nsw i32 %131, %134
%136 = mul nsw i32 %135, 60
%137 = sext i32 %136 to i64
%138 = call %struct.TYPE_3__* @localtime(i32* %1)
%139 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %138, i64 0, i32 3
%140 = load i64, i64* %139
%141 = call %struct.TYPE_4__* @gmtime(i32* %1)
%142 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %141, i64 0, i32 3
%143 = load i64, i64* %142
%144 = add i64 %128, %140
%145 = add i64 %144, %137
%146 = sub i64 %145, %143
br label %147
147: ; preds = %101, %110, %55, %12
%148 = phi i64 [ %37, %12 ], [ %91, %55 ], [ %146, %110 ], [ 0, %101 ]
ret i64 %148
}