#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 */
scalar_t__ EOF;
int /*<<< orphan*/ error(char *);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ *stdout;
scalar_t__ strcmp(char *, char *);
void write_svg(double *segs, int n, int dim, char *filename, int xsize,
               int ysize, double width) {
  FILE *svg;
  int i;
  if (segs == NULL || n < 0 || dim <= 0)
    error("Error: invalid line segment list in write_svg.");
  if (xsize <= 0 || ysize <= 0)
    error("Error: invalid image size in write_svg.");
  if (strcmp(filename, "-") == 0)
    svg = stdout;
  else
    svg = fopen(filename, "w");
  if (svg == NULL)
    error("Error: unable to open SVG output file.");
  fprintf(svg, "<?xml version=\"1.0\" standalone=\"no\"?>\n");
  fprintf(svg, "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n");
  fprintf(svg, " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");
  fprintf(svg, "<svg width=\"%dpx\" height=\"%dpx\" ", xsize, ysize);
  fprintf(svg, "version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\" ");
  fprintf(svg, "xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n");
  for (i = 0; i < n; i++) {
    fprintf(svg, "<line x1=\"%f\" y1=\"%f\" x2=\"%f\" y2=\"%f\" ",
            segs[i * dim + 0], segs[i * dim + 1], segs[i * dim + 2],
            segs[i * dim + 3]);
    fprintf(svg, "stroke-width=\"%f\" stroke=\"black\" />\n",
            width <= 0.0 ? segs[i * dim + 4] : width);
  }
  fprintf(svg, "</svg>\n");
  if (svg != stdout && fclose(svg) == EOF)
    error("Error: unable to close file while writing SVG file.");
}


