#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*/ PSDoArc(double, double, double);
void PSMyArc(double cx, double cy, double radx, double rady, double sa,
             double ta) {
  double ea;
  double temp;
  ea = sa + ta;
  while (sa < ea) {
    temp = ((sa + 90) / 90) * 90;
    PSDoArc(cx, sa, ea < temp ? ea : temp);
    sa = temp;
  }
}


x86 assembly (clang, -O0):
<PSMyArc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e7 <PSMyArc+0xd7>
movsd  0xe9f(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  0xe92(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe86(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11ba <PSMyArc+0xaa>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    11c4 <PSMyArc+0xb4>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
call   1030 <PSDoArc@plt>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1145 <PSMyArc+0x35>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PSMyArc>:
sub    $0x18,%rsp
addsd  %xmm4,%xmm5
ucomisd %xmm4,%xmm5
jbe    1182 <PSMyArc+0x72>
movapd %xmm4,%xmm1
movapd %xmm4,%xmm2
movsd  %xmm5,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0xeb8(%rip),%xmm0
addsd  %xmm0,%xmm2
divsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
movapd %xmm5,%xmm2
minsd  (%rsp),%xmm2
movsd  0x8(%rsp),%xmm0
call   1030 <PSDoArc@plt>
movsd  (%rsp),%xmm2
movsd  0x10(%rsp),%xmm5
ucomisd %xmm2,%xmm5
movapd %xmm2,%xmm1
ja     1140 <PSMyArc+0x30>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @PSMyArc(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%15 = load double, double* %11
%16 = load double, double* %12
%17 = fadd double %15, %16
store double %17, double* %13
br label %18
18: ; preds = %36, %6
%19 = load double, double* %11
%20 = load double, double* %13
%21 = fcmp olt double %19, %20
br i1 %21, label %22, label %40
22: ; preds = %18
%23 = load double, double* %11
%24 = fadd double %23, 9.000000e+01
%25 = fdiv double %24, 9.000000e+01
%26 = fmul double %25, 9.000000e+01
store double %26, double* %14
%27 = load double, double* %7
%28 = load double, double* %11
%29 = load double, double* %13
%30 = load double, double* %14
%31 = fcmp olt double %29, %30
br i1 %31, label %32, label %34
32: ; preds = %22
%33 = load double, double* %13
br label %36
34: ; preds = %22
%35 = load double, double* %14
br label %36
36: ; preds = %34, %32
%37 = phi double [ %33, %32 ], [ %35, %34 ]
%38 = call i32 @PSDoArc(double %27, double %28, double %37)
%39 = load double, double* %14
store double %39, double* %11
br label %18
40: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @PSMyArc(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fadd double %4, %5
%8 = fcmp ogt double %7, %4
br i1 %8, label %9, label %18
9: ; preds = %6, %9
%10 = phi double [ %13, %9 ], [ %4, %6 ]
%11 = fadd double %10, 9.000000e+01
%12 = fdiv double %11, 9.000000e+01
%13 = fmul double %12, 9.000000e+01
%14 = fcmp olt double %7, %13
%15 = select i1 %14, double %7, double %13
%16 = tail call i32 @PSDoArc(double %0, double %10, double %15)
%17 = fcmp olt double %13, %7
br i1 %17, label %9, label %18
18: ; preds = %9, %6
ret void
}