#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 */
struct ADrawTag {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ arcPoint(float, float, float, float, float, unsigned int *,
                            unsigned int *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int,
                           unsigned int, unsigned int, unsigned int,
                           unsigned int, unsigned int, char *);
int /*<<< orphan*/ getSvgFile(struct ADrawTag *);
char *getSvgPen(struct ADrawTag *);
void SvgArc(struct ADrawTag *ctx, unsigned int cx, unsigned int cy,
            unsigned int w, unsigned int h, unsigned int s, unsigned int e) {
  unsigned int sx, sy, ex, ey;
  arcPoint((float)cx, (float)cy, (float)w, (float)h, (float)s, &sx, &sy);
  arcPoint((float)cx, (float)cy, (float)w, (float)h, (float)e, &ex, &ey);
  fprintf(
      getSvgFile(ctx),
      "<path d=\"M %u %u A%u,%u 0 0,1 %u,%u\" stroke=\"%s\" fill=\"none\"/>",
      sx, sy, w / 2, h / 2, ex, ey, getSvgPen(ctx));
}


x86 assembly (clang, -O0):
<SvgArc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2ss %rax,%xmm0
mov    -0x10(%rbp),%eax
cvtsi2ss %rax,%xmm1
mov    -0x14(%rbp),%eax
cvtsi2ss %rax,%xmm2
mov    -0x18(%rbp),%eax
cvtsi2ss %rax,%xmm3
mov    -0x1c(%rbp),%eax
cvtsi2ss %rax,%xmm4
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1030 <arcPoint@plt>
mov    -0xc(%rbp),%eax
cvtsi2ss %rax,%xmm0
mov    -0x10(%rbp),%eax
cvtsi2ss %rax,%xmm1
mov    -0x14(%rbp),%eax
cvtsi2ss %rax,%xmm2
mov    -0x18(%rbp),%eax
cvtsi2ss %rax,%xmm3
mov    0x10(%rbp),%eax
cvtsi2ss %rax,%xmm4
lea    -0x28(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
call   1030 <arcPoint@plt>
mov    -0x8(%rbp),%rdi
call   1040 <getSvgFile@plt>
mov    %eax,-0x48(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getSvgPen@plt>
mov    -0x48(%rbp),%edi
mov    -0x44(%rbp),%edx
mov    -0x40(%rbp),%ecx
mov    -0x3c(%rbp),%r8d
mov    -0x38(%rbp),%r9d
mov    -0x34(%rbp),%r11d
mov    -0x30(%rbp),%r10d
lea    0xdd7(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1060 <fprintf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SvgArc>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8d,%ebx
mov    %ecx,%ebp
mov    %rdi,%r14
mov    0x60(%rsp),%r15d
mov    %esi,%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,0x8(%rsp)
mov    %edx,%eax
cvtsi2ss %rax,%xmm1
movss  %xmm1,(%rsp)
mov    %ecx,%eax
cvtsi2ss %rax,%xmm2
movss  %xmm2,0x14(%rsp)
mov    %r8d,%eax
cvtsi2ss %rax,%xmm3
movss  %xmm3,0x10(%rsp)
mov    %r9d,%eax
cvtsi2ss %rax,%xmm4
lea    0x24(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   1030 <arcPoint@plt>
xorps  %xmm4,%xmm4
cvtsi2ss %r15,%xmm4
lea    0x1c(%rsp),%rdi
lea    0x18(%rsp),%rsi
movss  0x8(%rsp),%xmm0
movss  (%rsp),%xmm1
movss  0x14(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
call   1030 <arcPoint@plt>
mov    %r14,%rdi
call   1040 <getSvgFile@plt>
mov    %eax,%r15d
mov    0x24(%rsp),%r12d
mov    0x20(%rsp),%r13d
shr    %ebp
shr    %ebx
mov    0x1c(%rsp),%eax
mov    %rax,0x8(%rsp)
mov    0x18(%rsp),%eax
mov    %rax,(%rsp)
mov    %r14,%rdi
call   1050 <getSvgPen@plt>
sub    $0x8,%rsp
lea    0xdef(%rip),%rsi
mov    %r15d,%edi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    %ebp,%r8d
mov    %ebx,%r9d
push   %rax
push   0x10(%rsp)
push   0x20(%rsp)
call   1060 <fprintf@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ADrawTag = type { i32 }
@.str = [63 x i8] c"<path d=\22M %u %u A%u,%u 0 0,1 %u,%u\22 stroke=\22%s\22 fill=\22none\22/>\00"
define void @SvgArc(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca %struct.ADrawTag*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store %struct.ADrawTag* %0, %struct.ADrawTag** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%19 = load i32, i32* %9
%20 = uitofp i32 %19 to float
%21 = load i32, i32* %10
%22 = uitofp i32 %21 to float
%23 = load i32, i32* %11
%24 = uitofp i32 %23 to float
%25 = load i32, i32* %12
%26 = uitofp i32 %25 to float
%27 = load i32, i32* %13
%28 = uitofp i32 %27 to float
%29 = call i32 @arcPoint(float %20, float %22, float %24, float %26, float %28, i32* %15, i32* %16)
%30 = load i32, i32* %9
%31 = uitofp i32 %30 to float
%32 = load i32, i32* %10
%33 = uitofp i32 %32 to float
%34 = load i32, i32* %11
%35 = uitofp i32 %34 to float
%36 = load i32, i32* %12
%37 = uitofp i32 %36 to float
%38 = load i32, i32* %14
%39 = uitofp i32 %38 to float
%40 = call i32 @arcPoint(float %31, float %33, float %35, float %37, float %39, i32* %17, i32* %18)
%41 = load %struct.ADrawTag*, %struct.ADrawTag** %8
%42 = call i32 @getSvgFile(%struct.ADrawTag* %41)
%43 = load i32, i32* %15
%44 = load i32, i32* %16
%45 = load i32, i32* %11
%46 = udiv i32 %45, 2
%47 = load i32, i32* %12
%48 = udiv i32 %47, 2
%49 = load i32, i32* %17
%50 = load i32, i32* %18
%51 = load %struct.ADrawTag*, %struct.ADrawTag** %8
%52 = call i8* @getSvgPen(%struct.ADrawTag* %51)
%53 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %43, i32 %44, i32 %46, i32 %48, i32 %49, i32 %50, i8* %52)
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type { i32 }
@.str = [63 x i8] c"<path d=\22M %u %u A%u,%u 0 0,1 %u,%u\22 stroke=\22%s\22 fill=\22none\22/>\00"
define void @SvgArc(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = bitcast i32* %8 to i8*
%13 = bitcast i32* %9 to i8*
%14 = bitcast i32* %10 to i8*
%15 = bitcast i32* %11 to i8*
%16 = uitofp i32 %1 to float
%17 = uitofp i32 %2 to float
%18 = uitofp i32 %3 to float
%19 = uitofp i32 %4 to float
%20 = uitofp i32 %5 to float
%21 = call i32 @arcPoint(float %16, float %17, float %18, float %19, float %20, i32* %8, i32* %9)
%22 = uitofp i32 %6 to float
%23 = call i32 @arcPoint(float %16, float %17, float %18, float %19, float %22, i32* %10, i32* %11)
%24 = call i32 @getSvgFile(%struct.ADrawTag* %0)
%25 = load i32, i32* %8
%26 = load i32, i32* %9
%27 = lshr i32 %3, 1
%28 = lshr i32 %4, 1
%29 = load i32, i32* %10
%30 = load i32, i32* %11
%31 = call i8* @getSvgPen(%struct.ADrawTag* %0)
%32 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %26, i32 %27, i32 %28, i32 %29, i32 %30, i8* %31)
ret void
}