#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 */
float M_PI;
float cos(float);
scalar_t__ round(float);
float sin(float);
void arcPoint(float cx, float cy, float w, float h, float a, unsigned int *x,
              unsigned int *y) {
  float rad = (float)((a * M_PI) / 180.0f);
  *x = (unsigned int)round(cx + ((w / 2.0f) * cos(rad)));
  *y = (unsigned int)round(cy + ((h / 2.0f) * sin(rad)));
}


x86 assembly (clang, -O0):
<arcPoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
mov    0x2e83(%rip),%rax
mulss  (%rax),%xmm0
movss  0xe93(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe6f(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x2c(%rbp),%xmm0
call   1040 <cos@plt>
movss  -0x3c(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x38(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <round@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xe23(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x2c(%rbp),%xmm0
call   1030 <sin@plt>
movss  -0x34(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x30(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <round@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arcPoint>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movss  %xmm3,0x4(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0xc(%rsp)
mov    0x2e92(%rip),%rax
movaps %xmm4,%xmm0
mulss  (%rax),%xmm0
divss  0xe9b(%rip),%xmm0
movss  %xmm0,0x10(%rsp)
mulss  0xe91(%rip),%xmm2
movss  %xmm2,0x8(%rsp)
call   1040 <cos@plt>
mulss  0x8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
call   1050 <round@plt>
mov    %eax,(%rbx)
movss  0x4(%rsp),%xmm0
mulss  0xe65(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulss  0x4(%rsp),%xmm0
addss  0x14(%rsp),%xmm0
call   1050 <round@plt>
mov    %eax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define void @arcPoint(float %0, float %1, float %2, float %3, float %4, i32* %5, i32* %6) {
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca float
store float %0, float* %8
store float %1, float* %9
store float %2, float* %10
store float %3, float* %11
store float %4, float* %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%16 = load float, float* %12
%17 = load float, float* @M_PI
%18 = fmul float %16, %17
%19 = fdiv float %18, 1.800000e+02
store float %19, float* %15
%20 = load float, float* %8
%21 = load float, float* %10
%22 = fdiv float %21, 2.000000e+00
%23 = load float, float* %15
%24 = call float @cos(float %23)
%25 = call float @llvm.fmuladd.f32(float %22, float %24, float %20)
%26 = call i64 @round(float %25)
%27 = trunc i64 %26 to i32
%28 = load i32*, i32** %13
store i32 %27, i32* %28
%29 = load float, float* %9
%30 = load float, float* %11
%31 = fdiv float %30, 2.000000e+00
%32 = load float, float* %15
%33 = call float @sin(float %32)
%34 = call float @llvm.fmuladd.f32(float %31, float %33, float %29)
%35 = call i64 @round(float %34)
%36 = trunc i64 %35 to i32
%37 = load i32*, i32** %14
store i32 %36, i32* %37
ret void
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define void @arcPoint(float %0, float %1, float %2, float %3, float %4, i32* nocapture writeonly %5, i32* nocapture writeonly %6) {
%8 = load float, float* @M_PI
%9 = fmul float %8, %4
%10 = fdiv float %9, 1.800000e+02
%11 = fmul float %2, 5.000000e-01
%12 = tail call float @cos(float %10)
%13 = tail call float @llvm.fmuladd.f32(float %11, float %12, float %0)
%14 = tail call i64 @round(float %13)
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = fmul float %3, 5.000000e-01
%17 = tail call float @sin(float %10)
%18 = tail call float @llvm.fmuladd.f32(float %16, float %17, float %1)
%19 = tail call i64 @round(float %18)
%20 = trunc i64 %19 to i32
store i32 %20, i32* %6
ret void
}