#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*/ buff;
typedef char const FILE;

/* Variables and functions */
int /*<<< orphan*/ add_half_exposure(char *, char const *, double);
int /*<<< orphan*/ assert(char const *);
double atof(char const *);
int /*<<< orphan*/ fclose(char const *);
scalar_t__ fgets(char *, int, char const *);
char *find_base_60(char const *);
char *fopen(char const *, char *);
int get_base_sixty(char const *);
int /*<<< orphan*/ get_iso_date(char *, char *);
int /*<<< orphan*/ memcmp(char *, char *, int);
int /*<<< orphan*/ printf(char *, ...);
char *strstr(char *, char *);
int main(const int argc, const char **argv) {
  const char *filename = (argc == 2 ? argv[1] : "Spacewatch_0.9m.log.txt");
  FILE *ifile = fopen(filename, "rb");
  char buff[200];
  char iso_date[30];
  double exposure = 0.;
  double ra, dec;
  const double min_exposure = 5.;
  assert(ifile);
  *iso_date = '\0';
  printf("# Spacewatch 'new formula' logs,  processed with sw_xvt2.c (q.v.)\n");
  printf("# Source file date %s\n", "Sat Jan 22 23:03:10 2022");
  printf("# Input file '%s'\n", filename);
  while (fgets(buff, sizeof(buff), ifile)) {
    const char *tptr = strstr(buff, "Exp: ");
    if (!memcmp(buff, "Observer", 8))
      printf("# %s", buff);
    if (!memcmp(buff, "0.9-m Log: ", 11))
      get_iso_date(iso_date, buff + 11);
    if (tptr) {
      exposure = atof(tptr + 5);
      if (exposure > min_exposure)
        printf("# Exposure: %.0f s\n", exposure);
      tptr = find_base_60(buff);
      assert(tptr);
      ra = get_base_sixty(tptr) * 15.;
      tptr = find_base_60(tptr + 8);
      assert(tptr);
      dec = get_base_sixty(tptr);
      if (tptr[-1] == '-')
        dec = -dec;
    }
    if (!memcmp(buff, "Img ", 4) || !memcmp(buff, "Pass ", 5))
      if (exposure > min_exposure) {
        char time_buff[20];
        tptr = find_base_60(buff);
        assert(tptr);
        add_half_exposure(time_buff, tptr, exposure);
        printf("%.3f,%.3f,%sT%s,691,na\n", ra, dec, iso_date, time_buff);
      }
  }
  fclose(ifile);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11f7 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x158(%rbp)
jmp    120a <main+0x4a>
lea    0xe12(%rip),%rax
mov    %rax,-0x158(%rbp)
jmp    120a <main+0x4a>
mov    -0x158(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe08(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  0xdc4(%rip),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
mov    -0x20(%rbp),%rdi
call   1090 <assert@plt>
movb   $0x0,-0x110(%rbp)
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe05(%rip),%rdi
lea    0xe15(%rip),%rsi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0xc8,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     1510 <main+0x350>
lea    -0xf0(%rbp),%rdi
lea    0xdfb(%rip),%rsi
call   10e0 <strstr@plt>
mov    %rax,-0x138(%rbp)
lea    -0xf0(%rbp),%rdi
lea    0xde7(%rip),%rsi
mov    $0x8,%edx
call   1070 <memcmp@plt>
cmp    $0x0,%eax
jne    12f8 <main+0x138>
lea    -0xf0(%rbp),%rsi
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xf0(%rbp),%rdi
lea    0xdbf(%rip),%rsi
mov    $0xb,%edx
call   1070 <memcmp@plt>
cmp    $0x0,%eax
jne    1330 <main+0x170>
lea    -0x110(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
add    $0xb,%rsi
call   10b0 <get_iso_date@plt>
cmpq   $0x0,-0x138(%rbp)
je     1444 <main+0x284>
mov    -0x138(%rbp),%rdi
add    $0x5,%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
movsd  0xc9a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1386 <main+0x1c6>
movsd  -0x118(%rbp),%xmm0
ff
lea    0xd52(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    -0xf0(%rbp),%rdi
call   10a0 <find_base_60@plt>
mov    %rax,-0x138(%rbp)
mov    -0x138(%rbp),%rdi
call   1090 <assert@plt>
mov    -0x138(%rbp),%rdi
call   1030 <get_base_sixty@plt>
cvtsi2sd %eax,%xmm0
movsd  0xc4b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
mov    -0x138(%rbp),%rdi
add    $0x8,%rdi
call   10a0 <find_base_60@plt>
mov    %rax,-0x138(%rbp)
mov    -0x138(%rbp),%rdi
call   1090 <assert@plt>
mov    -0x138(%rbp),%rdi
call   1030 <get_base_sixty@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
mov    -0x138(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x2d,%eax
jne    143f <main+0x27f>
movsd  -0x128(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
jmp    1444 <main+0x284>
lea    -0xf0(%rbp),%rdi
lea    0xc93(%rip),%rsi
mov    $0x4,%edx
call   1070 <memcmp@plt>
cmp    $0x0,%eax
je     1486 <main+0x2c6>
lea    -0xf0(%rbp),%rdi
lea    0xc77(%rip),%rsi
mov    $0x5,%edx
call   1070 <memcmp@plt>
cmp    $0x0,%eax
jne    150b <main+0x34b>
movsd  -0x118(%rbp),%xmm0
ff
movsd  0xb6a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1506 <main+0x346>
lea    -0xf0(%rbp),%rdi
call   10a0 <find_base_60@plt>
mov    %rax,-0x138(%rbp)
mov    -0x138(%rbp),%rdi
call   1090 <assert@plt>
lea    -0x150(%rbp),%rdi
mov    -0x138(%rbp),%rsi
movsd  -0x118(%rbp),%xmm0
ff
call   10d0 <add_half_exposure@plt>
movsd  -0x120(%rbp),%xmm0
ff
movsd  -0x128(%rbp),%xmm1
ff
lea    -0x110(%rbp),%rsi
lea    -0x150(%rbp),%rdx
lea    0xbf1(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
jmp    150b <main+0x34b>
jmp    1289 <main+0xc9>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
cmp    $0x2,%edi
jne    11ec <main+0x1c>
mov    0x8(%rsi),%rbx
jmp    11f3 <main+0x23>
lea    0xe2d(%rip),%rbx
lea    0xe3e(%rip),%rsi
mov    %rbx,%rdi
call   10d0 <fopen@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   10a0 <assert@plt>
movb   $0x0,0x20(%rsp)
lea    0xebc(%rip),%rdi
call   1040 <puts@plt>
lea    0xe16(%rip),%rdi
lea    0xe26(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe31(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x60(%rsp),%rdi
mov    $0xc8,%esi
mov    %r12,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     143c <main+0x26c>
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
lea    0x60(%rsp),%rbx
lea    0xe3f(%rip),%r14
lea    0x40(%rsp),%r15
jmp    1299 <main+0xc9>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %r12,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     143c <main+0x26c>
mov    %rbx,%rdi
lea    0xddb(%rip),%rsi
call   10f0 <strstr@plt>
mov    %rax,%r13
mov    %rbx,%rdi
lea    0xdcf(%rip),%rsi
mov    $0x8,%edx
call   1080 <memcmp@plt>
test   %eax,%eax
jne    12d4 <main+0x104>
lea    0xdc3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
lea    0xdb4(%rip),%rsi
mov    $0xb,%edx
call   1080 <memcmp@plt>
test   %eax,%eax
je     1300 <main+0x130>
test   %r13,%r13
jne    1318 <main+0x148>
jmp    13b0 <main+0x1e0>
cs nopw 0x0(%rax,%rax,1)
lea    0x20(%rsp),%rdi
lea    0x6b(%rsp),%rsi
call   10c0 <get_iso_date@plt>
test   %r13,%r13
je     13b0 <main+0x1e0>
add    $0x5,%r13
mov    %r13,%rdi
call   1050 <atof@plt>
movsd  %xmm0,(%rsp)
ucomisd 0xccf(%rip),%xmm0
jbe    1346 <main+0x176>
lea    0xd64(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1070 <printf@plt>
mov    %rbx,%rdi
call   10b0 <find_base_60@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   10a0 <assert@plt>
mov    %rbp,%rdi
call   1030 <get_base_sixty@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xc98(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
add    $0x8,%rbp
mov    %rbp,%rdi
call   10b0 <find_base_60@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   10a0 <assert@plt>
mov    %rbp,%rdi
call   1030 <get_base_sixty@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
cmpb   $0x2d,-0x1(%rbp)
jne    13aa <main+0x1da>
xorpd  0xc66(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1080 <memcmp@plt>
test   %eax,%eax
je     13e0 <main+0x210>
mov    %rbx,%rdi
lea    0xce9(%rip),%rsi
mov    $0x5,%edx
call   1080 <memcmp@plt>
test   %eax,%eax
jne    1280 <main+0xb0>
movsd  (%rsp),%xmm0
ucomisd 0xc13(%rip),%xmm0
jbe    1280 <main+0xb0>
mov    %rbx,%rdi
call   10b0 <find_base_60@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   10a0 <assert@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
movsd  (%rsp),%xmm0
call   10e0 <add_half_exposure@plt>
lea    0xca0(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
lea    0x20(%rsp),%rsi
mov    %r15,%rdx
mov    $0x2,%al
call   1070 <printf@plt>
jmp    1280 <main+0xb0>
mov    %r12,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Spacewatch_0.9m.log.txt\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [67 x i8] c"# Spacewatch 'new formula' logs, processed with sw_xvt2.c (q.v.)\0A\00"
@.str.3 = [23 x i8] c"# Source file date %s\0A\00"
@.str.4 = [25 x i8] c"Sat Jan 22 23:03:10 2022\00"
@.str.5 = [19 x i8] c"# Input file '%s'\0A\00"
@.str.6 = [6 x i8] c"Exp: \00"
@.str.7 = [9 x i8] c"Observer\00"
@.str.8 = [5 x i8] c"# %s\00"
@.str.9 = [12 x i8] c"0.9-m Log: \00"
@.str.10 = [20 x i8] c"# Exposure: %.0f s\0A\00"
@.str.11 = [5 x i8] c"Img \00"
@.str.12 = [6 x i8] c"Pass \00"
@.str.13 = [24 x i8] c"%.3f,%.3f,%sT%s,691,na\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [200 x i8]
%9 = alloca [30 x i8]
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i8*
%15 = alloca [20 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
br label %23
22: ; preds = %2
br label %23
23: ; preds = %22, %18
%24 = phi i8* [ %21, %18 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), %22 ]
store i8* %24, i8** %6
%25 = load i8*, i8** %6
%26 = call i8* @fopen(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i8* %26, i8** %7
store double 0.000000e+00, double* %10
store double 5.000000e+00, double* %13
%27 = load i8*, i8** %7
%28 = call i32 @assert(i8* %27)
%29 = getelementptr inbounds [30 x i8], [30 x i8]* %9, i64 0, i64 0
store i8 0, i8* %29
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%32 = load i8*, i8** %6
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %32)
br label %34
34: ; preds = %121, %23
%35 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%36 = load i8*, i8** %7
%37 = call i64 @fgets(i8* %35, i32 200, i8* %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %122
39: ; preds = %34
%40 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%41 = call i8* @strstr(i8* %40, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
store i8* %41, i8** %14
%42 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%43 = call i32 @memcmp(i8* %42, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 8)
%44 = icmp ne i32 %43, 0
br i1 %44, label %48, label %45
45: ; preds = %39
%46 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %46)
br label %48
48: ; preds = %45, %39
%49 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%50 = call i32 @memcmp(i8* %49, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 11)
%51 = icmp ne i32 %50, 0
br i1 %51, label %57, label %52
52: ; preds = %48
%53 = getelementptr inbounds [30 x i8], [30 x i8]* %9, i64 0, i64 0
%54 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%55 = getelementptr inbounds i8, i8* %54, i64 11
%56 = call i32 @get_iso_date(i8* %53, i8* %55)
br label %57
57: ; preds = %52, %48
%58 = load i8*, i8** %14
%59 = icmp ne i8* %58, null
br i1 %59, label %60, label %95
60: ; preds = %57
%61 = load i8*, i8** %14
%62 = getelementptr inbounds i8, i8* %61, i64 5
%63 = call double @atof(i8* %62)
store double %63, double* %10
%64 = load double, double* %10
%65 = fcmp ogt double %64, 5.000000e+00
br i1 %65, label %66, label %69
66: ; preds = %60
%67 = load double, double* %10
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), double %67)
br label %69
69: ; preds = %66, %60
%70 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%71 = call i8* @find_base_60(i8* %70)
store i8* %71, i8** %14
%72 = load i8*, i8** %14
%73 = call i32 @assert(i8* %72)
%74 = load i8*, i8** %14
%75 = call i32 @get_base_sixty(i8* %74)
%76 = sitofp i32 %75 to double
%77 = fmul double %76, 1.500000e+01
store double %77, double* %11
%78 = load i8*, i8** %14
%79 = getelementptr inbounds i8, i8* %78, i64 8
%80 = call i8* @find_base_60(i8* %79)
store i8* %80, i8** %14
%81 = load i8*, i8** %14
%82 = call i32 @assert(i8* %81)
%83 = load i8*, i8** %14
%84 = call i32 @get_base_sixty(i8* %83)
%85 = sitofp i32 %84 to double
store double %85, double* %12
%86 = load i8*, i8** %14
%87 = getelementptr inbounds i8, i8* %86, i64 -1
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 45
br i1 %90, label %91, label %94
91: ; preds = %69
%92 = load double, double* %12
%93 = fneg double %92
store double %93, double* %12
br label %94
94: ; preds = %91, %69
br label %95
95: ; preds = %94, %57
%96 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%97 = call i32 @memcmp(i8* %96, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 4)
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %103
99: ; preds = %95
%100 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%101 = call i32 @memcmp(i8* %100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%102 = icmp ne i32 %101, 0
br i1 %102, label %121, label %103
103: ; preds = %99, %95
%104 = load double, double* %10
%105 = fcmp ogt double %104, 5.000000e+00
br i1 %105, label %106, label %120
106: ; preds = %103
%107 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%108 = call i8* @find_base_60(i8* %107)
store i8* %108, i8** %14
%109 = load i8*, i8** %14
%110 = call i32 @assert(i8* %109)
%111 = getelementptr inbounds [20 x i8], [20 x i8]* %15, i64 0, i64 0
%112 = load i8*, i8** %14
%113 = load double, double* %10
%114 = call i32 @add_half_exposure(i8* %111, i8* %112, double %113)
%115 = load double, double* %11
%116 = load double, double* %12
%117 = getelementptr inbounds [30 x i8], [30 x i8]* %9, i64 0, i64 0
%118 = getelementptr inbounds [20 x i8], [20 x i8]* %15, i64 0, i64 0
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), double %115, double %116, i8* %117, i8* %118)
br label %120
120: ; preds = %106, %103
br label %121
121: ; preds = %120, %99
br label %34
122: ; preds = %34
%123 = load i8*, i8** %7
%124 = call i32 @fclose(i8* %123)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Spacewatch_0.9m.log.txt\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.3 = [23 x i8] c"# Source file date %s\0A\00"
@.str.4 = [25 x i8] c"Sat Jan 22 23:03:10 2022\00"
@.str.5 = [19 x i8] c"# Input file '%s'\0A\00"
@.str.6 = [6 x i8] c"Exp: \00"
@.str.7 = [9 x i8] c"Observer\00"
@.str.8 = [5 x i8] c"# %s\00"
@.str.9 = [12 x i8] c"0.9-m Log: \00"
@.str.10 = [20 x i8] c"# Exposure: %.0f s\0A\00"
@.str.11 = [5 x i8] c"Img \00"
@.str.12 = [6 x i8] c"Pass \00"
@.str.13 = [24 x i8] c"%.3f,%.3f,%sT%s,691,na\0A\00"
@str = [66 x i8] c"# Spacewatch 'new formula' logs, processed with sw_xvt2.c (q.v.)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [200 x i8]
%4 = alloca [30 x i8]
%5 = alloca [20 x i8]
%6 = icmp eq i32 %0, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
br label %10
10: ; preds = %2, %7
%11 = phi i8* [ %9, %7 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), %2 ]
%12 = tail call i8* @fopen(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%15 = tail call i32 @assert(i8* %12)
store i8 0, i8* %14
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %11)
%19 = call i64 @fgets(i8* %13, i32 200, i8* %12)
%20 = icmp eq i64 %19, 0
br i1 %20, label %83, label %21
21: ; preds = %10
%22 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 11
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
br label %24
24: ; preds = %21, %80
%25 = phi double [ 0.000000e+00, %21 ], [ %65, %80 ]
%26 = phi double [ undef, %21 ], [ %64, %80 ]
%27 = phi double [ undef, %21 ], [ %63, %80 ]
%28 = call i8* @strstr(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%29 = call i32 @memcmp(i8* %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 8)
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %24
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %13)
br label %33
33: ; preds = %31, %24
%34 = call i32 @memcmp(i8* %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 11)
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @get_iso_date(i8* %14, i8* %22)
br label %38
38: ; preds = %36, %33
%39 = icmp eq i8* %28, null
br i1 %39, label %62, label %40
40: ; preds = %38
%41 = getelementptr inbounds i8, i8* %28, i64 5
%42 = call double @atof(i8* %41)
%43 = fcmp ogt double %42, 5.000000e+00
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), double %42)
br label %46
46: ; preds = %44, %40
%47 = call i8* @find_base_60(i8* %13)
%48 = call i32 @assert(i8* %47)
%49 = call i32 @get_base_sixty(i8* %47)
%50 = sitofp i32 %49 to double
%51 = fmul double %50, 1.500000e+01
%52 = getelementptr inbounds i8, i8* %47, i64 8
%53 = call i8* @find_base_60(i8* %52)
%54 = call i32 @assert(i8* %53)
%55 = call i32 @get_base_sixty(i8* %53)
%56 = sitofp i32 %55 to double
%57 = getelementptr inbounds i8, i8* %53, i64 -1
%58 = load i8, i8* %57
%59 = icmp eq i8 %58, 45
%60 = fneg double %56
%61 = select i1 %59, double %60, double %56
br label %62
62: ; preds = %46, %38
%63 = phi double [ %27, %38 ], [ %51, %46 ]
%64 = phi double [ %26, %38 ], [ %61, %46 ]
%65 = phi double [ %25, %38 ], [ %42, %46 ]
%66 = call i32 @memcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 4)
%67 = icmp eq i32 %66, 0
br i1 %67, label %73, label %68
68: ; preds = %62
%69 = call i32 @memcmp(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%70 = icmp eq i32 %69, 0
%71 = fcmp ogt double %65, 5.000000e+00
%72 = select i1 %70, i1 %71, i1 false
br i1 %72, label %75, label %80
73: ; preds = %62
%74 = fcmp ogt double %65, 5.000000e+00
br i1 %74, label %75, label %80
75: ; preds = %68, %73
%76 = call i8* @find_base_60(i8* %13)
%77 = call i32 @assert(i8* %76)
%78 = call i32 @add_half_exposure(i8* %23, i8* %76, double %65)
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0), double %63, double %64, i8* %14, i8* %23)
br label %80
80: ; preds = %73, %75, %68
%81 = call i64 @fgets(i8* %13, i32 200, i8* %12)
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %24
83: ; preds = %80, %10
%84 = call i32 @fclose(i8* %12)
ret i32 0
}