x86 assembly (clang, -O0):
<write_svg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1192 <write_svg+0x42>
cmpl   $0x0,-0xc(%rbp)
jl     1192 <write_svg+0x42>
cmpl   $0x0,-0x10(%rbp)
jg     119e <write_svg+0x4e>
lea    0xe67(%rip),%rdi
call   1060 <error@plt>
cmpl   $0x0,-0x1c(%rbp)
jle    11b2 <write_svg+0x62>
cmpl   $0x0,-0x20(%rbp)
jg     11be <write_svg+0x6e>
lea    0xe76(%rip),%rdi
call   1060 <error@plt>
mov    -0x18(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11eb <write_svg+0x9b>
mov    0x2df9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    11ff <write_svg+0xaf>
mov    -0x18(%rbp),%rdi
lea    0xe63(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1216 <write_svg+0xc6>
lea    0xe4a(%rip),%rdi
call   1060 <error@plt>
mov    -0x30(%rbp),%rdi
lea    0xe61(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe94(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xeb2(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    136a <write_svg+0x21a>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
lea    0xe92(%rip),%rsi
mov    $0x4,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     133b <write_svg+0x1eb>
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1345 <write_svg+0x1f5>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x40(%rbp),%rdi
movsd  -0x48(%rbp),%xmm0
lea    0xe62(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    128f <write_svg+0x13f>
mov    -0x30(%rbp),%rdi
lea    0xe67(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rax
mov    0x2c51(%rip),%rcx
cmp    (%rcx),%rax
je     13b5 <write_svg+0x265>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2c48(%rip),%rcx
cmp    (%rcx),%rax
jne    13b5 <write_svg+0x265>
lea    0xe34(%rip),%rdi
call   1060 <error@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_svg>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movsd  %xmm0,(%rsp)
mov    %r9d,%r13d
mov    %r8d,%r15d
mov    %rcx,%r14
mov    %edx,%ebp
mov    %esi,%r12d
mov    %rdi,%rbx
test   %rdi,%rdi
je     118f <write_svg+0x2f>
test   %r12d,%r12d
js     118f <write_svg+0x2f>
test   %ebp,%ebp
jg     119b <write_svg+0x3b>
lea    0xe72(%rip),%rdi
call   1060 <error@plt>
test   %r15d,%r15d
jle    11a5 <write_svg+0x45>
test   %r13d,%r13d
jg     11b1 <write_svg+0x51>
lea    0xe8b(%rip),%rdi
call   1060 <error@plt>
lea    0xea7(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     135e <write_svg+0x1fe>
lea    0xe91(%rip),%rsi
mov    %r14,%rdi
call   1070 <fopen@plt>
mov    %rax,%r14
test   %r14,%r14
jne    11ec <write_svg+0x8c>
lea    0xe7c(%rip),%rdi
call   1060 <error@plt>
lea    0xe97(%rip),%rdi
mov    $0x26,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0xea5(%rip),%rdi
mov    $0x2f,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0xebc(%rip),%rdi
mov    $0x35,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0xed9(%rip),%rsi
mov    %r14,%rdi
mov    %r15d,%edx
mov    %r13d,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xee3(%rip),%rdi
mov    $0x32,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0xefd(%rip),%rdi
mov    $0x2c,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
test   %r12d,%r12d
jle    12fc <write_svg+0x19c>
movslq %ebp,%r13
mov    %r12d,%ebp
add    $0x20,%rbx
shl    $0x3,%r13
lea    0xefe(%rip),%r15
lea    0xf1e(%rip),%r12
jmp    12c6 <write_svg+0x166>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
add    %r13,%rbx
add    $0xffffffffffffffff,%rbp
je     12fc <write_svg+0x19c>
movsd  -0x20(%rbx),%xmm0
movsd  -0x18(%rbx),%xmm1
movsd  -0x10(%rbx),%xmm2
movsd  -0x8(%rbx),%xmm3
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x4,%al
call   1050 <fprintf@plt>
movsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jb     12b0 <write_svg+0x150>
movsd  (%rbx),%xmm0
jmp    12b0 <write_svg+0x150>
lea    0xee1(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    0x2cbc(%rip),%rax
cmp    (%rax),%r14
je     134f <write_svg+0x1ef>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    0x2cb8(%rip),%rcx
cmp    (%rcx),%rax
jne    134f <write_svg+0x1ef>
lea    0xeb0(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <error@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c73(%rip),%rax
mov    (%rax),%r14
test   %r14,%r14
jne    11ec <write_svg+0x8c>
jmp    11e0 <write_svg+0x80>

LLVM IR (-O0):
@.str = [47 x i8] c"Error: invalid line segment list in write_svg.\00"
@.str.1 = [40 x i8] c"Error: invalid image size in write_svg.\00"
@.str.2 = [2 x i8] c"-\00"
@stdout = global i32* null
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [39 x i8] c"Error: unable to open SVG output file.\00"
@.str.5 = [39 x i8] c"<?xml version=\221.0\22 standalone=\22no\22?>\0A\00"
@.str.6 = [48 x i8] c"<!DOCTYPE svg PUBLIC \22-//W3C//DTD SVG 1.1//EN\22\0A\00"
@.str.7 = [54 x i8] c" \22http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\22>\0A\00"
@.str.8 = [33 x i8] c"<svg width=\22%dpx\22 height=\22%dpx\22 \00"
@.str.9 = [51 x i8] c"version=\221.1\22\0A xmlns=\22http://www.w3.org/2000/svg\22 \00"
@.str.10 = [45 x i8] c"xmlns:xlink=\22http://www.w3.org/1999/xlink\22>\0A\00"
@.str.11 = [39 x i8] c"<line x1=\22%f\22 y1=\22%f\22 x2=\22%f\22 y2=\22%f\22 \00"
@.str.12 = [37 x i8] c"stroke-width=\22%f\22 stroke=\22black\22 />\0A\00"
@.str.13 = [8 x i8] c"</svg>\0A\00"
@EOF = global i64 0
@.str.14 = [52 x i8] c"Error: unable to close file while writing SVG file.\00"
define void @write_svg(double* %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5, double %6) {
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca i32*
%16 = alloca i32
store double* %0, double** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store double %6, double* %14
%17 = load double*, double** %8
%18 = icmp eq double* %17, null
br i1 %18, label %25, label %19
19: ; preds = %7
%20 = load i32, i32* %9
%21 = icmp slt i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = load i32, i32* %10
%24 = icmp sle i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22, %19, %7
%26 = call i32 @error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
%28 = load i32, i32* %12
%29 = icmp sle i32 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %27
%31 = load i32, i32* %13
%32 = icmp sle i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %30, %27
%34 = call i32 @error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
%36 = load i8*, i8** %11
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = load i32*, i32** @stdout
store i32* %40, i32** %15
br label %44
41: ; preds = %35
%42 = load i8*, i8** %11
%43 = call i32* @fopen(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %43, i32** %15
br label %44
44: ; preds = %41, %39
%45 = load i32*, i32** %15
%46 = icmp eq i32* %45, null
br i1 %46, label %47, label %49
47: ; preds = %44
%48 = call i32 @error(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
br label %49
49: ; preds = %47, %44
%50 = load i32*, i32** %15
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0))
%52 = load i32*, i32** %15
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %52, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
%54 = load i32*, i32** %15
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %54, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
%56 = load i32*, i32** %15
%57 = load i32, i32* %12
%58 = load i32, i32* %13
%59 = call i32 (i32*, i8*, ...) @fprintf(i32* %56, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %57, i32 %58)
%60 = load i32*, i32** %15
%61 = call i32 (i32*, i8*, ...) @fprintf(i32* %60, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0))
%62 = load i32*, i32** %15
%63 = call i32 (i32*, i8*, ...) @fprintf(i32* %62, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %16
br label %64
64: ; preds = %120, %49
%65 = load i32, i32* %16
%66 = load i32, i32* %9
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %123
68: ; preds = %64
%69 = load i32*, i32** %15
%70 = load double*, double** %8
%71 = load i32, i32* %16
%72 = load i32, i32* %10
%73 = mul nsw i32 %71, %72
%74 = add nsw i32 %73, 0
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %70, i64 %75
%77 = load double, double* %76
%78 = load double*, double** %8
%79 = load i32, i32* %16
%80 = load i32, i32* %10
%81 = mul nsw i32 %79, %80
%82 = add nsw i32 %81, 1
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %78, i64 %83
%85 = load double, double* %84
%86 = load double*, double** %8
%87 = load i32, i32* %16
%88 = load i32, i32* %10
%89 = mul nsw i32 %87, %88
%90 = add nsw i32 %89, 2
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %86, i64 %91
%93 = load double, double* %92
%94 = load double*, double** %8
%95 = load i32, i32* %16
%96 = load i32, i32* %10
%97 = mul nsw i32 %95, %96
%98 = add nsw i32 %97, 3
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %94, i64 %99
%101 = load double, double* %100
%102 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), double %77, double %85, double %93, double %101)
%103 = load i32*, i32** %15
%104 = load double, double* %14
%105 = fcmp ole double %104, 0.000000e+00
br i1 %105, label %106, label %115
106: ; preds = %68
%107 = load double*, double** %8
%108 = load i32, i32* %16
%109 = load i32, i32* %10
%110 = mul nsw i32 %108, %109
%111 = add nsw i32 %110, 4
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %107, i64 %112
%114 = load double, double* %113
br label %117
115: ; preds = %68
%116 = load double, double* %14
br label %117
117: ; preds = %115, %106
%118 = phi double [ %114, %106 ], [ %116, %115 ]
%119 = call i32 (i32*, i8*, ...) @fprintf(i32* %103, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0), double %118)
br label %120
120: ; preds = %117
%121 = load i32, i32* %16
%122 = add nsw i32 %121, 1
store i32 %122, i32* %16
br label %64
123: ; preds = %64
%124 = load i32*, i32** %15
%125 = call i32 (i32*, i8*, ...) @fprintf(i32* %124, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
%126 = load i32*, i32** %15
%127 = load i32*, i32** @stdout
%128 = icmp ne i32* %126, %127
br i1 %128, label %129, label %136
129: ; preds = %123
%130 = load i32*, i32** %15
%131 = call i64 @fclose(i32* %130)
%132 = load i64, i64* @EOF
%133 = icmp eq i64 %131, %132
br i1 %133, label %134, label %136
134: ; preds = %129
%135 = call i32 @error(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.14, i64 0, i64 0))
br label %136
136: ; preds = %134, %129, %123
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Error: invalid line segment list in write_svg.\00"
@.str.1 = [40 x i8] c"Error: invalid image size in write_svg.\00"
@.str.2 = [2 x i8] c"-\00"
@stdout = global i32* null
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [39 x i8] c"Error: unable to open SVG output file.\00"
@.str.5 = [39 x i8] c"<?xml version=\221.0\22 standalone=\22no\22?>\0A\00"
@.str.6 = [48 x i8] c"<!DOCTYPE svg PUBLIC \22-//W3C//DTD SVG 1.1//EN\22\0A\00"
@.str.7 = [54 x i8] c" \22http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\22>\0A\00"
@.str.8 = [33 x i8] c"<svg width=\22%dpx\22 height=\22%dpx\22 \00"
@.str.9 = [51 x i8] c"version=\221.1\22\0A xmlns=\22http://www.w3.org/2000/svg\22 \00"
@.str.10 = [45 x i8] c"xmlns:xlink=\22http://www.w3.org/1999/xlink\22>\0A\00"
@.str.11 = [39 x i8] c"<line x1=\22%f\22 y1=\22%f\22 x2=\22%f\22 y2=\22%f\22 \00"
@.str.12 = [37 x i8] c"stroke-width=\22%f\22 stroke=\22black\22 />\0A\00"
@.str.13 = [8 x i8] c"</svg>\0A\00"
@EOF = global i64 0
@.str.14 = [52 x i8] c"Error: unable to close file while writing SVG file.\00"
define void @write_svg(double* %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5, double %6) {
%8 = icmp eq double* %0, null
%9 = icmp slt i32 %1, 0
%10 = or i1 %8, %9
%11 = icmp slt i32 %2, 1
%12 = or i1 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = tail call i32 @error(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %7, %13
%16 = icmp slt i32 %4, 1
%17 = icmp slt i32 %5, 1
%18 = or i1 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = tail call i32 @error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %15, %19
%22 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = load i32*, i32** @stdout
br label %28
26: ; preds = %21
%27 = tail call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %26, %24
%29 = phi i32* [ %25, %24 ], [ %27, %26 ]
%30 = icmp eq i32* %29, null
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = tail call i32 @error(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
%34 = tail call i64 @fwrite(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i64 38, i64 1, i32* %29)
%35 = tail call i64 @fwrite(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), i64 47, i64 1, i32* %29)
%36 = tail call i64 @fwrite(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0), i64 53, i64 1, i32* %29)
%37 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %4, i32 %5)
%38 = tail call i64 @fwrite(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i64 50, i64 1, i32* %29)
%39 = tail call i64 @fwrite(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.10, i64 0, i64 0), i64 44, i64 1, i32* %29)
%40 = icmp sgt i32 %1, 0
br i1 %40, label %41, label %69
41: ; preds = %33
%42 = fcmp ugt double %6, 0.000000e+00
%43 = sext i32 %2 to i64
%44 = zext i32 %1 to i64
br label %45
45: ; preds = %41, %64
%46 = phi i64 [ 0, %41 ], [ %67, %64 ]
%47 = mul nsw i64 %46, %43
%48 = getelementptr inbounds double, double* %0, i64 %47
%49 = load double, double* %48
%50 = add nsw i64 %47, 1
%51 = getelementptr inbounds double, double* %0, i64 %50
%52 = load double, double* %51
%53 = add nsw i64 %47, 2
%54 = getelementptr inbounds double, double* %0, i64 %53
%55 = load double, double* %54
%56 = add nsw i64 %47, 3
%57 = getelementptr inbounds double, double* %0, i64 %56
%58 = load double, double* %57
%59 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), double %49, double %52, double %55, double %58)
br i1 %42, label %64, label %60
60: ; preds = %45
%61 = add nsw i64 %47, 4
%62 = getelementptr inbounds double, double* %0, i64 %61
%63 = load double, double* %62
br label %64
64: ; preds = %45, %60
%65 = phi double [ %63, %60 ], [ %6, %45 ]
%66 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0), double %65)
%67 = add nuw nsw i64 %46, 1
%68 = icmp eq i64 %67, %44
br i1 %68, label %69, label %45
69: ; preds = %64, %33
%70 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i64 7, i64 1, i32* %29)
%71 = load i32*, i32** @stdout
%72 = icmp eq i32* %29, %71
br i1 %72, label %79, label %73
73: ; preds = %69
%74 = tail call i64 @fclose(i32* %29)
%75 = load i64, i64* @EOF
%76 = icmp eq i64 %74, %75
br i1 %76, label %77, label %79
77: ; preds = %73
%78 = tail call i32 @error(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.14, i64 0, i64 0))
br label %79
79: ; preds = %77, %73, %69
ret void
}