// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_lfs_type()
int set_lfs_type()
{
   enviro_field[UNIT_LEN] = 0;
   strcpy(enviro_dev, enviro_field);
   have_info |= (MANUF_PARAMS | PRODN_PARAMS | VERSION_INFO);

   if(strstr(enviro_field, "LFS104A")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_DP | ENV_LUX | ENV_REFALT);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS104B")) {  // LFS104BW
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_HUMID | ENV_PRESS | ENV_EMIS);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108A")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_RTEMP);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108B")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_DP);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108C")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_HUMID);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108D")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_TEMP2 | ENV_HUMID);
      enviro_type = LFS_ENVIRO;
   }
   else if(strstr(enviro_field, "LFS108E")) { 
      enviro_sensors = (ENV_SN | ENV_TEMP1 | ENV_COUNT);
      enviro_type = LFS_ENVIRO;
   }
   else return 0;

   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb $0x0, 0x2e2963(%rip)    # 0x3cb642
leaq 0x2b375a(%rip), %rdi    # 0x39c440
leaq 0x2e2943(%rip), %rsi    # 0x3cb630
callq 0x9350
leaq 0x283e5b(%rip), %rax    # 0x36cb54
movl (%rax), %ecx
orl $0x7, %ecx
leaq 0x283e4f(%rip), %rax    # 0x36cb54
movl %ecx, (%rax)
leaq 0x2e2922(%rip), %rdi    # 0x3cb630
leaq 0xa0933(%rip), %rsi     # 0x189648
callq 0x9090
cmpq $0x0, %rax
je 0xe8d3f
leaq 0x18edd9(%rip), %rax    # 0x277b00
movl $0x1b3, (%rax)          # imm = 0x1B3
leaq 0x18edc0(%rip), %rax    # 0x277af4
movl $0x3, (%rax)
jmp 0xe8e9b
leaq 0x2e28ea(%rip), %rdi    # 0x3cb630
leaq 0xa0903(%rip), %rsi     # 0x189650
callq 0x9090
cmpq $0x0, %rax
je 0xe8d77
leaq 0x18eda1(%rip), %rax    # 0x277b00
movl $0x41f, (%rax)          # imm = 0x41F
leaq 0x18ed88(%rip), %rax    # 0x277af4
movl $0x3, (%rax)
jmp 0xe8e99
leaq 0x2e28b2(%rip), %rdi    # 0x3cb630
leaq 0xa08d3(%rip), %rsi     # 0x189658
callq 0x9090
cmpq $0x0, %rax
je 0xe8daf
leaq 0x18ed69(%rip), %rax    # 0x277b00
movl $0x51, (%rax)
leaq 0x18ed50(%rip), %rax    # 0x277af4
movl $0x3, (%rax)
jmp 0xe8e97
leaq 0x2e287a(%rip), %rdi    # 0x3cb630
leaq 0xa08a3(%rip), %rsi     # 0x189660
callq 0x9090
cmpq $0x0, %rax
je 0xe8de7
leaq 0x18ed31(%rip), %rax    # 0x277b00
movl $0x33, (%rax)
leaq 0x18ed18(%rip), %rax    # 0x277af4
movl $0x3, (%rax)
jmp 0xe8e95
leaq 0x2e2842(%rip), %rdi    # 0x3cb630
leaq 0xa0873(%rip), %rsi     # 0x189668
callq 0x9090
cmpq $0x0, %rax
je 0xe8e1c
leaq 0x18ecf9(%rip), %rax    # 0x277b00
movl $0x17, (%rax)
leaq 0x18ece0(%rip), %rax    # 0x277af4
movl $0x3, (%rax)
jmp 0xe8e93
leaq 0x2e280d(%rip), %rdi    # 0x3cb630
leaq 0xa0846(%rip), %rsi     # 0x189670
callq 0x9090
cmpq $0x0, %rax
je 0xe8e51
leaq 0x18ecc4(%rip), %rax    # 0x277b00
movl $0x17, (%rax)
leaq 0x18ecab(%rip), %rax    # 0x277af4
movl $0x3, (%rax)
jmp 0xe8e91
leaq 0x2e27d8(%rip), %rdi    # 0x3cb630
leaq 0xa0819(%rip), %rsi     # 0x189678
callq 0x9090
cmpq $0x0, %rax
je 0xe8e86
leaq 0x18ec8f(%rip), %rax    # 0x277b00
movl $0x211, (%rax)          # imm = 0x211
leaq 0x18ec76(%rip), %rax    # 0x277af4
movl $0x3, (%rax)
jmp 0xe8e8f
movl $0x0, -0x4(%rbp)
jmp 0xe8ea2
jmp 0xe8e91
jmp 0xe8e93
jmp 0xe8e95
jmp 0xe8e97
jmp 0xe8e99
jmp 0xe8e9b
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)