#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ countup(long *, int);
int /*<<< orphan*/ getstryng(char *);
int /*<<< orphan*/ printf(char *);
long sscanf(char *, char *, double *, double *, double *, double *);
void initfreqs(double *freqa, double *freqc, double *freqg, double *freqt) {
  char input[100];
  long scanned, loopcount;
  printf("Base frequencies for A, C, G, T/U (use blanks to separate)?\n");
  loopcount = 0;
  do {
    getstryng(input);
    scanned = sscanf(input, "%lf%lf%lf%lf%*[^\n]", freqa, freqc, freqg, freqt);
    if (scanned == 4)
      break;
    else
      printf("Please enter exactly 4 values.\n");
    countup(&loopcount, 100);
  } while (1);
}


x86 assembly (clang, -O0):
<initfreqs>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0xa0(%rbp)
lea    -0x90(%rbp),%rdi
call   1040 <getstryng@plt>
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xea1(%rip),%rsi
call   1050 <sscanf@plt>
mov    %rax,-0x98(%rbp)
cmpq   $0x4,-0x98(%rbp)
04
jne    11bb <initfreqs+0x7b>
jmp    11e7 <initfreqs+0xa7>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    $0x64,%esi
call   1060 <countup@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1172 <initfreqs+0x32>
jmp    11e7 <initfreqs+0xa7>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initfreqs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <getstryng@plt>
lea    0xe7d(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1050 <sscanf@plt>
cmp    $0x4,%rax
je     11f0 <initfreqs+0xb0>
lea    0x10(%rsp),%r13
lea    0xe57(%rip),%rbp
nopl   0x0(%rax)
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
mov    $0x64,%esi
call   1060 <countup@plt>
mov    %r13,%rdi
call   1040 <getstryng@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1050 <sscanf@plt>
cmp    $0x4,%rax
jne    11b0 <initfreqs+0x70>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [61 x i8] c"Base frequencies for A, C, G, T/U (use blanks to separate)?\0A\00"
@.str.1 = [19 x i8] c"%lf%lf%lf%lf%*[^\0A]\00"
@.str.2 = [32 x i8] c"Please enter exactly 4 values.\0A\00"
define void @initfreqs(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca [100 x i8]
%10 = alloca i64
%11 = alloca i64
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%12 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
store i64 0, i64* %11
br label %13
13: ; preds = %29, %4
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%15 = call i32 @getstryng(i8* %14)
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%17 = load double*, double** %5
%18 = load double*, double** %6
%19 = load double*, double** %7
%20 = load double*, double** %8
%21 = call i64 @sscanf(i8* %16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double* %17, double* %18, double* %19, double* %20)
store i64 %21, i64* %10
%22 = load i64, i64* %10
%23 = icmp eq i64 %22, 4
br i1 %23, label %24, label %25
24: ; preds = %13
br label %30
25: ; preds = %13
%26 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %25
%28 = call i32 @countup(i64* %11, i32 100)
br label %29
29: ; preds = %27
br i1 true, label %13, label %30
30: ; preds = %29, %24
ret void
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"%lf%lf%lf%lf%*[^\0A]\00"
@str = [60 x i8] c"Base frequencies for A, C, G, T/U (use blanks to separate)?\00"
@str.3 = [31 x i8] c"Please enter exactly 4 values.\00"
define void @initfreqs(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca [100 x i8]
%6 = alloca i64
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%8 = bitcast i64* %6 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
store i64 0, i64* %6
%10 = call i32 @getstryng(i8* %7)
%11 = call i64 @sscanf(i8* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double* %0, double* %1, double* %2, double* %3)
%12 = icmp eq i64 %11, 4
br i1 %12, label %19, label %13
13: ; preds = %4, %13
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.3, i64 0, i64 0))
%15 = call i32 @countup(i64* %6, i32 100)
%16 = call i32 @getstryng(i8* %7)
%17 = call i64 @sscanf(i8* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double* %0, double* %1, double* %2, double* %3)
%18 = icmp eq i64 %17, 4
br i1 %18, label %19, label %13
19: ; preds = %13, %4
ret void
}