#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 /*<<< orphan*/ printf(char *, float const, float const, float const,
                          float const, char const *);
void svg_line(const char *color, const float *p1, const float *p2, int dash) {
  if (!dash) {
    printf("<line x1=\"%f\" y1=\"%f\" x2=\"%f\" y2=\"%f\" stroke=\"%s\" "
           "stroke-width=\"0.1px\"/>\n",
           p1[0], p1[1], p2[0], p2[1], color);
    return;
  }
  const float dx = p2[0] - p1[0];
  const float dy = p2[1] - p1[1];
  const float h1[] = {
      p1[0] + dx * 0.45,
      p1[1] + dy * 0.45,
  };
  const float h2[] = {
      p1[0] + dx * 0.55,
      p1[1] + dy * 0.55,
  };
  svg_line(color, p1, h1, 0);
  svg_line(color, h2, p2, 0);
}


x86 assembly (clang, -O0):
<svg_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1178 <svg_line+0x58>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm3
mov    -0x8(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
jmp    1284 <svg_line+0x164>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe47(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe18(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdb3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <svg_line@plt>
mov    -0x8(%rbp),%rdi
lea    -0x34(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <svg_line@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svg_line>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rdi,%r14
test   %ecx,%ecx
je     11d2 <svg_line+0xc2>
movss  (%rbx),%xmm2
movss  0x4(%rbx),%xmm3
movss  (%rsi),%xmm0
movss  0x4(%rsi),%xmm1
subss  %xmm0,%xmm2
cvtss2sd %xmm0,%xmm8
cvtss2sd %xmm2,%xmm5
movsd  0xeb2(%rip),%xmm6
movaps %xmm5,%xmm2
mulsd  %xmm6,%xmm2
addsd  %xmm8,%xmm2
cvtsd2ss %xmm2,%xmm2
subss  %xmm1,%xmm3
cvtss2sd %xmm1,%xmm7
cvtss2sd %xmm3,%xmm4
mulsd  %xmm4,%xmm6
addsd  %xmm7,%xmm6
xorps  %xmm3,%xmm3
cvtsd2ss %xmm6,%xmm3
movsd  0xe87(%rip),%xmm6
mulsd  %xmm6,%xmm5
addsd  %xmm8,%xmm5
cvtsd2ss %xmm5,%xmm5
movss  %xmm5,0xc(%rsp)
mulsd  %xmm6,%xmm4
addsd  %xmm7,%xmm4
cvtsd2ss %xmm4,%xmm4
movss  %xmm4,0x8(%rsp)
lea    0xe63(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
movss  (%rbx),%xmm2
movss  0x4(%rbx),%xmm3
mov    %r15,%rdi
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
jmp    11eb <svg_line+0xdb>
movss  (%rsi),%xmm0
movss  0x4(%rsi),%xmm1
movss  (%rbx),%xmm2
movss  0x4(%rbx),%xmm3
lea    0xe25(%rip),%rdi
mov    %r14,%rsi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [74 x i8] c"<line x1=\22%f\22 y1=\22%f\22 x2=\22%f\22 y2=\22%f\22 stroke=\22%s\22 stroke-width=\220.1px\22/>\0A\00"
define void @svg_line(i8* %0, float* %1, float* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca float*
%7 = alloca float*
%8 = alloca i32
%9 = alloca float
%10 = alloca float
%11 = alloca [2 x float]
%12 = alloca [2 x float]
store i8* %0, i8** %5
store float* %1, float** %6
store float* %2, float** %7
store i32 %3, i32* %8
%13 = load i32, i32* %8
%14 = icmp ne i32 %13, 0
br i1 %14, label %30, label %15
15: ; preds = %4
%16 = load float*, float** %6
%17 = getelementptr inbounds float, float* %16, i64 0
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = load float*, float** %7
%23 = getelementptr inbounds float, float* %22, i64 0
%24 = load float, float* %23
%25 = load float*, float** %7
%26 = getelementptr inbounds float, float* %25, i64 1
%27 = load float, float* %26
%28 = load i8*, i8** %5
%29 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), float %18, float %21, float %24, float %27, i8* %28)
br label %87
30: ; preds = %4
%31 = load float*, float** %7
%32 = getelementptr inbounds float, float* %31, i64 0
%33 = load float, float* %32
%34 = load float*, float** %6
%35 = getelementptr inbounds float, float* %34, i64 0
%36 = load float, float* %35
%37 = fsub float %33, %36
store float %37, float* %9
%38 = load float*, float** %7
%39 = getelementptr inbounds float, float* %38, i64 1
%40 = load float, float* %39
%41 = load float*, float** %6
%42 = getelementptr inbounds float, float* %41, i64 1
%43 = load float, float* %42
%44 = fsub float %40, %43
store float %44, float* %10
%45 = getelementptr inbounds [2 x float], [2 x float]* %11, i64 0, i64 0
%46 = load float*, float** %6
%47 = getelementptr inbounds float, float* %46, i64 0
%48 = load float, float* %47
%49 = fpext float %48 to double
%50 = load float, float* %9
%51 = fpext float %50 to double
%52 = call double @llvm.fmuladd.f64(double %51, double 4.500000e-01, double %49)
%53 = fptrunc double %52 to float
store float %53, float* %45
%54 = getelementptr inbounds float, float* %45, i64 1
%55 = load float*, float** %6
%56 = getelementptr inbounds float, float* %55, i64 1
%57 = load float, float* %56
%58 = fpext float %57 to double
%59 = load float, float* %10
%60 = fpext float %59 to double
%61 = call double @llvm.fmuladd.f64(double %60, double 4.500000e-01, double %58)
%62 = fptrunc double %61 to float
store float %62, float* %54
%63 = getelementptr inbounds [2 x float], [2 x float]* %12, i64 0, i64 0
%64 = load float*, float** %6
%65 = getelementptr inbounds float, float* %64, i64 0
%66 = load float, float* %65
%67 = fpext float %66 to double
%68 = load float, float* %9
%69 = fpext float %68 to double
%70 = call double @llvm.fmuladd.f64(double %69, double 5.500000e-01, double %67)
%71 = fptrunc double %70 to float
store float %71, float* %63
%72 = getelementptr inbounds float, float* %63, i64 1
%73 = load float*, float** %6
%74 = getelementptr inbounds float, float* %73, i64 1
%75 = load float, float* %74
%76 = fpext float %75 to double
%77 = load float, float* %10
%78 = fpext float %77 to double
%79 = call double @llvm.fmuladd.f64(double %78, double 5.500000e-01, double %76)
%80 = fptrunc double %79 to float
store float %80, float* %72
%81 = load i8*, i8** %5
%82 = load float*, float** %6
%83 = getelementptr inbounds [2 x float], [2 x float]* %11, i64 0, i64 0
%84 = load i8*, i8** %5
%85 = getelementptr inbounds [2 x float], [2 x float]* %12, i64 0, i64 0
%86 = load float*, float** %7
br label %87
87: ; preds = %30, %15
ret void
}

LLVM IR (-O2):
@.str = [74 x i8] c"<line x1=\22%f\22 y1=\22%f\22 x2=\22%f\22 y2=\22%f\22 stroke=\22%s\22 stroke-width=\220.1px\22/>\0A\00"
define void @svg_line(i8* %0, float* nocapture %1, float* nocapture %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = load float, float* %1
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = load float, float* %2
%11 = getelementptr inbounds float, float* %2, i64 1
%12 = load float, float* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), float %7, float %9, float %10, float %12, i8* %0)
br label %39
14: ; preds = %4
%15 = load float, float* %2
%16 = load float, float* %1
%17 = fsub float %15, %16
%18 = getelementptr inbounds float, float* %2, i64 1
%19 = load float, float* %18
%20 = getelementptr inbounds float, float* %1, i64 1
%21 = load float, float* %20
%22 = fsub float %19, %21
%23 = fpext float %16 to double
%24 = fpext float %17 to double
%25 = tail call double @llvm.fmuladd.f64(double %24, double 4.500000e-01, double %23)
%26 = fptrunc double %25 to float
%27 = fpext float %21 to double
%28 = fpext float %22 to double
%29 = tail call double @llvm.fmuladd.f64(double %28, double 4.500000e-01, double %27)
%30 = fptrunc double %29 to float
%31 = tail call double @llvm.fmuladd.f64(double %24, double 5.500000e-01, double %23)
%32 = fptrunc double %31 to float
%33 = tail call double @llvm.fmuladd.f64(double %28, double 5.500000e-01, double %27)
%34 = fptrunc double %33 to float
%35 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), float %16, float %21, float %26, float %30, i8* %0)
%36 = load float, float* %2
%37 = load float, float* %18
%38 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), float %32, float %34, float %36, float %37, i8* %0)
br label %39
39: ; preds = %14, %6
ret void
}