// File: /workspace/github_c_makefile_star2_O0/randyrossi[P]fisher-modem/mkfilter/src/mkshape.C
// Function: printresults(char**)
static void printresults(char** argv) {
  if (options & opt_t) {
    // Comment the command line since this is code
    printf("//");
  }
  printcmdline(argv);
  double gain = 0.0;
  if (options & opt_h) {
    int p = ((numcoeffs - 1) / 2 & 1) ? 0 : 1;
    bool odd = false;
    for (int i = p; i < numcoeffs && xcoeffs[i] > 0.0; i += 2) {
      if (odd)
        gain += xcoeffs[i];
      else
        gain -= xcoeffs[i];
      odd ^= true;
    }
    if (odd)
      gain = -gain;
    gain *= 2.0;
  } else {
    for (int i = 0; i < numcoeffs; i++)
      gain += xcoeffs[i];
  }

  // opt_t was added to help make the shape tables used by v32tx and
  // v34tx dynamic since they are ultimately tied to the sample rate
  // This option prints source code that represents the 2nd half of the
  // raised cosine shape since that's what those tx functions want
  if (options & opt_t) {
    printf(
        "// DO NOT EDIT - This code automatically generated with mkshape.C\n");
    printf("// Note: This is only the 2nd half of the shape\n\n");
    printf("static float shapetab[2*SYMBLEN+1]=\n");
    printf("   {");
    for (int i = numcoeffs / 2; i < numcoeffs; i++) {
      if (i % 4 == 0 && i != 0) {
        printf("\n    ");
      }
      printf("%18.10e,", xcoeffs[i]);
    }
    printf("\n   };\n");
  } else {
    printf("G  = %18.10e\n", gain);
    printf("NZ = %d\n", numcoeffs - 1);
    for (int i = 0; i < numcoeffs; i++)
      printf("%18.10e\n", xcoeffs[i]);
    printf("NP = %d\n", numcoeffs - 1);
    for (int i = 0; i < numcoeffs - 1; i++)
      printf("0\n");
    printf("-1\n");
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl 0x7a11(%rip), %eax      # 0x90b0
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x16b7
leaq 0x1b45(%rip), %rdi      # 0x31f5
movb $0x0, %al
callq 0x1030
movq 0x30(%rsp), %rdi
callq 0x2750
xorps %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
movl 0x79e0(%rip), %eax      # 0x90b0
andl $0x8, %eax
cmpl $0x0, %eax
je 0x17fa
movl 0x79d6(%rip), %eax      # 0x90b8
subl $0x1, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
andl $0x1, %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, 0x24(%rsp)
movb $0x0, 0x23(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %ecx
xorl %eax, %eax
cmpl 0x799c(%rip), %ecx      # 0x90b8
movb %al, 0xb(%rsp)
jge 0x1741
movslq 0x1c(%rsp), %rcx
leaq 0x79a2(%rip), %rax      # 0x90d0
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
seta %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0x174b
jmp 0x17ba
testb $0x1, 0x23(%rsp)
je 0x1771
movslq 0x1c(%rsp), %rcx
leaq 0x7972(%rip), %rax      # 0x90d0
movsd (%rax,%rcx,8), %xmm0
addsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
jmp 0x1792
movslq 0x1c(%rsp), %rcx
leaq 0x7953(%rip), %rax      # 0x90d0
movsd (%rax,%rcx,8), %xmm1
movsd 0x28(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
movb 0x23(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
xorl $0x1, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x23(%rsp)
movl 0x1c(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x1c(%rsp)
jmp 0x1710
testb $0x1, 0x23(%rsp)
je 0x17e4
movsd 0x28(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x1854(%rip), %xmm0     # 0x3040
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
jmp 0x183a
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x78ac(%rip), %eax      # 0x90b8
jge 0x1838
movslq 0x18(%rsp), %rcx
leaq 0x78b6(%rip), %rax      # 0x90d0
movsd (%rax,%rcx,8), %xmm0
addsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x1802
jmp 0x183a
movl 0x7870(%rip), %eax      # 0x90b0
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x1909
leaq 0x19a3(%rip), %rdi      # 0x31f8
movb $0x0, %al
callq 0x1030
leaq 0x19d8(%rip), %rdi      # 0x323b
movb $0x0, %al
callq 0x1030
leaq 0x19fc(%rip), %rdi      # 0x326d
movb $0x0, %al
callq 0x1030
leaq 0x1a13(%rip), %rdi      # 0x3292
movb $0x0, %al
callq 0x1030
movl 0x782c(%rip), %eax      # 0x90b8
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x7816(%rip), %eax      # 0x90b8
jge 0x18f6
movl 0x14(%rsp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x18ca
cmpl $0x0, 0x14(%rsp)
je 0x18ca
leaq 0x19d4(%rip), %rdi      # 0x3297
movb $0x0, %al
callq 0x1030
movslq 0x14(%rsp), %rcx
leaq 0x77fa(%rip), %rax      # 0x90d0
movsd (%rax,%rcx,8), %xmm0
leaq 0x19bb(%rip), %rdi      # 0x329d
movb $0x1, %al
callq 0x1030
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x1898
leaq 0x19a9(%rip), %rdi      # 0x32a6
movb $0x0, %al
callq 0x1030
jmp 0x19cd
movsd 0x28(%rsp), %xmm0
leaq 0x1998(%rip), %rdi      # 0x32ae
movb $0x1, %al
callq 0x1030
movl 0x7795(%rip), %esi      # 0x90b8
subl $0x1, %esi
leaq 0x198f(%rip), %rdi      # 0x32bc
movb $0x0, %al
callq 0x1030
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x7772(%rip), %eax      # 0x90b8
jge 0x1974
movslq 0x10(%rsp), %rcx
leaq 0x777c(%rip), %rax      # 0x90d0
movsd (%rax,%rcx,8), %xmm0
leaq 0x1953(%rip), %rdi      # 0x32b3
movb $0x1, %al
callq 0x1030
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x193c
movl 0x773e(%rip), %esi      # 0x90b8
subl $0x1, %esi
leaq 0x1941(%rip), %rdi      # 0x32c5
movb $0x0, %al
callq 0x1030
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl 0x771b(%rip), %ecx      # 0x90b8
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x19bf
leaq 0x1923(%rip), %rdi      # 0x32ce
movb $0x0, %al
callq 0x1030
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x1993
leaq 0x190b(%rip), %rdi      # 0x32d1
movb $0x0, %al
callq 0x1030
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)