#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 atof(char *);
int atoi(char *);
int /*<<< orphan*/ full_ctime(char *, double, int);
char *get_csv(char *, char const *, int);
double log(double);
int /*<<< orphan*/ printf(char *, ...);
void csv_to_ades(const char *ibuff, const int low_num, const int high_num) {
  char tbuff[90];
  int num;
  get_csv(tbuff, ibuff, 3);
  num = atoi(tbuff);
  if (num >= low_num && num <= high_num) {
    const double jd_epoch = 2455197.5;
    double jd_obs;
    printf("   <optical>\n");
    printf("    <permID>%s</permID>\n", tbuff);
    printf("    <mode>TDI</mode>\n");
    printf("    <stn>258</stn>\n");
    printf("    <sys>ICRF_AU</sys>\n");
    printf("    <ctr>0</ctr>\n");
    printf("    <pos1>%s</pos1>\n", get_csv(tbuff, ibuff, 18));
    printf("    <pos2>%s</pos2>\n", get_csv(tbuff, ibuff, 19));
    printf("    <pos3>%s</pos3>\n", get_csv(tbuff, ibuff, 20));
    jd_obs = atof(get_csv(tbuff, ibuff, 6)) + jd_epoch;
    full_ctime(tbuff, jd_obs, 0x30 | (0x800 | 0x1000) | 0x8000 | 0x2000);
    tbuff[4] = tbuff[7] = '-';
    tbuff[10] = 'T';
    printf("    <obsTime>%s</obsTime>\n", tbuff);
    printf("    <ra>%s</ra>\n", get_csv(tbuff, ibuff, 7));
    printf("    <dec>%s</dec>\n", get_csv(tbuff, ibuff, 8));
    printf("    <rmsRA>%f</rmsRA>\n", atof(get_csv(tbuff, ibuff, 12)) / 1000.);
    printf("    <rmsDec>%f</rmsDec>\n",
           atof(get_csv(tbuff, ibuff, 13)) / 1000.);
    printf("    <rmsCorr>%s</rmsCorr>\n", get_csv(tbuff, ibuff, 14));
    get_csv(tbuff, ibuff, 15);
    if (*tbuff) {
      double g_flux, g_flux_sigma;
      printf("    <mag>%s</mag>\n", tbuff);
      g_flux = atof(get_csv(tbuff, ibuff, 16));
      g_flux_sigma = atof(get_csv(tbuff, ibuff, 17));
      printf("    <band>G</band>\n");
      printf("    <rmsMag>%.3f</rmsMag>\n",
             (g_flux_sigma / g_flux) / log(2.512));
      printf("    <photCat>Gaia2</photCat>\n");
    }
    printf("    <astCat>Gaia2</astCat>\n");
    printf("   </optical>\n");
  }
}


