#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 *, int, ...);
void write_svg_line(FILE *svg, double *lin, int smooth) {
  if (smooth) {
    lin[0] = lin[0] * 1.25;
    lin[1] = lin[1] * 1.25;
    lin[2] = lin[2] * 1.25;
    lin[3] = lin[3] * 1.25;
  }
  fprintf(svg, "<line x1=\"%f\" y1=\"%f\" x2=\"%f\" y2=\"%f\" ", lin[0], lin[1],
          lin[2], lin[3]);
  fprintf(svg, " fill=\"none\" stroke =\"green\" stroke-width=\"%d\" />\n", 1);
}


x86 assembly (clang, -O0):
<write_svg_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1193 <write_svg_line+0x83>
mov    -0x10(%rbp),%rax
movsd  0xec7(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xeaf(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe95(%rip),%xmm0
mulsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe7b(%rip),%xmm0
mulsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
cvttsd2si (%rax),%edx
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm2
lea    0xe47(%rip),%rsi
mov    $0x3,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe5c(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_svg_line>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rsi),%xmm2
test   %edx,%edx
je     1149 <write_svg_line+0x39>
movhpd 0x8(%rsi),%xmm2
movapd 0xed7(%rip),%xmm0
mulpd  %xmm0,%xmm2
movupd %xmm2,(%rsi)
movupd 0x10(%rsi),%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,0x10(%rsi)
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
jmp    1153 <write_svg_line+0x43>
movsd  0x8(%rsi),%xmm0
movupd 0x10(%rsi),%xmm1
cvttsd2si %xmm2,%edx
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%al
call   1030 <fprintf@plt>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"<line x1=\22%f\22 y1=\22%f\22 x2=\22%f\22 y2=\22%f\22 \00"
@.str.1 = [51 x i8] c" fill=\22none\22 stroke =\22green\22 stroke-width=\22%d\22 />\0A\00"
define void @write_svg_line(i32* %0, double* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca double*
%6 = alloca i32
store i32* %0, i32** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %34
9: ; preds = %3
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fmul double %12, 1.250000e+00
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = fmul double %18, 1.250000e+00
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 1
store double %19, double* %21
%22 = load double*, double** %5
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fmul double %24, 1.250000e+00
%26 = load double*, double** %5
%27 = getelementptr inbounds double, double* %26, i64 2
store double %25, double* %27
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 3
%30 = load double, double* %29
%31 = fmul double %30, 1.250000e+00
%32 = load double*, double** %5
%33 = getelementptr inbounds double, double* %32, i64 3
store double %31, double* %33
br label %34
34: ; preds = %9, %3
%35 = load i32*, i32** %4
%36 = load double*, double** %5
%37 = getelementptr inbounds double, double* %36, i64 0
%38 = load double, double* %37
%39 = fptosi double %38 to i32
%40 = load double*, double** %5
%41 = getelementptr inbounds double, double* %40, i64 1
%42 = load double, double* %41
%43 = load double*, double** %5
%44 = getelementptr inbounds double, double* %43, i64 2
%45 = load double, double* %44
%46 = load double*, double** %5
%47 = getelementptr inbounds double, double* %46, i64 3
%48 = load double, double* %47
%49 = call i32 (i32*, i8*, i32, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %39, double %42, double %45, double %48)
%50 = load i32*, i32** %4
%51 = call i32 (i32*, i8*, i32, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"<line x1=\22%f\22 y1=\22%f\22 x2=\22%f\22 y2=\22%f\22 \00"
@.str.1 = [51 x i8] c" fill=\22none\22 stroke =\22green\22 stroke-width=\22%d\22 />\0A\00"
define void @write_svg_line(i32* nocapture %0, double* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = load double, double* %1
br i1 %4, label %6, label %12
6: ; preds = %3
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 2
%10 = bitcast double* %9 to <2 x double>*
%11 = load <2 x double>, <2 x double>* %10
br label %26
12: ; preds = %3
%13 = getelementptr inbounds double, double* %1, i64 1
%14 = load double, double* %13
%15 = insertelement <2 x double> poison, double %5, i64 0
%16 = insertelement <2 x double> %15, double %14, i64 1
%17 = fmul <2 x double> %16, <double 1.250000e+00, double 1.250000e+00>
%18 = bitcast double* %1 to <2 x double>*
store <2 x double> %17, <2 x double>* %18
%19 = getelementptr inbounds double, double* %1, i64 2
%20 = bitcast double* %19 to <2 x double>*
%21 = load <2 x double>, <2 x double>* %20
%22 = fmul <2 x double> %21, <double 1.250000e+00, double 1.250000e+00>
%23 = bitcast double* %19 to <2 x double>*
store <2 x double> %22, <2 x double>* %23
%24 = extractelement <2 x double> %17, i64 0
%25 = extractelement <2 x double> %17, i64 1
br label %26
26: ; preds = %6, %12
%27 = phi double [ %8, %6 ], [ %25, %12 ]
%28 = phi double [ %5, %6 ], [ %24, %12 ]
%29 = phi <2 x double> [ %11, %6 ], [ %22, %12 ]
%30 = fptosi double %28 to i32
%31 = extractelement <2 x double> %29, i64 0
%32 = extractelement <2 x double> %29, i64 1
%33 = tail call i32 (i32*, i8*, i32, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %30, double %27, double %31, double %32)
%34 = tail call i32 (i32*, i8*, i32, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}