// File: /workspace/github_c_makefile_star2_O0/radforddc[P]icpc_siggen/signal_tester.c
// Function: get_cart
static int get_cart(char *cmd, struct point *cart, int coord_type) {
  float x, y, z;
  struct cyl_pt cyl;
  char  *cp, *cp2;

  if (sscanf(cmd, "%f %f %f", &x, &y, &z) != 3 &&
      sscanf(cmd, "%f, %f, %f", &x, &y, &z) != 3) {
    printf("error parsing coordinate: %s\n", cmd);
    return -1;
  }
  if (coord_type == CYL) {
    cyl.r = x; cyl.phi = y; cyl.z = z;
    *cart = cyl_to_cart(cyl);
  } else {
    cart->x = x; cart->y = y; cart->z = z;
  }
  
  for (cp = cmd; isspace(*cp); cp++);
  for (cp = cmd; isspace(*cp); cp++);
  for ( ; isdigit(*cp) || *cp == '.' || *cp == '-'; cp++); //skip r/x coord.
  for ( ; isspace(*cp) || *cp == ','; cp++);               //skip whitespace, commas
  for ( ; isdigit(*cp) || *cp == '.' || *cp == '-'; cp++); //skip phi/y coord.
  for ( ; isspace(*cp) || *cp == ','; cp++);               //skip whitespace, commas
  for ( ; isdigit(*cp) || *cp == '.' || *cp == '-'; cp++); //skip z coord
  for ( ; isspace(*cp) || *cp == ','; cp++);               //skip whitespace, commas
  for (cp2 = cp + strlen(cp); isspace(*cp2); cp2--)        //remove trailing whitespace
    *cp2 = '\0';

  return (int) (cp - cmd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x1b76(%rip), %rsi      # 0xd7d7
leaq -0x20(%rbp), %rdx
leaq -0x24(%rbp), %rcx
leaq -0x28(%rbp), %r8
movb $0x0, %al
callq 0x2090
cmpl $0x3, %eax
je 0xbcba
movq -0x10(%rbp), %rdi
leaq 0x2bd7(%rip), %rsi      # 0xe85b
leaq -0x20(%rbp), %rdx
leaq -0x24(%rbp), %rcx
leaq -0x28(%rbp), %r8
movb $0x0, %al
callq 0x2090
cmpl $0x3, %eax
je 0xbcba
movq -0x10(%rbp), %rsi
leaq 0x2bbf(%rip), %rdi      # 0xe866
movb $0x0, %al
callq 0x2030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xc087
cmpl $0x0, -0x1c(%rbp)
jne 0xbd2e
movss -0x20(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x30(%rbp)
movss -0x28(%rbp), %xmm0
movss %xmm0, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x80(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x34(%rbp), %rax
movq %rax, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movss -0x60(%rbp), %xmm1
callq 0x4490
movq -0x80(%rbp), %rax
movss %xmm1, -0x70(%rbp)
movlpd %xmm0, -0x78(%rbp)
movq -0x78(%rbp), %rcx
movq %rcx, -0x54(%rbp)
movl -0x70(%rbp), %ecx
movl %ecx, -0x4c(%rbp)
movq -0x54(%rbp), %rcx
movq %rcx, (%rax)
movl -0x4c(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0xbd57
movss -0x20(%rbp), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, (%rax)
movss -0x24(%rbp), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x4(%rax)
movss -0x28(%rbp), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x2140
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0xbd8f
jmp 0xbd81
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xbd5f
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x2140
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0xbdc7
jmp 0xbdb9
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xbd97
jmp 0xbdc9
callq 0x2140
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x800, %ecx            # imm = 0x800
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x81(%rbp)
jne 0xbe19
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x2e, %ecx
movb %al, -0x81(%rbp)
je 0xbe19
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
sete %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0xbe25
jmp 0xbe35
jmp 0xbe27
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xbdc9
jmp 0xbe37
callq 0x2140
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x82(%rbp)
jne 0xbe73
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
sete %al
movb %al, -0x82(%rbp)
movb -0x82(%rbp), %al
testb $0x1, %al
jne 0xbe7f
jmp 0xbe8f
jmp 0xbe81
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xbe37
jmp 0xbe91
callq 0x2140
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x800, %ecx            # imm = 0x800
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x83(%rbp)
jne 0xbee1
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x2e, %ecx
movb %al, -0x83(%rbp)
je 0xbee1
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
sete %al
movb %al, -0x83(%rbp)
movb -0x83(%rbp), %al
testb $0x1, %al
jne 0xbeed
jmp 0xbefd
jmp 0xbeef
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xbe91
jmp 0xbeff
callq 0x2140
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x84(%rbp)
jne 0xbf3b
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
sete %al
movb %al, -0x84(%rbp)
movb -0x84(%rbp), %al
testb $0x1, %al
jne 0xbf47
jmp 0xbf57
jmp 0xbf49
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xbeff
jmp 0xbf59
callq 0x2140
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x800, %ecx            # imm = 0x800
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x85(%rbp)
jne 0xbfa9
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x2e, %ecx
movb %al, -0x85(%rbp)
je 0xbfa9
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
sete %al
movb %al, -0x85(%rbp)
movb -0x85(%rbp), %al
testb $0x1, %al
jne 0xbfb5
jmp 0xbfc5
jmp 0xbfb7
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xbf59
jmp 0xbfc7
callq 0x2140
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x2000, %ecx           # imm = 0x2000
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x86(%rbp)
jne 0xc003
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
sete %al
movb %al, -0x86(%rbp)
movb -0x86(%rbp), %al
testb $0x1, %al
jne 0xc00f
jmp 0xc01f
jmp 0xc011
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xbfc7
movq -0x40(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x40(%rbp), %rdi
callq 0x2130
movq %rax, %rcx
movq -0x90(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x48(%rbp)
callq 0x2140
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0xc079
movq -0x48(%rbp), %rax
movb $0x0, (%rax)
movq -0x48(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xc044
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)