#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ errorExit(char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, double *, double *,
                          double *, double *);
void readBgFreqLine(FILE *bf, double *bgfreq) {
  if (!fscanf(bf, "%lf %lf %lf %lf\n", &bgfreq[0], &bgfreq[1], &bgfreq[2],
              &bgfreq[3]))
    errorExit("Background frequency file doesn't have right format.");
}


x86 assembly (clang, -O0):
<readBgFreqLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
add    $0x8,%rcx
mov    -0x10(%rbp),%r8
add    $0x10,%r8
mov    -0x10(%rbp),%r9
add    $0x18,%r9
lea    0xea9(%rip),%rsi
call   1030 <fscanf@plt>
cmp    $0x0,%eax
jne    1171 <readBgFreqLine+0x51>
lea    0xea5(%rip),%rdi
call   1040 <errorExit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readBgFreqLine>:
push   %rax
mov    %rsi,%rdx
lea    0x8(%rsi),%rcx
lea    0x10(%rsi),%r8
lea    0x18(%rsi),%r9
lea    0xec9(%rip),%rsi
call   1030 <fscanf@plt>
test   %eax,%eax
je     1142 <readBgFreqLine+0x22>
pop    %rax
ret
lea    0xec8(%rip),%rdi
pop    %rax
jmp    1040 <errorExit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%lf %lf %lf %lf\0A\00"
@.str.1 = [53 x i8] c"Background frequency file doesn't have right format.\00"
define void @readBgFreqLine(i32* %0, double* %1) {
%3 = alloca i32*
%4 = alloca double*
store i32* %0, i32** %3
store double* %1, double** %4
%5 = load i32*, i32** %3
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 1
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 2
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 3
%14 = call i32 @fscanf(i32* %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double* %7, double* %9, double* %11, double* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @errorExit(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%lf %lf %lf %lf\0A\00"
@.str.1 = [53 x i8] c"Background frequency file doesn't have right format.\00"
define void @readBgFreqLine(i32* nocapture %0, double* %1) {
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = getelementptr inbounds double, double* %1, i64 2
%5 = getelementptr inbounds double, double* %1, i64 3
%6 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double* %1, double* %3, double* %4, double* %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @errorExit(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}