// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathmsc.cpp
// Function: set_time_zone(char*)
void set_time_zone(char *s)
{
char c;

   time_zone_set = 0;

   use_loran = use_gps = use_utc = 0;
   use_gmst = use_lmst = 0;
   use_tai = use_tt = use_ut1 = use_tcg = use_tdb = use_tcb = use_hjd = use_bessel = 0;
   use_msd = use_ven = use_merc = use_pluto = 0;

   tz_string[0] = dst_string[0] = 0;
   if(s == 0) return;

   if((s[0] == 0) || (s[0] == 0x0A) || (s[0] == 0x0D)) {  // clear time zone
      return;
   }

   if(s[0] == ':') return;  // Linux :... time zone string

   // set time zone
   strcpy(std_string, "LOCAL");
   dst_string[0] = 0;
   strcpy(tz_string, dst_string);

   time_zone_set = 1;
   tz_sign = 1;
   time_zone_hours = 0;
   time_zone_minutes = 0;
   time_zone_seconds = 0;
   tz_adjust = 0.0;

   while(*s) {  // find first char of time zone string
      c = *s;
      if(c == 0)    { break; }
      if(c == '>')  { break; }
      if(c == '<')  { ++s; continue; }
      if(c == ' ')  { ++s; continue; }
      if(c == '\t') { ++s; continue; }
      if(c == '=')  { ++s; continue; }

      if((c == '+') || (c == '-') || isdigit(c)) {  // tz string is -6CST/CDT format
         s = get_tz_value(s);
         if(s) s = get_std_zone(s, 0);
         if(s) {
            if(*s == '/') get_dst_zone(s+1);
         }
      }
      else {   // string is in CST6CDT format
         s = get_std_zone(s, 1);
         if(s) {
            tz_sign = (-1);
            s = get_tz_value(s);
         }
         if(s) get_dst_zone(s);
      }
      break;
   }

   if     (!strcmp(std_string, "SST"))   solar_time = 1;
   else if(!strcmp(dst_string, "SDT"))   solar_time = 1;
   else if(!strcmp(std_string, "SOL"))   solar_time = 1;
   else if(!strcmp(dst_string, "SOL"))   solar_time = 1;
   else if(!strcmp(std_string, "SOLAR")) solar_time = 1;
   else if(!strcmp(dst_string, "SOLAR")) solar_time = 1;
   else                                  solar_time = 0;

   if(user_set_watch_name == 0) {
      if(solar_time) {
         set_watch_name("Solar");
         label_watch_face = 1;
      }
      else {
         watch_name[0] = 0;
         label_watch_face = 1;
      }
   }

   if     (!strcmp(std_string, "LMST"))  use_lmst = 1;   // sidereal times
   else if(!strcmp(std_string, "LAST"))  use_lmst = 2;
   else if(!strcmp(std_string, "GMST"))  use_gmst = 1;
   else if(!strcmp(std_string, "GAST"))  use_gmst = 2;

   else if(!strcmp(std_string, "TAI"))   use_tai = 1;    // astronomical times
   else if(!strcmp(std_string, "TCG"))   use_tcg = 1;
   else if(!strcmp(std_string, "TCB"))   use_tcb = 1;
   else if(!strcmp(std_string, "TDB"))   use_tdb = 1;
   else if(!strcmp(std_string, "TDT"))   use_tt = 1;
   else if(!strcmp(std_string, "TT"))    use_tt = 1;
   else if(!strcmp(std_string, "UT"))    use_ut1 = 1;
   else if(!strcmp(std_string, "UT1"))   use_ut1 = 1;
   else if(!strcmp(std_string, "HJD"))   use_hjd = 1;
   else if(!strcmp(std_string, "BES"))   use_bessel= 1;

   else if(!strcmp(std_string, "UTC"))   use_utc = 1;    // various nav system times
   else if(!strcmp(std_string, "GPS"))   use_gps = 1;
   else if(!strcmp(std_string, "GPST"))  use_gps = 1;
   else if(!strcmp(std_string, "LOR"))   use_loran = 1;
   else if(!strcmp(std_string, "LORAN")) use_loran = 1;

   else if(!strcmp(std_string, "MAR"))   use_msd = 1;    // various names of Mars time
   else if(!strcmp(std_string, "MARS"))  use_msd = 1;  
   else if(!strcmp(std_string, "MARSD")) use_msd = 1;  
   else if(!strcmp(std_string, "MSD"))   use_msd = 1;  
   else if(!strcmp(std_string, "MTC"))   use_msd = 1;  
   else if(!strcmp(std_string, "AMT"))   use_msd = 1;  

   else if(!strcmp(std_string, "MER"))   use_merc = 1;   // planetary times
   else if(!strcmp(std_string, "PLU"))   use_pluto = 1;
   else if(!strcmp(std_string, "VEN"))   use_ven = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x229e49(%rip), %r12    # 0x30d894
xorl %eax, %eax
movb %al, (%r12)
leaq 0x229eb3(%rip), %rcx    # 0x30d90b
movb %al, (%rcx)
leaq 0x229ea9(%rip), %rcx    # 0x30d90a
movb %al, (%rcx)
leaq 0x229e9f(%rip), %rcx    # 0x30d909
movb %al, (%rcx)
leaq 0x229e8e(%rip), %r13    # 0x30d901
movb %al, (%r13)
leaq 0x229e82(%rip), %rcx    # 0x30d900
movb %al, (%rcx)
leaq 0x229e89(%rip), %rcx    # 0x30d910
movb %al, (%rcx)
leaq 0x229e78(%rip), %rcx    # 0x30d908
movb %al, (%rcx)
leaq 0x229e6e(%rip), %rcx    # 0x30d907
movb %al, (%rcx)
leaq 0x229e64(%rip), %rcx    # 0x30d906
movb %al, (%rcx)
leaq 0x229e85(%rip), %rcx    # 0x30d930
movb %al, (%rcx)
leaq 0x229e51(%rip), %rcx    # 0x30d905
movb %al, (%rcx)
leaq 0x229e45(%rip), %rcx    # 0x30d902
movb %al, (%rcx)
leaq 0x229e3e(%rip), %rcx    # 0x30d904
movb %al, (%rcx)
leaq 0x229e34(%rip), %r15    # 0x30d903
movb %al, (%r15)
leaq 0x229e36(%rip), %rcx    # 0x30d90f
movb %al, (%rcx)
leaq 0x229e2b(%rip), %rcx    # 0x30d90d
movb %al, (%rcx)
leaq 0x229e23(%rip), %rcx    # 0x30d90e
movb %al, (%rcx)
leaq 0x229e18(%rip), %rcx    # 0x30d90c
movb %al, (%rcx)
leaq 0x229e2b(%rip), %rbx    # 0x30d928
movb %al, (%rbx)
testq %rdi, %rdi
je 0xe3b20
movq %rdi, %r14
movzbl (%rdi), %eax
cmpq $0x3a, %rax
ja 0xe3b2f
movabsq $0x400000000002401, %rcx # imm = 0x400000000002401
btq %rax, %rcx
jae 0xe3b2f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x229dea(%rip), %rax    # 0x30d920
movw $0x4c, 0x4(%rax)
movl $0x41434f4c, (%rax)     # imm = 0x41434F4C
movb $0x0, (%rbx)
leaq 0x229de4(%rip), %rdi    # 0x30d930
movq %rbx, %rsi
callq 0x9340
leaq 0x229dad(%rip), %rsi    # 0x30d908
movb $0x1, (%r12)
leaq 0x229d31(%rip), %r12    # 0x30d898
movl $0x1, (%r12)
leaq 0x229d12(%rip), %rax    # 0x30d888
xorl %ecx, %ecx
movl %ecx, (%rax)
leaq 0x229d0b(%rip), %rax    # 0x30d88c
movl %ecx, (%rax)
leaq 0x229d06(%rip), %rax    # 0x30d890
movl %ecx, (%rax)
leaq 0x229ced(%rip), %rax    # 0x30d880
movq $0x0, (%rax)
movabsq $0x3000000100000200, %rcx # imm = 0x3000000100000200
movzbl (%r14), %eax
cmpq $0x3e, %rax
ja 0xe3bdd
btq %rax, %rcx
jae 0xe3bb9
incq %r14
jmp 0xe3ba4
movabsq $0x280000000000, %rcx   # imm = 0x280000000000
btq %rax, %rcx
jb 0xe3be8
movabsq $0x4000000000000001, %rcx # imm = 0x4000000000000001
btq %rax, %rcx
jb 0xe3c60
movsbl %al, %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0xe3c1c
movq %r14, %rdi
callq 0xe364f
leaq 0x229d11(%rip), %rsi    # 0x30d908
testq %rax, %rax
je 0xe3c60
movq %rax, %rdi
xorl %esi, %esi
callq 0xe37eb
leaq 0x229cfb(%rip), %rsi    # 0x30d908
testq %rax, %rax
je 0xe3c60
cmpb $0x2f, (%rax)
jne 0xe3c60
incq %rax
jmp 0xe3c51
movq %r14, %rdi
movl $0x1, %esi
callq 0xe37eb
leaq 0x229cd8(%rip), %rsi    # 0x30d908
testq %rax, %rax
je 0xe3c60
movl $0xffffffff, (%r12)     # imm = 0xFFFFFFFF
movq %rax, %rdi
callq 0xe364f
leaq 0x229cbc(%rip), %rsi    # 0x30d908
testq %rax, %rax
je 0xe3c60
movq %rax, %rdi
callq 0xe38fb
leaq 0x229ca8(%rip), %rsi    # 0x30d908
leaq 0x229cb9(%rip), %r14    # 0x30d920
cmpl $0x545353, (%r14)       # imm = 0x545353
je 0xe3cce
cmpl $0x544453, (%rbx)       # imm = 0x544453
je 0xe3cce
cmpl $0x4c4f53, (%r14)       # imm = 0x4C4F53
je 0xe3cce
cmpl $0x4c4f53, (%rbx)       # imm = 0x4C4F53
je 0xe3cce
movl $0x414c4f53, %eax       # imm = 0x414C4F53
movl (%r14), %ecx
xorl %eax, %ecx
movzwl 0x4(%r14), %edx
xorl $0x52, %edx
orl %ecx, %edx
je 0xe3cce
xorl (%rbx), %eax
movzwl 0x4(%rbx), %ecx
xorl $0x52, %ecx
orl %eax, %ecx
je 0xe3cce
leaq 0x229c5e(%rip), %rax    # 0x30d911
movb $0x0, (%rax)
leaq 0x25aa73(%rip), %rax    # 0x33e730
cmpb $0x0, (%rax)
jne 0xe3d01
leaq 0x25aa27(%rip), %rax    # 0x33e6f0
movb $0x0, (%rax)
jmp 0xe3cf7
leaq 0x229c3c(%rip), %rax    # 0x30d911
movb $0x1, (%rax)
leaq 0x25aa51(%rip), %rax    # 0x33e730
cmpb $0x0, (%rax)
jne 0xe3d01
leaq 0x3a3d7(%rip), %rdi     # 0x11e0c2
callq 0x47540
leaq 0x229c11(%rip), %rsi    # 0x30d908
leaq 0x25aa31(%rip), %rax    # 0x33e72f
movb $0x1, (%rax)
movl $0x54534d4c, %eax       # imm = 0x54534D4C
xorl (%r14), %eax
movzbl 0x4(%r14), %ecx
orl %eax, %ecx
je 0xe3f0c
movl $0x5453414c, %eax       # imm = 0x5453414C
xorl (%r14), %eax
movzbl 0x4(%r14), %ecx
orl %eax, %ecx
je 0xe3f16
movl $0x54534d47, %eax       # imm = 0x54534D47
xorl (%r14), %eax
movzbl 0x4(%r14), %ecx
orl %eax, %ecx
je 0xe3f20
movl $0x54534147, %eax       # imm = 0x54534147
xorl (%r14), %eax
movzbl 0x4(%r14), %ecx
orl %eax, %ecx
je 0xe3f2f
cmpl $0x494154, (%r14)       # imm = 0x494154
je 0xe3f3e
cmpl $0x474354, (%r14)       # imm = 0x474354
je 0xe3f47
cmpl $0x424354, (%r14)       # imm = 0x424354
je 0xe3f50
cmpl $0x424454, (%r14)       # imm = 0x424454
je 0xe3f62
cmpl $0x544454, (%r14)       # imm = 0x544454
je 0xe3f59
movzwl (%r14), %eax
xorl $0x5454, %eax           # imm = 0x5454
movzbl 0x2(%r14), %ecx
orw %ax, %cx
je 0xe3f59
movzwl (%r14), %eax
xorl $0x5455, %eax           # imm = 0x5455
movzbl 0x2(%r14), %ecx
orw %ax, %cx
je 0xe3f6b
cmpl $0x315455, (%r14)       # imm = 0x315455
je 0xe3f6b
cmpl $0x444a48, (%r14)       # imm = 0x444A48
je 0xe3f74
cmpl $0x534542, (%r14)       # imm = 0x534542
je 0xe3f7c
cmpl $0x435455, (%r14)       # imm = 0x435455
je 0xe3f8e
cmpl $0x535047, (%r14)       # imm = 0x535047
je 0xe3f85
movl $0x54535047, %eax       # imm = 0x54535047
xorl (%r14), %eax
movzbl 0x4(%r14), %ecx
orl %eax, %ecx
je 0xe3f85
leaq 0x229aff(%rip), %rax    # 0x30d920
cmpl $0x524f4c, (%rax)       # imm = 0x524F4C
je 0xe3f97
movl $0x41524f4c, %eax       # imm = 0x41524F4C
leaq 0x229ae7(%rip), %rcx    # 0x30d920
xorl (%rcx), %eax
movzwl 0x4(%rcx), %ecx
xorl $0x4e, %ecx
orl %eax, %ecx
je 0xe3f97
leaq 0x229acf(%rip), %rax    # 0x30d920
cmpl $0x52414d, (%rax)       # imm = 0x52414D
je 0xe3fa0
movl $0x5352414d, %eax       # imm = 0x5352414D
leaq 0x229ab7(%rip), %rdx    # 0x30d920
movl (%rdx), %ecx
xorl %eax, %ecx
movzbl 0x4(%rdx), %edx
orl %ecx, %edx
je 0xe3fa0
leaq 0x229aa0(%rip), %rcx    # 0x30d920
xorl (%rcx), %eax
movzwl 0x4(%rcx), %ecx
xorl $0x44, %ecx
orl %eax, %ecx
je 0xe3fa0
leaq 0x229a88(%rip), %rax    # 0x30d920
cmpl $0x44534d, (%rax)       # imm = 0x44534D
je 0xe3fa0
leaq 0x229a75(%rip), %rax    # 0x30d920
cmpl $0x43544d, (%rax)       # imm = 0x43544D
je 0xe3fa0
leaq 0x229a62(%rip), %rax    # 0x30d920
cmpl $0x544d41, (%rax)       # imm = 0x544D41
je 0xe3fa0
leaq 0x229a4f(%rip), %rax    # 0x30d920
cmpl $0x52454d, (%rax)       # imm = 0x52454D
je 0xe3fac
leaq 0x229a3c(%rip), %rax    # 0x30d920
cmpl $0x554c50, (%rax)       # imm = 0x554C50
je 0xe3fb8
leaq 0x229a29(%rip), %rax    # 0x30d920
cmpl $0x4e4556, (%rax)       # imm = 0x4E4556
leaq 0x229a0a(%rip), %rax    # 0x30d90e
jne 0xe3b20
jmp 0xe3f27
movb $0x1, (%r13)
jmp 0xe3b20
movb $0x2, (%r13)
jmp 0xe3b20
leaq 0x2299d9(%rip), %rax    # 0x30d900
movb $0x1, (%rax)
jmp 0xe3b20
leaq 0x2299ca(%rip), %rax    # 0x30d900
movb $0x2, (%rax)
jmp 0xe3b20
movb $0x1, (%r15)
jmp 0xe3b20
leaq 0x2299b7(%rip), %rax    # 0x30d905
jmp 0xe3f27
leaq 0x2299b0(%rip), %rax    # 0x30d907
jmp 0xe3f27
leaq 0x2299a4(%rip), %rax    # 0x30d904
jmp 0xe3f27
leaq 0x22999d(%rip), %rax    # 0x30d906
jmp 0xe3f27
leaq 0x229990(%rip), %rax    # 0x30d902
jmp 0xe3f27
movb $0x1, (%rsi)
jmp 0xe3b20
leaq 0x22998d(%rip), %rax    # 0x30d910
jmp 0xe3f27
leaq 0x22997e(%rip), %rax    # 0x30d90a
jmp 0xe3f27
leaq 0x229976(%rip), %rax    # 0x30d90b
jmp 0xe3f27
leaq 0x22996b(%rip), %rax    # 0x30d909
jmp 0xe3f27
leaq 0x229965(%rip), %rax    # 0x30d90c
jmp 0xe3f27
leaq 0x22995a(%rip), %rax    # 0x30d90d
jmp 0xe3f27
leaq 0x229950(%rip), %rax    # 0x30d90f
jmp 0xe3f27