// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_rcvr_tzone(int, int)
void set_rcvr_tzone(int hh, int mm)
{
   // send command to set the receiver's time zone offset (must be 0:0 for Heather)
   if(read_only) return;

   if(rcvr_type == BRANDY_RCVR) {
      if((hh == 0) && (mm == 0)) {
         queue_brandy_cmd("$PRCCG,O,U,+00:00", BRANDY_ZONE_MSG);
      }
      else {
         if(hh >= 0) sprintf(out,"$PRCCG,O,L,+%02d:%02d", hh, mm);
         else        sprintf(out,"$PRCCG,O,L,-%02d:%02d", 0-hh, mm);
         queue_brandy_cmd(out, BRANDY_ZONE_MSG);
      }
   }
   else if(rcvr_type == ESIP_RCVR) {
      if(hh >= 0) sprintf(out, "PERDAPI,TIMEZONE,0,%02d:%02d", hh,mm);
      else        sprintf(out, "PERDAPI,TIMEZONE,1,%02d:%02d", 0-hh,mm);
      send_esip_cmd(out);
   }
   else if(rcvr_type == SCPI_RCVR) {
      sprintf(out, ":PTIM:TZON %d,%d", hh,mm);  // GMT time zone (Heather does time zone conversions)
      queue_scpi_cmd(out, SCPI_NULL_MSG);     
   }
   else if(rcvr_type == STAR_RCVR) {
      if(star_type == OSA_TYPE) {
         if(hh >= 0) sprintf(out, "GMT_OFFSET=+%02d:%02d", hh,mm);
         else        sprintf(out, "GMT_OFFSET=-%02d:%02d", 0-hh,mm);
      }
      else {
         if(hh >= 0) sprintf(out, "UTC_OFFSET=+%02d:%02d;", hh,mm);
         else        sprintf(out, "UTC_OFFSET=-%02d:%02d;", 0-hh,mm);
      }
      queue_star_cmd(out, STAR_TZONE_MSG);
   }
   else if(rcvr_type == Z12_RCVR) {
      if(hh >= 0) sprintf(out,"PASHS,LTZ,+%02d,+%02d", hh, mm);
      else        sprintf(out,"PASHS,LTZ,+%02d,+%02d", 0-hh, 0-mm);
      send_z12_cmd(out);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
leaq 0x3002b5(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0x95f4f
jmp 0x96197
leaq 0x1e1b5a(%rip), %rax    # 0x277ab0
cmpq $0x40000, (%rax)        # imm = 0x40000
jne 0x95fd4
cmpl $0x0, -0x4(%rbp)
jne 0x95f7e
cmpl $0x0, -0x8(%rbp)
jne 0x95f7e
leaq 0xee832(%rip), %rdi     # 0x1847a4
movl $0x198, %esi            # imm = 0x198
callq 0x82fd0
jmp 0x95fcf
cmpl $0x0, -0x4(%rbp)
jl 0x95fa1
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x30546f(%rip), %rdi    # 0x39b400
leaq 0xee81e(%rip), %rsi     # 0x1847b6
movb $0x0, %al
callq 0x9060
jmp 0x95fbe
xorl %edx, %edx
subl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x305450(%rip), %rdi    # 0x39b400
leaq 0xee815(%rip), %rsi     # 0x1847cc
movb $0x0, %al
callq 0x9060
leaq 0x30543b(%rip), %rdi    # 0x39b400
movl $0x198, %esi            # imm = 0x198
callq 0x82fd0
jmp 0x96197
movl $0x80000000, %ecx       # imm = 0x80000000
leaq 0x1e1ad0(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x96036
cmpl $0x0, -0x4(%rbp)
jl 0x96008
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x305408(%rip), %rdi    # 0x39b400
leaq 0xee7e3(%rip), %rsi     # 0x1847e2
movb $0x0, %al
callq 0x9060
jmp 0x96025
xorl %edx, %edx
subl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x3053e9(%rip), %rdi    # 0x39b400
leaq 0xee7e1(%rip), %rsi     # 0x1847ff
movb $0x0, %al
callq 0x9060
leaq 0x3053d4(%rip), %rdi    # 0x39b400
callq 0x830d0
jmp 0x96195
leaq 0x1e1a73(%rip), %rax    # 0x277ab0
cmpq $0x10, (%rax)
jne 0x96074
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x3053b0(%rip), %rdi    # 0x39b400
leaq 0xee7c5(%rip), %rsi     # 0x18481c
movb $0x0, %al
callq 0x9060
leaq 0x30539b(%rip), %rdi    # 0x39b400
movl $0x1, %esi
callq 0x82fd0
jmp 0x96193
leaq 0x1e1a35(%rip), %rax    # 0x277ab0
cmpq $0x1000, (%rax)         # imm = 0x1000
jne 0x9612b
leaq 0x1e4139(%rip), %rax    # 0x27a1c8
cmpl $0x4f, (%rax)
jne 0x960d6
cmpl $0x0, -0x4(%rbp)
jl 0x960b7
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x305359(%rip), %rdi    # 0x39b400
leaq 0xee77f(%rip), %rsi     # 0x18482d
movb $0x0, %al
callq 0x9060
jmp 0x960d4
xorl %edx, %edx
subl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x30533a(%rip), %rdi    # 0x39b400
leaq 0xee776(%rip), %rsi     # 0x184843
movb $0x0, %al
callq 0x9060
jmp 0x96118
cmpl $0x0, -0x4(%rbp)
jl 0x960f9
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x305317(%rip), %rdi    # 0x39b400
leaq 0xee769(%rip), %rsi     # 0x184859
movb $0x0, %al
callq 0x9060
jmp 0x96116
xorl %edx, %edx
subl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x3052f8(%rip), %rdi    # 0x39b400
leaq 0xee761(%rip), %rsi     # 0x184870
movb $0x0, %al
callq 0x9060
jmp 0x96118
leaq 0x3052e1(%rip), %rdi    # 0x39b400
movl $0xd9, %esi
callq 0x82fd0
jmp 0x96191
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq 0x1e1974(%rip), %rax    # 0x277ab0
cmpq %rcx, (%rax)
jne 0x9618f
cmpl $0x0, -0x4(%rbp)
jl 0x96164
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
leaq 0x3052ac(%rip), %rdi    # 0x39b400
leaq 0xee72c(%rip), %rsi     # 0x184887
movb $0x0, %al
callq 0x9060
jmp 0x96183
xorl %edx, %edx
subl -0x4(%rbp), %edx
xorl %ecx, %ecx
subl -0x8(%rbp), %ecx
leaq 0x30528b(%rip), %rdi    # 0x39b400
leaq 0xee70b(%rip), %rsi     # 0x184887
movb $0x0, %al
callq 0x9060
leaq 0x305276(%rip), %rdi    # 0x39b400
callq 0x83630
jmp 0x96191
jmp 0x96193
jmp 0x96195
jmp 0x96197
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)