#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*/ fprintf(int /*<<< orphan*/ *, char *);
void macula_ShowExample(FILE *outfile) {
  fprintf(outfile, "Example 1:\n\n"
                   "./vartools -i EXAMPLES/3 -L USERLIB/src/macula.so \\\n"
                   "   -stats t min \\\n"
                   "   -expr 'mag=10.0+err*gauss()' \\\n"
                   "   -macula inject \\\n"
                   "      Prot fix 1.234567 \\\n"
                   "      istar fix 1.4567 \\\n"
                   "      kappa2 fix 0.0 \\\n"
                   "      kappa4 fix 0.0 \\\n"
                   "      c1 fix 0.2 c2 fix 0.1 c3 fix 0.0 c4 fix 0.0 \\\n"
                   "      d1 fix 0.2 d2 fix 0.1 d3 fix 0.0 d4 fix 0.0 \\\n"
                   "      blend fix 1.0 \\\n"
                   "      Nspot 1 \\\n"
                   "         Lambda0 fix 0.0 \\\n"
                   "         Phi0 fix 1.2345 \\\n"
                   "         alphamax fix 0.2 \\\n"
                   "         fspot fix 0.1 \\\n"
                   "         tmax fixcolumn STATS_t_MIN_0 \\\n"
                   "         life fix 1000.0 \\\n"
                   "         ingress fix 0.1 \\\n"
                   "         egress fix 0.1 \\\n"
                   "   -o EXAMPLES/OUTDIR1/3.maculainject \\\n"
                   "   -oneline\n\n");
  fprintf(outfile,
          "Simulates the light curve of a spotted star using macula. We "
          "read-in the light curve EXAMPLES/3 for its timebase and magnitude "
          "uncertainties. The call to -stats is used to get the minimum time "
          "in the light curve, which we will use later in the call to -macula. "
          "The call to -expr replaces the magnitudes in the light curve with "
          "simple gaussian random noise. The call to -macula then injects the "
          "spot with all of the parameters fixed to values given on the "
          "command-line, save for \"tmax\" which we set to a previously "
          "determined quantity (STATS_t_MIN_0, which is the minimum time in "
          "the light curve). The simulated light curve is then output to the "
          "file EXAMPLES/OUTDIR1/3.maculainject.\n\n");
  fprintf(outfile, "Example 2:\n\n"
                   "./vartools -i EXAMPLES/OUTDIR1/3.maculainject -L "
                   "USERLIB/src/macula.so \\\n"
                   "   -stats t min \\\n"
                   "   -LS 0.1 100 0.1 1 0 \\\n"
                   "   -macula fit amoeba \\\n"
                   "      Prot fixcolumn LS_Period_1_1 vary \\\n"
                   "      istar fix 1.6 vary \\\n"
                   "      kappa2 fix 0.0 \\\n"
                   "      kappa4 fix 0.0 \\\n"
                   "      c1 fix 0.2 c2 fix 0.1 c3 fix 0.0 c4 fix 0.0 \\\n"
                   "      d1 fix 0.2 d2 fix 0.1 d3 fix 0.0 d4 fix 0.0 \\\n"
                   "      blend fix 1.0 \\\n"
                   "      Nspot 1 \\\n"
                   "         Lambda0 fix 0.0 \\\n"
                   "         Phi0 fix 1.2345 \\\n"
                   "         alphamax fix 0.2 \\\n"
                   "         fspot fix 0.1 \\\n"
                   "         tmax fixcolumn STATS_t_MIN_0 \\\n"
                   "         life fix 1000.0 \\\n"
                   "         ingress fix 0.1 \\\n"
                   "         egress fix 0.1 \\\n"
                   "      omodel EXAMPLES/OUTDIR1 \\\n"
                   "      ocurve EXAMPLES/OUTDIR1 \\\n"
                   "   -oneline\n\n");
  fprintf(
      outfile,
      "Fit a macula starspot model to the light curve that was simulated in "
      "example 1. In this case we use the -LS command to first find the period "
      "of the light curve. When then run macula, using \"fit amoeba\" to run a "
      "fit with the downhill-simplex algorithm. We include the \"vary\" "
      "keyword for the \"Prot\" and \"istar\" parameters, all other parameters "
      "will be held constant in the fit. The initial guesses of the parameters "
      "are given, for \"Prot\" we use the period found by -LS. A model "
      "evaluated at the observed times is output using the \"omodel\" keyword, "
      "while a model evaluated at uniformly sampled times (for plotting) is "
      "output using the \"ocurve\" keyword.\n\n");
}