x86 assembly (clang, -O0):
<csv_to_ades>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x3,%edx
call   1060 <get_csv@plt>
lea    -0x70(%rbp),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     14ac <csv_to_ades+0x34c>
mov    -0x74(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     14ac <csv_to_ades+0x34c>
movsd  0xe55(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x12,%edx
call   1060 <get_csv@plt>
mov    %rax,%rsi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x13,%edx
call   1060 <get_csv@plt>
mov    %rax,%rsi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x14,%edx
call   1060 <get_csv@plt>
mov    %rax,%rsi
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x6,%edx
call   1060 <get_csv@plt>
mov    %rax,%rdi
call   1040 <atof@plt>
cvtsi2sd %eax,%xmm0
movsd  0xd69(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
lea    -0x70(%rbp),%rdi
movsd  -0x88(%rbp),%xmm0
ff
mov    $0xb830,%esi
call   1030 <full_ctime@plt>
movb   $0x2d,-0x69(%rbp)
movb   $0x2d,-0x6c(%rbp)
movb   $0x54,-0x66(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x7,%edx
call   1060 <get_csv@plt>
mov    %rax,%rsi
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1060 <get_csv@plt>
mov    %rax,%rsi
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xc,%edx
call   1060 <get_csv@plt>
mov    %rax,%rdi
call   1040 <atof@plt>
cvtsi2sd %eax,%xmm0
movsd  0xcb5(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xdbb(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xd,%edx
call   1060 <get_csv@plt>
mov    %rax,%rdi
call   1040 <atof@plt>
cvtsi2sd %eax,%xmm0
movsd  0xc7d(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xd9a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xe,%edx
call   1060 <get_csv@plt>
mov    %rax,%rsi
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xf,%edx
call   1060 <get_csv@plt>
cmpb   $0x0,-0x70(%rbp)
je     1490 <csv_to_ades+0x330>
lea    -0x70(%rbp),%rsi
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
call   1060 <get_csv@plt>
mov    %rax,%rdi
call   1040 <atof@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x11,%edx
call   1060 <get_csv@plt>
mov    %rax,%rdi
call   1040 <atof@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
lea    0xd36(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x98(%rbp),%xmm0
ff
divsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xbb0(%rip),%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
lea    0xd08(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xd15(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd25(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csv_to_ades>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x78,%rsp
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x3,%edx
call   1070 <get_csv@plt>
mov    %rbp,%rdi
call   1080 <atoi@plt>
cmp    %ebx,%eax
jl     1440 <csv_to_ades+0x2e0>
cmp    %r14d,%eax
jg     1440 <csv_to_ades+0x2e0>
lea    0xf81(%rip),%rdi
call   1040 <puts@plt>
lea    0xe65(%rip),%rdi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf6c(%rip),%rdi
call   1040 <puts@plt>
lea    0xf75(%rip),%rdi
call   1040 <puts@plt>
lea    0xf7c(%rip),%rdi
call   1040 <puts@plt>
lea    0xf87(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x12,%edx
call   1070 <get_csv@plt>
lea    0xe28(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x13,%edx
call   1070 <get_csv@plt>
lea    0xe1c(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x14,%edx
call   1070 <get_csv@plt>
lea    0xe10(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x6,%edx
call   1070 <get_csv@plt>
mov    %rax,%rdi
call   1050 <atof@plt>
cvtsi2sd %eax,%xmm0
addsd  0xd87(%rip),%xmm0
mov    %r14,%rdi
mov    $0xb830,%esi
call   1030 <full_ctime@plt>
movb   $0x2d,0x17(%rsp)
movb   $0x2d,0x14(%rsp)
movb   $0x54,0x1a(%rsp)
lea    0xdd4(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x7,%edx
call   1070 <get_csv@plt>
lea    0xdce(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x8,%edx
call   1070 <get_csv@plt>
lea    0xdbe(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0xc,%edx
call   1070 <get_csv@plt>
mov    %rax,%rdi
call   1050 <atof@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xcf9(%rip),%xmm0
lea    0xd99(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0xd,%edx
call   1070 <get_csv@plt>
mov    %rax,%rdi
call   1050 <atof@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xcc4(%rip),%xmm0
lea    0xd7b(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0xe,%edx
call   1070 <get_csv@plt>
lea    0xd76(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0xf,%edx
call   1070 <get_csv@plt>
cmpb   $0x0,0x10(%rsp)
je     1428 <csv_to_ades+0x2c8>
lea    0xd65(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1070 <get_csv@plt>
mov    %rax,%rdi
call   1050 <atof@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x11,%edx
call   1070 <get_csv@plt>
mov    %rax,%rdi
call   1050 <atof@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xdb3(%rip),%rdi
call   1040 <puts@plt>
movsd  0x8(%rsp),%xmm0
divsd  0xc02(%rip),%xmm0
lea    0xcf8(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xd9e(%rip),%rdi
call   1040 <puts@plt>
lea    0xd56(%rip),%rdi
call   1040 <puts@plt>
lea    0xd65(%rip),%rdi
call   1040 <puts@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c" <optical>\0A\00"
@.str.1 = [25 x i8] c" <permID>%s</permID>\0A\00"
@.str.2 = [22 x i8] c" <mode>TDI</mode>\0A\00"
@.str.3 = [20 x i8] c" <stn>258</stn>\0A\00"
@.str.4 = [24 x i8] c" <sys>ICRF_AU</sys>\0A\00"
@.str.5 = [18 x i8] c" <ctr>0</ctr>\0A\00"
@.str.6 = [21 x i8] c" <pos1>%s</pos1>\0A\00"
@.str.7 = [21 x i8] c" <pos2>%s</pos2>\0A\00"
@.str.8 = [21 x i8] c" <pos3>%s</pos3>\0A\00"
@.str.9 = [27 x i8] c" <obsTime>%s</obsTime>\0A\00"
@.str.10 = [17 x i8] c" <ra>%s</ra>\0A\00"
@.str.11 = [19 x i8] c" <dec>%s</dec>\0A\00"
@.str.12 = [23 x i8] c" <rmsRA>%f</rmsRA>\0A\00"
@.str.13 = [25 x i8] c" <rmsDec>%f</rmsDec>\0A\00"
@.str.14 = [27 x i8] c" <rmsCorr>%s</rmsCorr>\0A\00"
@.str.15 = [19 x i8] c" <mag>%s</mag>\0A\00"
@.str.16 = [20 x i8] c" <band>G</band>\0A\00"
@.str.17 = [27 x i8] c" <rmsMag>%.3f</rmsMag>\0A\00"
@.str.18 = [30 x i8] c" <photCat>Gaia2</photCat>\0A\00"
@.str.19 = [28 x i8] c" <astCat>Gaia2</astCat>\0A\00"
@.str.20 = [15 x i8] c" </optical>\0A\00"
define void @csv_to_ades(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [90 x i8]
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%13 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%14 = load i8*, i8** %4
%15 = call i8* @get_csv(i8* %13, i8* %14, i32 3)
%16 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %8
%18 = load i32, i32* %8
%19 = load i32, i32* %5
%20 = icmp sge i32 %18, %19
br i1 %20, label %21, label %115
21: ; preds = %3
%22 = load i32, i32* %8
%23 = load i32, i32* %6
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %115
25: ; preds = %21
store double 0x4142BB4EC0000000, double* %9
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%27 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%33 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%34 = load i8*, i8** %4
%35 = call i8* @get_csv(i8* %33, i8* %34, i32 18)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %35)
%37 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%38 = load i8*, i8** %4
%39 = call i8* @get_csv(i8* %37, i8* %38, i32 19)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* %39)
%41 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%42 = load i8*, i8** %4
%43 = call i8* @get_csv(i8* %41, i8* %42, i32 20)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %43)
%45 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%46 = load i8*, i8** %4
%47 = call i8* @get_csv(i8* %45, i8* %46, i32 6)
%48 = call i32 @atof(i8* %47)
%49 = sitofp i32 %48 to double
%50 = fadd double %49, 0x4142BB4EC0000000
store double %50, double* %10
%51 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%52 = load double, double* %10
%53 = call i32 @full_ctime(i8* %51, double %52, i32 47152)
%54 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 7
store i8 45, i8* %54
%55 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 4
store i8 45, i8* %55
%56 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 10
store i8 84, i8* %56
%57 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %57)
%59 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%60 = load i8*, i8** %4
%61 = call i8* @get_csv(i8* %59, i8* %60, i32 7)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i8* %61)
%63 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%64 = load i8*, i8** %4
%65 = call i8* @get_csv(i8* %63, i8* %64, i32 8)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8* %65)
%67 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%68 = load i8*, i8** %4
%69 = call i8* @get_csv(i8* %67, i8* %68, i32 12)
%70 = call i32 @atof(i8* %69)
%71 = sitofp i32 %70 to double
%72 = fdiv double %71, 1.000000e+03
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), double %72)
%74 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%75 = load i8*, i8** %4
%76 = call i8* @get_csv(i8* %74, i8* %75, i32 13)
%77 = call i32 @atof(i8* %76)
%78 = sitofp i32 %77 to double
%79 = fdiv double %78, 1.000000e+03
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), double %79)
%81 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%82 = load i8*, i8** %4
%83 = call i8* @get_csv(i8* %81, i8* %82, i32 14)
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i8* %83)
%85 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%86 = load i8*, i8** %4
%87 = call i8* @get_csv(i8* %85, i8* %86, i32 15)
%88 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%89 = load i8, i8* %88
%90 = icmp ne i8 %89, 0
br i1 %90, label %91, label %112
91: ; preds = %25
%92 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), i8* %92)
%94 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%95 = load i8*, i8** %4
%96 = call i8* @get_csv(i8* %94, i8* %95, i32 16)
%97 = call i32 @atof(i8* %96)
%98 = sitofp i32 %97 to double
store double %98, double* %11
%99 = getelementptr inbounds [90 x i8], [90 x i8]* %7, i64 0, i64 0
%100 = load i8*, i8** %4
%101 = call i8* @get_csv(i8* %99, i8* %100, i32 17)
%102 = call i32 @atof(i8* %101)
%103 = sitofp i32 %102 to double
store double %103, double* %12
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
%105 = load double, double* %12
%106 = load double, double* %11
%107 = fdiv double %105, %106
%108 = call double @log(double 2.512000e+00)
%109 = fdiv double %107, %108
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.17, i64 0, i64 0), double %109)
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.18, i64 0, i64 0))
br label %112
112: ; preds = %91, %25
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0))
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.20, i64 0, i64 0))
br label %115
115: ; preds = %112, %21, %3
ret void
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c" <permID>%s</permID>\0A\00"
@.str.6 = [21 x i8] c" <pos1>%s</pos1>\0A\00"
@.str.7 = [21 x i8] c" <pos2>%s</pos2>\0A\00"
@.str.8 = [21 x i8] c" <pos3>%s</pos3>\0A\00"
@.str.9 = [27 x i8] c" <obsTime>%s</obsTime>\0A\00"
@.str.10 = [17 x i8] c" <ra>%s</ra>\0A\00"
@.str.11 = [19 x i8] c" <dec>%s</dec>\0A\00"
@.str.12 = [23 x i8] c" <rmsRA>%f</rmsRA>\0A\00"
@.str.13 = [25 x i8] c" <rmsDec>%f</rmsDec>\0A\00"
@.str.14 = [27 x i8] c" <rmsCorr>%s</rmsCorr>\0A\00"
@.str.15 = [19 x i8] c" <mag>%s</mag>\0A\00"
@.str.17 = [27 x i8] c" <rmsMag>%.3f</rmsMag>\0A\00"
@str = [13 x i8] c" <optical>\00"
@str.21 = [21 x i8] c" <mode>TDI</mode>\00"
@str.22 = [19 x i8] c" <stn>258</stn>\00"
@str.23 = [23 x i8] c" <sys>ICRF_AU</sys>\00"
@str.24 = [17 x i8] c" <ctr>0</ctr>\00"
@str.25 = [27 x i8] c" <astCat>Gaia2</astCat>\00"
@str.26 = [14 x i8] c" </optical>\00"
@str.27 = [19 x i8] c" <band>G</band>\00"
@str.28 = [29 x i8] c" <photCat>Gaia2</photCat>\00"
define void @csv_to_ades(i8* %0, i32 %1, i32 %2) {
%4 = alloca [90 x i8]
%5 = getelementptr inbounds [90 x i8], [90 x i8]* %4, i64 0, i64 0
%6 = call i8* @get_csv(i8* %5, i8* %0, i32 3)
%7 = call i32 @atoi(i8* %5)
%8 = icmp slt i32 %7, %1
%9 = icmp sgt i32 %7, %2
%10 = or i1 %8, %9
br i1 %10, label %68, label %11
11: ; preds = %3
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.21, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.22, i64 0, i64 0))
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.23, i64 0, i64 0))
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.24, i64 0, i64 0))
%18 = call i8* @get_csv(i8* %5, i8* %0, i32 18)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %18)
%20 = call i8* @get_csv(i8* %5, i8* %0, i32 19)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* %20)
%22 = call i8* @get_csv(i8* %5, i8* %0, i32 20)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %22)
%24 = call i8* @get_csv(i8* %5, i8* %0, i32 6)
%25 = call i32 @atof(i8* %24)
%26 = sitofp i32 %25 to double
%27 = fadd double %26, 0x4142BB4EC0000000
%28 = call i32 @full_ctime(i8* %5, double %27, i32 47152)
%29 = getelementptr inbounds [90 x i8], [90 x i8]* %4, i64 0, i64 7
store i8 45, i8* %29
%30 = getelementptr inbounds [90 x i8], [90 x i8]* %4, i64 0, i64 4
store i8 45, i8* %30
%31 = getelementptr inbounds [90 x i8], [90 x i8]* %4, i64 0, i64 10
store i8 84, i8* %31
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8* %5)
%33 = call i8* @get_csv(i8* %5, i8* %0, i32 7)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0), i8* %33)
%35 = call i8* @get_csv(i8* %5, i8* %0, i32 8)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8* %35)
%37 = call i8* @get_csv(i8* %5, i8* %0, i32 12)
%38 = call i32 @atof(i8* %37)
%39 = sitofp i32 %38 to double
%40 = fdiv double %39, 1.000000e+03
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), double %40)
%42 = call i8* @get_csv(i8* %5, i8* %0, i32 13)
%43 = call i32 @atof(i8* %42)
%44 = sitofp i32 %43 to double
%45 = fdiv double %44, 1.000000e+03
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0), double %45)
%47 = call i8* @get_csv(i8* %5, i8* %0, i32 14)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i8* %47)
%49 = call i8* @get_csv(i8* %5, i8* %0, i32 15)
%50 = load i8, i8* %5
%51 = icmp eq i8 %50, 0
br i1 %51, label %65, label %52
52: ; preds = %11
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), i8* %5)
%54 = call i8* @get_csv(i8* %5, i8* %0, i32 16)
%55 = call i32 @atof(i8* %54)
%56 = sitofp i32 %55 to double
%57 = call i8* @get_csv(i8* %5, i8* %0, i32 17)
%58 = call i32 @atof(i8* %57)
%59 = sitofp i32 %58 to double
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.27, i64 0, i64 0))
%61 = fdiv double %59, %56
%62 = fdiv double %61, 0x3FED797B30392D9E
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.17, i64 0, i64 0), double %62)
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.28, i64 0, i64 0))
br label %65
65: ; preds = %52, %11
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.25, i64 0, i64 0))
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.26, i64 0, i64 0))
br label %68
68: ; preds = %65, %3
ret void
}