#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*/ Curve(double *, int);
int /*<<< orphan*/ DashLine(double *);
int /*<<< orphan*/ SetDashSize(double, double);
void DashCurve(double *args, int num1) {
  double dashsize = args[2 * num1];
  if (num1 == 2) {
    DashLine(args);
  } else if (num1 > 2) {
    SetDashSize(dashsize, dashsize / 2);
    Curve(args, num1);
  }
}


x86 assembly (clang, -O0):
<DashCurve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    116e <DashCurve+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <DashLine@plt>
jmp    11a4 <DashCurve+0x74>
cmpl   $0x2,-0xc(%rbp)
jle    119f <DashCurve+0x6f>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe76(%rip),%xmm2
divsd  %xmm2,%xmm1
call   1040 <SetDashSize@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <Curve@plt>
jmp    11a4 <DashCurve+0x74>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DashCurve>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
cmp    $0x2,%esi
jne    114b <DashCurve+0x1b>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <DashLine@plt>
jle    117c <DashCurve+0x4c>
mov    %esi,%ebx
lea    (%rbx,%rbx,1),%eax
cltq
movsd  (%r14,%rax,8),%xmm0
movsd  0xe9e(%rip),%xmm1
mulsd  %xmm0,%xmm1
call   1040 <SetDashSize@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <Curve@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @DashCurve(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double
store double* %0, double** %3
store i32 %1, i32* %4
%6 = load double*, double** %3
%7 = load i32, i32* %4
%8 = mul nsw i32 2, %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %6, i64 %9
%11 = load double, double* %10
store double %11, double* %5
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load double*, double** %3
%16 = call i32 @DashLine(double* %15)
br label %29
17: ; preds = %2
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 2
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = load double, double* %5
%22 = load double, double* %5
%23 = fdiv double %22, 2.000000e+00
%24 = call i32 @SetDashSize(double %21, double %23)
%25 = load double*, double** %3
%26 = load i32, i32* %4
%27 = call i32 @Curve(double* %25, i32 %26)
br label %28
28: ; preds = %20, %17
br label %29
29: ; preds = %28, %14
ret void
}

LLVM IR (-O2):
define void @DashCurve(double* %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = load double, double* %5
%7 = icmp eq i32 %1, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @DashLine(double* %0)
br label %16
10: ; preds = %2
%11 = icmp sgt i32 %1, 2
br i1 %11, label %12, label %16
12: ; preds = %10
%13 = fmul double %6, 5.000000e-01
%14 = tail call i32 @SetDashSize(double %6, double %13)
%15 = tail call i32 @Curve(double* %0, i32 %1)
br label %16
16: ; preds = %10, %12, %8
ret void
}