x86 assembly (clang, -O0):
<macula_ShowExample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x1159(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x13f6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x16b0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macula_ShowExample>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x28f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0x115c(%rip),%rdi
mov    $0x2ac,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0x13f0(%rip),%rdi
mov    $0x2c9,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0x16a1(%rip),%rdi
mov    $0x28b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [656 x i8] c"Example 1:\0A\0A./vartools -i EXAMPLES/3 -L USERLIB/src/macula.so \\\0A -stats t min \\\0A -expr 'mag=10.0+err*gauss()' \\\0A -macula inject \\\0A Prot fix 1.234567 \\\0A istar fix 1.4567 \\\0A kappa2 fix 0.0 \\\0A kappa4 fix 0.0 \\\0A c1 fix 0.2 c2 fix 0.1 c3 fix 0.0 c4 fix 0.0 \\\0A d1 fix 0.2 d2 fix 0.1 d3 fix 0.0 d4 fix 0.0 \\\0A blend fix 1.0 \\\0A Nspot 1 \\\0A Lambda0 fix 0.0 \\\0A Phi0 fix 1.2345 \\\0A alphamax fix 0.2 \\\0A fspot fix 0.1 \\\0A tmax fixcolumn STATS_t_MIN_0 \\\0A life fix 1000.0 \\\0A ingress fix 0.1 \\\0A egress fix 0.1 \\\0A -o EXAMPLES/OUTDIR1/3.maculainject \\\0A -oneline\0A\0A\00"
@.str.1 = [685 x i8] c"Simulates the light curve of a spotted star using macula. We read-in the light curve EXAMPLES/3 for its timebase and magnitude uncertainties. The call to -stats is used to get the minimum time in the light curve, which we will use later in the call to -macula. The call to -expr replaces the magnitudes in the light curve with simple gaussian random noise. The call to -macula then injects the spot with all of the parameters fixed to values given on the command-line, save for \22tmax\22 which we set to a previously determined quantity (STATS_t_MIN_0, which is the minimum time in the light curve). The simulated light curve is then output to the file EXAMPLES/OUTDIR1/3.maculainject.\0A\0A\00"
@.str.2 = [714 x i8] c"Example 2:\0A\0A./vartools -i EXAMPLES/OUTDIR1/3.maculainject -L USERLIB/src/macula.so \\\0A -stats t min \\\0A -LS 0.1 100 0.1 1 0 \\\0A -macula fit amoeba \\\0A Prot fixcolumn LS_Period_1_1 vary \\\0A istar fix 1.6 vary \\\0A kappa2 fix 0.0 \\\0A kappa4 fix 0.0 \\\0A c1 fix 0.2 c2 fix 0.1 c3 fix 0.0 c4 fix 0.0 \\\0A d1 fix 0.2 d2 fix 0.1 d3 fix 0.0 d4 fix 0.0 \\\0A blend fix 1.0 \\\0A Nspot 1 \\\0A Lambda0 fix 0.0 \\\0A Phi0 fix 1.2345 \\\0A alphamax fix 0.2 \\\0A fspot fix 0.1 \\\0A tmax fixcolumn STATS_t_MIN_0 \\\0A life fix 1000.0 \\\0A ingress fix 0.1 \\\0A egress fix 0.1 \\\0A omodel EXAMPLES/OUTDIR1 \\\0A ocurve EXAMPLES/OUTDIR1 \\\0A -oneline\0A\0A\00"
@.str.3 = [652 x i8] c"Fit a macula starspot model to the light curve that was simulated in example 1. In this case we use the -LS command to first find the period of the light curve. When then run macula, using \22fit amoeba\22 to run a fit with the downhill-simplex algorithm. We include the \22vary\22 keyword for the \22Prot\22 and \22istar\22 parameters, all other parameters will be held constant in the fit. The initial guesses of the parameters are given, for \22Prot\22 we use the period found by -LS. A model evaluated at the observed times is output using the \22omodel\22 keyword, while a model evaluated at uniformly sampled times (for plotting) is output using the \22ocurve\22 keyword.\0A\0A\00"
define void @macula_ShowExample(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([656 x i8], [656 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([685 x i8], [685 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([714 x i8], [714 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %2
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([652 x i8], [652 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [656 x i8] c"Example 1:\0A\0A./vartools -i EXAMPLES/3 -L USERLIB/src/macula.so \\\0A -stats t min \\\0A -expr 'mag=10.0+err*gauss()' \\\0A -macula inject \\\0A Prot fix 1.234567 \\\0A istar fix 1.4567 \\\0A kappa2 fix 0.0 \\\0A kappa4 fix 0.0 \\\0A c1 fix 0.2 c2 fix 0.1 c3 fix 0.0 c4 fix 0.0 \\\0A d1 fix 0.2 d2 fix 0.1 d3 fix 0.0 d4 fix 0.0 \\\0A blend fix 1.0 \\\0A Nspot 1 \\\0A Lambda0 fix 0.0 \\\0A Phi0 fix 1.2345 \\\0A alphamax fix 0.2 \\\0A fspot fix 0.1 \\\0A tmax fixcolumn STATS_t_MIN_0 \\\0A life fix 1000.0 \\\0A ingress fix 0.1 \\\0A egress fix 0.1 \\\0A -o EXAMPLES/OUTDIR1/3.maculainject \\\0A -oneline\0A\0A\00"
@.str.1 = [685 x i8] c"Simulates the light curve of a spotted star using macula. We read-in the light curve EXAMPLES/3 for its timebase and magnitude uncertainties. The call to -stats is used to get the minimum time in the light curve, which we will use later in the call to -macula. The call to -expr replaces the magnitudes in the light curve with simple gaussian random noise. The call to -macula then injects the spot with all of the parameters fixed to values given on the command-line, save for \22tmax\22 which we set to a previously determined quantity (STATS_t_MIN_0, which is the minimum time in the light curve). The simulated light curve is then output to the file EXAMPLES/OUTDIR1/3.maculainject.\0A\0A\00"
@.str.2 = [714 x i8] c"Example 2:\0A\0A./vartools -i EXAMPLES/OUTDIR1/3.maculainject -L USERLIB/src/macula.so \\\0A -stats t min \\\0A -LS 0.1 100 0.1 1 0 \\\0A -macula fit amoeba \\\0A Prot fixcolumn LS_Period_1_1 vary \\\0A istar fix 1.6 vary \\\0A kappa2 fix 0.0 \\\0A kappa4 fix 0.0 \\\0A c1 fix 0.2 c2 fix 0.1 c3 fix 0.0 c4 fix 0.0 \\\0A d1 fix 0.2 d2 fix 0.1 d3 fix 0.0 d4 fix 0.0 \\\0A blend fix 1.0 \\\0A Nspot 1 \\\0A Lambda0 fix 0.0 \\\0A Phi0 fix 1.2345 \\\0A alphamax fix 0.2 \\\0A fspot fix 0.1 \\\0A tmax fixcolumn STATS_t_MIN_0 \\\0A life fix 1000.0 \\\0A ingress fix 0.1 \\\0A egress fix 0.1 \\\0A omodel EXAMPLES/OUTDIR1 \\\0A ocurve EXAMPLES/OUTDIR1 \\\0A -oneline\0A\0A\00"
@.str.3 = [652 x i8] c"Fit a macula starspot model to the light curve that was simulated in example 1. In this case we use the -LS command to first find the period of the light curve. When then run macula, using \22fit amoeba\22 to run a fit with the downhill-simplex algorithm. We include the \22vary\22 keyword for the \22Prot\22 and \22istar\22 parameters, all other parameters will be held constant in the fit. The initial guesses of the parameters are given, for \22Prot\22 we use the period found by -LS. A model evaluated at the observed times is output using the \22omodel\22 keyword, while a model evaluated at uniformly sampled times (for plotting) is output using the \22ocurve\22 keyword.\0A\0A\00"
define void @macula_ShowExample(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([656 x i8], [656 x i8]* @.str, i64 0, i64 0), i64 655, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([685 x i8], [685 x i8]* @.str.1, i64 0, i64 0), i64 684, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([714 x i8], [714 x i8]* @.str.2, i64 0, i64 0), i64 713, i64 1, i32* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([652 x i8], [652 x i8]* @.str.3, i64 0, i64 0), i64 651, i64 1, i32* %0)
ret void
}