// File: jkingan[P]ladyheather/heathui.cpp
// Function: edit_ticc_edge()
void edit_ticc_edge()
{
char e[4];
char c;
unsigned port;
unsigned i, j;

   if(rcvr_type == TICC_RCVR) port = RCVR_PORT;
   else if(ticc_port_open())  port = TICC_PORT;
   else {
      edit_error("No TICC device found.");
      return;
   }

   e[0] = edge_a;   // aaaacccc
   e[1] = edge_b;
   e[2] = edge_c;
   e[3] = edge_d;

   j = 0;
   strupr(edit_buffer);
   for(i=0; i<strlen(edit_buffer); i++) {  // get R/F chars
      c = edit_buffer[i];
      if(c == 'R') {
         e[j++] = c;
         if(j > 3) break;
      }
      else if(c == 'F') {
         e[j++] = c;
         if(j > 3) break;
      }
      else if(c == ' ') ;
      else if(c == '\t') ;
      else {
         sprintf(out, "%c is not a valid edge select", c);
         edit_error(out);
         return;
      }
   }

   if(e[0]) {
      sprintf(out, "EA %c", e[0]);
      set_ticc_config(port, out);
   }

   if(e[1]) {
      sprintf(out, "EB %c", e[1]);
      set_ticc_config(port, out);
   }

   get_ticc_config(port);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x22c1d1(%rip), %rax    # 0x277ab0
cmpq $0x10000, (%rax)        # imm = 0x10000
jne 0x4b8f1
movl $0xa, -0xc(%rbp)
jmp 0x4b917
callq 0x992e0
cmpl $0x0, %eax
je 0x4b904
movl $0xd, -0xc(%rbp)
jmp 0x4b915
leaq 0x12eb07(%rip), %rdi    # 0x17a412
callq 0x30d60
jmp 0x4ba9b
jmp 0x4b917
leaq 0x320636(%rip), %rax    # 0x36bf54
movl (%rax), %eax
movb %al, -0x4(%rbp)
leaq 0x32062e(%rip), %rax    # 0x36bf58
movl (%rax), %eax
movb %al, -0x3(%rbp)
leaq 0x320626(%rip), %rax    # 0x36bf5c
movl (%rax), %eax
movb %al, -0x2(%rbp)
leaq 0x32061e(%rip), %rax    # 0x36bf60
movl (%rax), %eax
movb %al, -0x1(%rbp)
movl $0x0, -0x14(%rbp)
leaq 0x352b6b(%rip), %rdi    # 0x39e4c0
callq 0x9890
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq %rax, -0x20(%rbp)
leaq 0x352b51(%rip), %rdi    # 0x39e4c0
callq 0x9120
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
jae 0x4ba37
movl -0x10(%rbp), %eax
movl %eax, %ecx
leaq 0x352b30(%rip), %rax    # 0x39e4c0
movb (%rax,%rcx), %al
movb %al, -0x5(%rbp)
movsbl -0x5(%rbp), %eax
cmpl $0x52, %eax
jne 0x4b9bd
movb -0x5(%rbp), %cl
movl -0x14(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x14(%rbp)
movl %eax, %eax
movb %cl, -0x4(%rbp,%rax)
cmpl $0x3, -0x14(%rbp)
jbe 0x4b9bb
jmp 0x4ba37
jmp 0x4ba27
movsbl -0x5(%rbp), %eax
cmpl $0x46, %eax
jne 0x4b9e4
movb -0x5(%rbp), %cl
movl -0x14(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x14(%rbp)
movl %eax, %eax
movb %cl, -0x4(%rbp,%rax)
cmpl $0x3, -0x14(%rbp)
jbe 0x4b9e2
jmp 0x4ba37
jmp 0x4ba25
movsbl -0x5(%rbp), %eax
cmpl $0x20, %eax
jne 0x4b9ef
jmp 0x4ba23
movsbl -0x5(%rbp), %eax
cmpl $0x9, %eax
jne 0x4b9fa
jmp 0x4ba21
movsbl -0x5(%rbp), %edx
leaq 0x34f9fb(%rip), %rdi    # 0x39b400
leaq 0x12eabb(%rip), %rsi    # 0x17a4c7
movb $0x0, %al
callq 0x9060
leaq 0x34f9e6(%rip), %rdi    # 0x39b400
callq 0x30d60
jmp 0x4ba9b
jmp 0x4ba23
jmp 0x4ba25
jmp 0x4ba27
jmp 0x4ba29
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x4b961
cmpb $0x0, -0x4(%rbp)
je 0x4ba65
movsbl -0x4(%rbp), %edx
leaq 0x34f9b8(%rip), %rdi    # 0x39b400
leaq 0x12ea96(%rip), %rsi    # 0x17a4e5
movb $0x0, %al
callq 0x9060
movl -0xc(%rbp), %edi
leaq 0x34f9a0(%rip), %rsi    # 0x39b400
callq 0x899f0
cmpb $0x0, -0x3(%rbp)
je 0x4ba93
movsbl -0x3(%rbp), %edx
leaq 0x34f98a(%rip), %rdi    # 0x39b400
leaq 0x12ea6e(%rip), %rsi    # 0x17a4eb
movb $0x0, %al
callq 0x9060
movl -0xc(%rbp), %edi
leaq 0x34f972(%rip), %rsi    # 0x39b400
callq 0x899f0
movl -0xc(%rbp), %edi
callq 0x89bc0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)