// File: /workspace/github_cpp_makefile_star2_O1/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 0x22aa30(%rip), %r12    # 0x30d894
xorl %eax, %eax
movb %al, (%r12)
leaq 0x22aa9a(%rip), %rcx    # 0x30d90b
movb %al, (%rcx)
leaq 0x22aa90(%rip), %rcx    # 0x30d90a
movb %al, (%rcx)
leaq 0x22aa86(%rip), %rcx    # 0x30d909
movb %al, (%rcx)
leaq 0x22aa75(%rip), %r13    # 0x30d901
movb %al, (%r13)
leaq 0x22aa69(%rip), %rcx    # 0x30d900
movb %al, (%rcx)
leaq 0x22aa70(%rip), %rcx    # 0x30d910
movb %al, (%rcx)
leaq 0x22aa5f(%rip), %rcx    # 0x30d908
movb %al, (%rcx)
leaq 0x22aa55(%rip), %rcx    # 0x30d907
movb %al, (%rcx)
leaq 0x22aa4b(%rip), %rcx    # 0x30d906
movb %al, (%rcx)
leaq 0x22aa6c(%rip), %rcx    # 0x30d930
movb %al, (%rcx)
leaq 0x22aa38(%rip), %rcx    # 0x30d905
movb %al, (%rcx)
leaq 0x22aa2c(%rip), %rcx    # 0x30d902
movb %al, (%rcx)
leaq 0x22aa25(%rip), %rcx    # 0x30d904
movb %al, (%rcx)
leaq 0x22aa1b(%rip), %r15    # 0x30d903
movb %al, (%r15)
leaq 0x22aa1d(%rip), %rcx    # 0x30d90f
movb %al, (%rcx)
leaq 0x22aa12(%rip), %rcx    # 0x30d90d
movb %al, (%rcx)
leaq 0x22aa0a(%rip), %rcx    # 0x30d90e
movb %al, (%rcx)
leaq 0x22a9ff(%rip), %rcx    # 0x30d90c
movb %al, (%rcx)
leaq 0x22aa12(%rip), %rbx    # 0x30d928
movb %al, (%rbx)
testq %rdi, %rdi
je 0xe2f39
movq %rdi, %r14
movzbl (%rdi), %eax
cmpq $0x3a, %rax
ja 0xe2f48
movabsq $0x400000000002401, %rcx # imm = 0x400000000002401
btq %rax, %rcx
jae 0xe2f48
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x22a9d1(%rip), %rax    # 0x30d920
movw $0x4c, 0x4(%rax)
movl $0x41434f4c, (%rax)     # imm = 0x41434F4C
movb $0x0, (%rbx)
leaq 0x22a9cb(%rip), %rdi    # 0x30d930
movq %rbx, %rsi
callq 0x9340
leaq 0x22a994(%rip), %rdi    # 0x30d908
movb $0x1, (%r12)
leaq 0x22a918(%rip), %r12    # 0x30d898
movl $0x1, (%r12)
leaq 0x22a8f9(%rip), %rax    # 0x30d888
xorl %ecx, %ecx
movl %ecx, (%rax)
leaq 0x22a8f2(%rip), %rax    # 0x30d88c
movl %ecx, (%rax)
leaq 0x22a8ed(%rip), %rax    # 0x30d890
movl %ecx, (%rax)
leaq 0x22a8d4(%rip), %rax    # 0x30d880
movq $0x0, (%rax)
movabsq $0x3000000100000200, %rcx # imm = 0x3000000100000200
movzbl (%r14), %eax
cmpq $0x3e, %rax
ja 0xe2ff2
btq %rax, %rcx
jae 0xe2fd2
incq %r14
jmp 0xe2fbd
movabsq $0x280000000000, %rcx   # imm = 0x280000000000
btq %rax, %rcx
jb 0xe2ffd
movabsq $0x4000000000000001, %rcx # imm = 0x4000000000000001
btq %rax, %rcx
jb 0xe306f
movsbl %al, %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0xe302e
movq %r14, %rdi
callq 0xe2af1
testq %rax, %rax
je 0xe3016
movq %rax, %rdi
xorl %esi, %esi
callq 0xe2c89
jmp 0xe3018
xorl %eax, %eax
leaq 0x22a8e9(%rip), %rdi    # 0x30d908
testq %rax, %rax
je 0xe306f
cmpb $0x2f, (%rax)
jne 0xe306f
incq %rax
jmp 0xe3060
movq %r14, %rdi
movl $0x1, %esi
callq 0xe2c89
testq %rax, %rax
je 0xe3052
movl $0xffffffff, (%r12)     # imm = 0xFFFFFFFF
movq %rax, %rdi
callq 0xe2af1
jmp 0xe3054
xorl %eax, %eax
leaq 0x22a8ad(%rip), %rdi    # 0x30d908
testq %rax, %rax
je 0xe306f
movq %rax, %rdi
callq 0xe2d52
leaq 0x22a899(%rip), %rdi    # 0x30d908
movb $0x1, %al
leaq 0x22a8a8(%rip), %r14    # 0x30d920
cmpl $0x545353, (%r14)       # imm = 0x545353
je 0xe30be
cmpl $0x544453, (%rbx)       # imm = 0x544453
je 0xe30be
cmpl $0x4c4f53, (%r14)       # imm = 0x4C4F53
je 0xe30be
cmpl $0x4c4f53, (%rbx)       # imm = 0x4C4F53
je 0xe30be
movl $0x414c4f53, %ecx       # imm = 0x414C4F53
movl (%r14), %edx
xorl %ecx, %edx
movzwl 0x4(%r14), %esi
xorl $0x52, %esi
orl %edx, %esi
je 0xe30be
xorl (%rbx), %ecx
movzwl 0x4(%rbx), %eax
xorl $0x52, %eax
orl %ecx, %eax
sete %al
leaq 0x22a84c(%rip), %rcx    # 0x30d911
movb %al, (%rcx)
leaq 0x25b662(%rip), %rax    # 0x33e730
cmpb $0x0, (%rax)
jne 0xe3101
cmpb $0x0, (%rcx)
je 0xe30ed
leaq 0x3af58(%rip), %rdi     # 0x11e037
callq 0x47471
leaq 0x22a81d(%rip), %rdi    # 0x30d908
jmp 0xe30f7
leaq 0x25b5fc(%rip), %rax    # 0x33e6f0
movb $0x0, (%rax)
leaq 0x25b631(%rip), %rax    # 0x33e72f
movb $0x1, (%rax)
movl $0x54534d4c, %eax       # imm = 0x54534D4C
xorl (%r14), %eax
movzbl 0x4(%r14), %ecx
orl %eax, %ecx
je 0xe330c
movl $0x5453414c, %eax       # imm = 0x5453414C
xorl (%r14), %eax
movzbl 0x4(%r14), %ecx
orl %eax, %ecx
je 0xe3316
movl $0x54534d47, %eax       # imm = 0x54534D47
xorl (%r14), %eax
movzbl 0x4(%r14), %ecx
orl %eax, %ecx
je 0xe3320
movl $0x54534147, %eax       # imm = 0x54534147
xorl (%r14), %eax
movzbl 0x4(%r14), %ecx
orl %eax, %ecx
je 0xe332f
cmpl $0x494154, (%r14)       # imm = 0x494154
je 0xe333e
cmpl $0x474354, (%r14)       # imm = 0x474354
je 0xe3347
cmpl $0x424354, (%r14)       # imm = 0x424354
je 0xe3350
cmpl $0x424454, (%r14)       # imm = 0x424454
je 0xe3362
cmpl $0x544454, (%r14)       # imm = 0x544454
je 0xe3359
movzwl (%r14), %eax
xorl $0x5454, %eax           # imm = 0x5454
movzbl 0x2(%r14), %ecx
orw %ax, %cx
je 0xe3359
movzwl (%r14), %eax
xorl $0x5455, %eax           # imm = 0x5455
movzbl 0x2(%r14), %ecx
orw %ax, %cx
je 0xe336b
cmpl $0x315455, (%r14)       # imm = 0x315455
je 0xe336b
cmpl $0x444a48, (%r14)       # imm = 0x444A48
je 0xe3374
cmpl $0x534542, (%r14)       # imm = 0x534542
je 0xe337c
cmpl $0x435455, (%r14)       # imm = 0x435455
je 0xe338e
cmpl $0x535047, (%r14)       # imm = 0x535047
je 0xe3385
movl $0x54535047, %eax       # imm = 0x54535047
xorl (%r14), %eax
movzbl 0x4(%r14), %ecx
orl %eax, %ecx
je 0xe3385
leaq 0x22a6ff(%rip), %rax    # 0x30d920
cmpl $0x524f4c, (%rax)       # imm = 0x524F4C
je 0xe3397
movl $0x41524f4c, %eax       # imm = 0x41524F4C
leaq 0x22a6e7(%rip), %rcx    # 0x30d920
xorl (%rcx), %eax
movzwl 0x4(%rcx), %ecx
xorl $0x4e, %ecx
orl %eax, %ecx
je 0xe3397
leaq 0x22a6cf(%rip), %rax    # 0x30d920
cmpl $0x52414d, (%rax)       # imm = 0x52414D
je 0xe33a0
movl $0x5352414d, %eax       # imm = 0x5352414D
leaq 0x22a6b7(%rip), %rdx    # 0x30d920
movl (%rdx), %ecx
xorl %eax, %ecx
movzbl 0x4(%rdx), %edx
orl %ecx, %edx
je 0xe33a0
leaq 0x22a6a0(%rip), %rcx    # 0x30d920
xorl (%rcx), %eax
movzwl 0x4(%rcx), %ecx
xorl $0x44, %ecx
orl %eax, %ecx
je 0xe33a0
leaq 0x22a688(%rip), %rax    # 0x30d920
cmpl $0x44534d, (%rax)       # imm = 0x44534D
je 0xe33a0
leaq 0x22a675(%rip), %rax    # 0x30d920
cmpl $0x43544d, (%rax)       # imm = 0x43544D
je 0xe33a0
leaq 0x22a662(%rip), %rax    # 0x30d920
cmpl $0x544d41, (%rax)       # imm = 0x544D41
je 0xe33a0
leaq 0x22a64f(%rip), %rax    # 0x30d920
cmpl $0x52454d, (%rax)       # imm = 0x52454D
je 0xe33ac
leaq 0x22a63c(%rip), %rax    # 0x30d920
cmpl $0x554c50, (%rax)       # imm = 0x554C50
je 0xe33b8
leaq 0x22a629(%rip), %rax    # 0x30d920
cmpl $0x4e4556, (%rax)       # imm = 0x4E4556
leaq 0x22a60a(%rip), %rax    # 0x30d90e
jne 0xe2f39
jmp 0xe3327
movb $0x1, (%r13)
jmp 0xe2f39
movb $0x2, (%r13)
jmp 0xe2f39
leaq 0x22a5d9(%rip), %rax    # 0x30d900
movb $0x1, (%rax)
jmp 0xe2f39
leaq 0x22a5ca(%rip), %rax    # 0x30d900
movb $0x2, (%rax)
jmp 0xe2f39
movb $0x1, (%r15)
jmp 0xe2f39
leaq 0x22a5b7(%rip), %rax    # 0x30d905
jmp 0xe3327
leaq 0x22a5b0(%rip), %rax    # 0x30d907
jmp 0xe3327
leaq 0x22a5a4(%rip), %rax    # 0x30d904
jmp 0xe3327
leaq 0x22a59d(%rip), %rax    # 0x30d906
jmp 0xe3327
leaq 0x22a590(%rip), %rax    # 0x30d902
jmp 0xe3327
movb $0x1, (%rdi)
jmp 0xe2f39
leaq 0x22a58d(%rip), %rax    # 0x30d910
jmp 0xe3327
leaq 0x22a57e(%rip), %rax    # 0x30d90a
jmp 0xe3327
leaq 0x22a576(%rip), %rax    # 0x30d90b
jmp 0xe3327
leaq 0x22a56b(%rip), %rax    # 0x30d909
jmp 0xe3327
leaq 0x22a565(%rip), %rax    # 0x30d90c
jmp 0xe3327
leaq 0x22a55a(%rip), %rax    # 0x30d90d
jmp 0xe3327
leaq 0x22a550(%rip), %rax    # 0x30d90f
jmp 0xe3327