// File: /workspace/github_c_makefile_star2_O0/sc932[P]ALE/src/synthReadGen.c
// Function: getBaseWithError
char getBaseWithError(const char res, const double errorRate){
  if(errorRate > rand() / ( RAND_MAX + 1.0 )){
    //printf("True.\n");
      if(res == 'A' || res == 'T' || res == 'G' || res == 'C'){
          return res;
      }else{
          // ambiguous
          if(0.25 < rand() / ( RAND_MAX + 1.0 )){
              return 'A';
          }else{
              if(0.33333333 < rand() / ( RAND_MAX + 1.0 )){
                  return 'T';
              }else{
                  if(0.5 < rand() / ( RAND_MAX + 1.0 )){
                      return 'G';
                  }else{
                      return 'C';
                  }
              }
          }
      }
  }else{ // error!
    //printf("False.\n");
    if(res == 'A'){
      if(0.33333333 < rand() / ( RAND_MAX + 1.0 )){
    return 'T';
      }else{
    if(0.5 < rand() / ( RAND_MAX + 1.0 )){
      return 'G';
    }else{
      return 'C';
    }
      }
    }
    if(res == 'T'){
      if(0.33333333 < rand() / ( RAND_MAX + 1.0 )){
    return 'A';
      }else{
    if(0.5 < rand() / ( RAND_MAX + 1.0 )){
      return 'G';
    }else{
      return 'C';
    }
      }
    }
    if(res == 'G'){
      if(0.33333333 < rand() / ( RAND_MAX + 1.0 )){
    return 'T';
      }else{
    if(0.5 < rand() / ( RAND_MAX + 1.0 )){
      return 'A';
    }else{
      return 'C';
    }
      }
    }
    if(res == 'C'){
      if(0.33333333 < rand() / ( RAND_MAX + 1.0 )){
    return 'T';
      }else{
    if(0.5 < rand() / ( RAND_MAX + 1.0 )){
      return 'G';
    }else{
      return 'A';
    }
      }
    }
  }
  // ambiguous return a random base
  if(0.25 < rand() / ( RAND_MAX + 1.0 )){
      return 'A';
  }else{
      if(0.33333333 < rand() / ( RAND_MAX + 1.0 )){
          return 'T';
      }else{
          if(0.5 < rand() / ( RAND_MAX + 1.0 )){
              return 'G';
          }else{
              return 'C';
          }
      }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dil, %al
movb %al, -0x2(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
callq 0x1160
movsd -0x18(%rbp), %xmm0
cvtsi2sd %eax, %xmm1
movsd 0x2cd5(%rip), %xmm2     # 0x4008
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x13fd
movsbl -0x2(%rbp), %eax
cmpl $0x41, %eax
je 0x1365
movsbl -0x2(%rbp), %eax
cmpl $0x54, %eax
je 0x1365
movsbl -0x2(%rbp), %eax
cmpl $0x47, %eax
je 0x1365
movsbl -0x2(%rbp), %eax
cmpl $0x43, %eax
jne 0x1370
movb -0x2(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x1626
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2c87(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2c83(%rip), %xmm1     # 0x4010
ucomisd %xmm1, %xmm0
jbe 0x139c
movb $0x41, -0x1(%rbp)
jmp 0x1626
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2c5b(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2c5f(%rip), %xmm1     # 0x4018
ucomisd %xmm1, %xmm0
jbe 0x13c8
movb $0x54, -0x1(%rbp)
jmp 0x1626
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2c2f(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2c3b(%rip), %xmm1     # 0x4020
ucomisd %xmm1, %xmm0
jbe 0x13f4
movb $0x47, -0x1(%rbp)
jmp 0x1626
movb $0x43, -0x1(%rbp)
jmp 0x1626
movsbl -0x2(%rbp), %eax
cmpl $0x41, %eax
jne 0x1467
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2bf1(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2bf5(%rip), %xmm1     # 0x4018
ucomisd %xmm1, %xmm0
jbe 0x1432
movb $0x54, -0x1(%rbp)
jmp 0x1626
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2bc5(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2bd1(%rip), %xmm1     # 0x4020
ucomisd %xmm1, %xmm0
jbe 0x145e
movb $0x47, -0x1(%rbp)
jmp 0x1626
movb $0x43, -0x1(%rbp)
jmp 0x1626
movsbl -0x2(%rbp), %eax
cmpl $0x54, %eax
jne 0x14d1
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2b87(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2b8b(%rip), %xmm1     # 0x4018
ucomisd %xmm1, %xmm0
jbe 0x149c
movb $0x41, -0x1(%rbp)
jmp 0x1626
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2b5b(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2b67(%rip), %xmm1     # 0x4020
ucomisd %xmm1, %xmm0
jbe 0x14c8
movb $0x47, -0x1(%rbp)
jmp 0x1626
movb $0x43, -0x1(%rbp)
jmp 0x1626
movsbl -0x2(%rbp), %eax
cmpl $0x47, %eax
jne 0x153b
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2b1d(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2b21(%rip), %xmm1     # 0x4018
ucomisd %xmm1, %xmm0
jbe 0x1506
movb $0x54, -0x1(%rbp)
jmp 0x1626
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2af1(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2afd(%rip), %xmm1     # 0x4020
ucomisd %xmm1, %xmm0
jbe 0x1532
movb $0x41, -0x1(%rbp)
jmp 0x1626
movb $0x43, -0x1(%rbp)
jmp 0x1626
movsbl -0x2(%rbp), %eax
cmpl $0x43, %eax
jne 0x15a5
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2ab3(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2ab7(%rip), %xmm1     # 0x4018
ucomisd %xmm1, %xmm0
jbe 0x1570
movb $0x54, -0x1(%rbp)
jmp 0x1626
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2a87(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2a93(%rip), %xmm1     # 0x4020
ucomisd %xmm1, %xmm0
jbe 0x159c
movb $0x47, -0x1(%rbp)
jmp 0x1626
movb $0x41, -0x1(%rbp)
jmp 0x1626
jmp 0x15a7
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2a50(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2a4c(%rip), %xmm1     # 0x4010
ucomisd %xmm1, %xmm0
jbe 0x15d0
movb $0x41, -0x1(%rbp)
jmp 0x1626
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x2a27(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2a2b(%rip), %xmm1     # 0x4018
ucomisd %xmm1, %xmm0
jbe 0x15f9
movb $0x54, -0x1(%rbp)
jmp 0x1626
callq 0x1160
cvtsi2sd %eax, %xmm0
movsd 0x29fe(%rip), %xmm1     # 0x4008
divsd %xmm1, %xmm0
movsd 0x2a0a(%rip), %xmm1     # 0x4020
ucomisd %xmm1, %xmm0
jbe 0x1622
movb $0x47, -0x1(%rbp)
jmp 0x1626
movb $0x43, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nop