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

/* Variables and functions */
int /*<<< orphan*/ cmio_jd2y(double, int *, int *, double *);
double log10(double);
int /*<<< orphan*/ snprintf(char *, int, char *);
int cmio_ce(double time, double tstart, double rcen, double rmax, int nbod,
            int nbig, double *m, int *stat, char **id, int nclo, int *iclo,
            int *jclo, int opt[8], int stopflag, double *tclo, double *dclo,
            double **ixvclo, double **jxvclo, char **mem, int lmem[200],
            FILE *outfile, int nstored, int ceflush) {
  int year, month;
  double tmp0, t1, rfac, fr, fv, theta, phi, vtheta, vphi;
  static char c[200][80];
  char fstop[38];
  char *mio_fl2c_out, *mio_re2c_out;
  char tstring[6];
  rfac = log10(rmax / rcen);
  for (int k = 0; k < nclo; k++) {
    nstored++;
  }
  if (nstored >= 100 || ceflush == 0) {
    for (int k = 0; k < nstored; k++) {
    }
    nstored = 0;
  }
  stopflag = 0;
  if (opt[0] == 1 && nclo > 0) {
    tmp0 = tclo[0];
    if (opt[2] == 1) {
      snprintf(fstop, sizeof(fstop), "(5a,/,9x,a,i10,1x,i2,1x,f4.1)");
      cmio_jd2y(tmp0, &year, &month, &t1);
    } else {
      if (opt[2] == 3) {
        snprintf(fstop, sizeof(fstop), "(5a,/,9x,a,f14.3,a)");
        t1 = (tmp0 - tstart) / 365.250;
      } else {
        snprintf(fstop, sizeof(fstop), "(5a,/,9x,a,f14.1,a)");
        if (opt[2] == 0) {
          t1 = tmp0;
        }
        if (opt[2] == 2) {
          t1 = tmp0 - tstart;
        }
      }
    }
    stopflag = 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmio_ce>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    0x70(%rbp),%eax
mov    0x68(%rbp),%eax
mov    0x60(%rbp),%rax
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
mov    %esi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9d,-0x44(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1050 <log10@plt>
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    11e0 <cmio_ce+0xb0>
mov    0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,0x68(%rbp)
mov    -0xdc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xdc(%rbp)
jmp    11b4 <cmio_ce+0x84>
cmpl   $0x64,0x68(%rbp)
jge    11f4 <cmio_ce+0xc4>
cmpl   $0x0,0x70(%rbp)
jne    122d <cmio_ce+0xfd>
movl   $0x0,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
cmp    0x68(%rbp),%eax
jge    1226 <cmio_ce+0xf6>
jmp    1212 <cmio_ce+0xe2>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    11fe <cmio_ce+0xce>
movl   $0x0,0x68(%rbp)
movl   $0x0,0x28(%rbp)
mov    0x20(%rbp),%rax
cmpl   $0x1,(%rax)
jne    133d <cmio_ce+0x20d>
cmpl   $0x0,-0x44(%rbp)
jle    133d <cmio_ce+0x20d>
mov    0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    0x20(%rbp),%rax
cmpl   $0x1,0x8(%rax)
jne    1299 <cmio_ce+0x169>
lea    -0xc0(%rbp),%rdi
mov    $0x26,%esi
lea    0xd8f(%rip),%rdx
call   1040 <snprintf@plt>
movsd  -0x58(%rbp),%xmm0
lea    -0x48(%rbp),%rdi
lea    -0x4c(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1030 <cmio_jd2y@plt>
jmp    1336 <cmio_ce+0x206>
mov    0x20(%rbp),%rax
cmpl   $0x3,0x8(%rax)
jne    12df <cmio_ce+0x1af>
lea    -0xc0(%rbp),%rdi
mov    $0x26,%esi
lea    0xd6c(%rip),%rdx
call   1040 <snprintf@plt>
movsd  -0x58(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xd2f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1331 <cmio_ce+0x201>
lea    -0xc0(%rbp),%rdi
mov    $0x26,%esi
lea    0xd48(%rip),%rdx
call   1040 <snprintf@plt>
mov    0x20(%rbp),%rax
cmpl   $0x0,0x8(%rax)
jne    130f <cmio_ce+0x1df>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    0x20(%rbp),%rax
cmpl   $0x2,0x8(%rax)
jne    132c <cmio_ce+0x1fc>
movsd  -0x58(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1331 <cmio_ce+0x201>
jmp    1336 <cmio_ce+0x206>
movl   $0x1,0x28(%rbp)
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmio_ce>:
push   %rbx
sub    $0x50,%rsp
mov    %r9d,%ebx
divsd  %xmm2,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm3,%xmm0
jae    11d0 <cmio_ce+0xa0>
test   %ebx,%ebx
jle    11c8 <cmio_ce+0x98>
mov    0x70(%rsp),%rax
cmpl   $0x1,(%rax)
jne    11c8 <cmio_ce+0x98>
mov    0x8(%rax),%eax
cmp    $0x3,%eax
je     11a9 <cmio_ce+0x79>
cmp    $0x1,%eax
jne    11b2 <cmio_ce+0x82>
mov    0x80(%rsp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xe82(%rip),%rdx
lea    0x20(%rsp),%rdi
mov    $0x26,%esi
call   1040 <snprintf@plt>
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x18(%rsp),%rdx
movsd  0x8(%rsp),%xmm0
call   1030 <cmio_jd2y@plt>
jmp    11c8 <cmio_ce+0x98>
lea    0xe6e(%rip),%rdx
jmp    11b9 <cmio_ce+0x89>
lea    0xe79(%rip),%rdx
lea    0x20(%rsp),%rdi
mov    $0x26,%esi
call   1040 <snprintf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret
movapd %xmm3,%xmm0
call   1050 <log10@plt>
test   %ebx,%ebx
jg     114e <cmio_ce+0x1e>
jmp    11c8 <cmio_ce+0x98>

LLVM IR (-O0):
@cmio_ce.c = internal global [200 x [80 x i8]] zeroinitializer
@.str = [30 x i8] c"(5a,/,9x,a,i10,1x,i2,1x,f4.1)\00"
@.str.1 = [20 x i8] c"(5a,/,9x,a,f14.3,a)\00"
@.str.2 = [20 x i8] c"(5a,/,9x,a,f14.1,a)\00"
define i32 @cmio_ce(double %0, double %1, double %2, double %3, i32 %4, i32 %5, double* %6, i32* %7, i8** %8, i32 %9, i32* %10, i32* %11, i32* %12, i32 %13, double* %14, double* %15, double** %16, double** %17, i8** %18, i32* %19, i32* %20, i32 %21, i32 %22) {
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca i32
%29 = alloca i32
%30 = alloca double*
%31 = alloca i32*
%32 = alloca i8**
%33 = alloca i32
%34 = alloca i32*
%35 = alloca i32*
%36 = alloca i32*
%37 = alloca i32
%38 = alloca double*
%39 = alloca double*
%40 = alloca double**
%41 = alloca double**
%42 = alloca i8**
%43 = alloca i32*
%44 = alloca i32*
%45 = alloca i32
%46 = alloca i32
%47 = alloca i32
%48 = alloca i32
%49 = alloca double
%50 = alloca double
%51 = alloca double
%52 = alloca double
%53 = alloca double
%54 = alloca double
%55 = alloca double
%56 = alloca double
%57 = alloca double
%58 = alloca [38 x i8]
%59 = alloca i8*
%60 = alloca i8*
%61 = alloca [6 x i8]
%62 = alloca i32
%63 = alloca i32
store double %0, double* %24
store double %1, double* %25
store double %2, double* %26
store double %3, double* %27
store i32 %4, i32* %28
store i32 %5, i32* %29
store double* %6, double** %30
store i32* %7, i32** %31
store i8** %8, i8*** %32
store i32 %9, i32* %33
store i32* %10, i32** %34
store i32* %11, i32** %35
store i32* %12, i32** %36
store i32 %13, i32* %37
store double* %14, double** %38
store double* %15, double** %39
store double** %16, double*** %40
store double** %17, double*** %41
store i8** %18, i8*** %42
store i32* %19, i32** %43
store i32* %20, i32** %44
store i32 %21, i32* %45
store i32 %22, i32* %46
%64 = load double, double* %27
%65 = load double, double* %26
%66 = fdiv double %64, %65
%67 = call double @log10(double %66)
store double %67, double* %51
store i32 0, i32* %62
br label %68
68: ; preds = %75, %23
%69 = load i32, i32* %62
%70 = load i32, i32* %33
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %78
72: ; preds = %68
%73 = load i32, i32* %45
%74 = add nsw i32 %73, 1
store i32 %74, i32* %45
br label %75
75: ; preds = %72
%76 = load i32, i32* %62
%77 = add nsw i32 %76, 1
store i32 %77, i32* %62
br label %68
78: ; preds = %68
%79 = load i32, i32* %45
%80 = icmp sge i32 %79, 100
br i1 %80, label %84, label %81
81: ; preds = %78
%82 = load i32, i32* %46
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %94
84: ; preds = %81, %78
store i32 0, i32* %63
br label %85
85: ; preds = %90, %84
%86 = load i32, i32* %63
%87 = load i32, i32* %45
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %93
89: ; preds = %85
br label %90
90: ; preds = %89
%91 = load i32, i32* %63
%92 = add nsw i32 %91, 1
store i32 %92, i32* %63
br label %85
93: ; preds = %85
store i32 0, i32* %45
br label %94
94: ; preds = %93, %81
store i32 0, i32* %37
%95 = load i32*, i32** %36
%96 = getelementptr inbounds i32, i32* %95, i64 0
%97 = load i32, i32* %96
%98 = icmp eq i32 %97, 1
br i1 %98, label %99, label %148
99: ; preds = %94
%100 = load i32, i32* %33
%101 = icmp sgt i32 %100, 0
br i1 %101, label %102, label %148
102: ; preds = %99
%103 = load double*, double** %38
%104 = getelementptr inbounds double, double* %103, i64 0
%105 = load double, double* %104
store double %105, double* %49
%106 = load i32*, i32** %36
%107 = getelementptr inbounds i32, i32* %106, i64 2
%108 = load i32, i32* %107
%109 = icmp eq i32 %108, 1
br i1 %109, label %110, label %115
110: ; preds = %102
%111 = getelementptr inbounds [38 x i8], [38 x i8]* %58, i64 0, i64 0
%112 = call i32 @snprintf(i8* %111, i32 38, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%113 = load double, double* %49
%114 = call i32 @cmio_jd2y(double %113, i32* %47, i32* %48, double* %50)
br label %147
115: ; preds = %102
%116 = load i32*, i32** %36
%117 = getelementptr inbounds i32, i32* %116, i64 2
%118 = load i32, i32* %117
%119 = icmp eq i32 %118, 3
br i1 %119, label %120, label %127
120: ; preds = %115
%121 = getelementptr inbounds [38 x i8], [38 x i8]* %58, i64 0, i64 0
%122 = call i32 @snprintf(i8* %121, i32 38, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%123 = load double, double* %49
%124 = load double, double* %25
%125 = fsub double %123, %124
%126 = fdiv double %125, 3.652500e+02
store double %126, double* %50
br label %146
127: ; preds = %115
%128 = getelementptr inbounds [38 x i8], [38 x i8]* %58, i64 0, i64 0
%129 = call i32 @snprintf(i8* %128, i32 38, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%130 = load i32*, i32** %36
%131 = getelementptr inbounds i32, i32* %130, i64 2
%132 = load i32, i32* %131
%133 = icmp eq i32 %132, 0
br i1 %133, label %134, label %136
134: ; preds = %127
%135 = load double, double* %49
store double %135, double* %50
br label %136
136: ; preds = %134, %127
%137 = load i32*, i32** %36
%138 = getelementptr inbounds i32, i32* %137, i64 2
%139 = load i32, i32* %138
%140 = icmp eq i32 %139, 2
br i1 %140, label %141, label %145
141: ; preds = %136
%142 = load double, double* %49
%143 = load double, double* %25
%144 = fsub double %142, %143
store double %144, double* %50
br label %145
145: ; preds = %141, %136
br label %146
146: ; preds = %145, %120
br label %147
147: ; preds = %146, %110
store i32 1, i32* %37
br label %148
148: ; preds = %147, %99, %94
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"(5a,/,9x,a,i10,1x,i2,1x,f4.1)\00"
@.str.1 = [20 x i8] c"(5a,/,9x,a,f14.3,a)\00"
@.str.2 = [20 x i8] c"(5a,/,9x,a,f14.1,a)\00"
define i32 @cmio_ce(double %0, double %1, double %2, double %3, i32 %4, i32 %5, double* nocapture readnone %6, i32* nocapture readnone %7, i8** nocapture readnone %8, i32 %9, i32* nocapture readnone %10, i32* nocapture readnone %11, i32* nocapture %12, i32 %13, double* nocapture %14, double* nocapture readnone %15, double** nocapture readnone %16, double** nocapture readnone %17, i8** nocapture readnone %18, i32* nocapture readnone %19, i32* nocapture readnone %20, i32 %21, i32 %22) {
%24 = alloca i32
%25 = alloca i32
%26 = alloca double
%27 = alloca [38 x i8]
%28 = bitcast i32* %24 to i8*
%29 = bitcast i32* %25 to i8*
%30 = bitcast double* %26 to i8*
%31 = getelementptr inbounds [38 x i8], [38 x i8]* %27, i64 0, i64 0
%32 = fdiv double %3, %2
%33 = fcmp ugt double %32, 0.000000e+00
br i1 %33, label %36, label %34
34: ; preds = %23
%35 = tail call double @log10(double %32)
br label %36
36: ; preds = %23, %34
%37 = icmp sgt i32 %9, 0
%38 = load i32, i32* %12
%39 = icmp eq i32 %38, 1
%40 = and i1 %37, %39
br i1 %40, label %41, label %52
41: ; preds = %36
%42 = getelementptr inbounds i32, i32* %12, i64 2
%43 = load i32, i32* %42
switch i32 %43, label %50 [
i32 1, label %44
i32 3, label %48
]
44: ; preds = %41
%45 = load double, double* %14
%46 = call i32 @snprintf(i8* %31, i32 38, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%47 = call i32 @cmio_jd2y(double %45, i32* %24, i32* %25, double* %26)
br label %52
48: ; preds = %41
%49 = call i32 @snprintf(i8* %31, i32 38, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %52
50: ; preds = %41
%51 = call i32 @snprintf(i8* %31, i32 38, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %52
52: ; preds = %50, %44, %48, %36
ret i32 0
}