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


x86 assembly (clang, -O0):
<ADrawComputeArcPoint>:
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):
<ADrawComputeArcPoint>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movss  %xmm3,0x4(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
mov    0x2e92(%rip),%rax
movaps %xmm4,%xmm0
mulss  (%rax),%xmm0
divss  0xe9b(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
mulss  0xe91(%rip),%xmm2
movss  %xmm2,0x8(%rsp)
call   1040 <cos@plt>
mulss  0x8(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
call   1050 <round@plt>
mov    %eax,(%rbx)
movss  0x4(%rsp),%xmm0
mulss  0xe65(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0xc(%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 @ADrawComputeArcPoint(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 i32 @round(float %25)
%27 = load i32*, i32** %13
store i32 %26, i32* %27
%28 = load float, float* %9
%29 = load float, float* %11
%30 = fdiv float %29, 2.000000e+00
%31 = load float, float* %15
%32 = call float @sin(float %31)
%33 = call float @llvm.fmuladd.f32(float %30, float %32, float %28)
%34 = call i32 @round(float %33)
%35 = load i32*, i32** %14
store i32 %34, i32* %35
ret void
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define void @ADrawComputeArcPoint(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 i32 @round(float %13)
store i32 %14, i32* %5
%15 = fmul float %3, 5.000000e-01
%16 = tail call float @sin(float %10)
%17 = tail call float @llvm.fmuladd.f32(float %15, float %16, float %1)
%18 = tail call i32 @round(float %17)
store i32 %18, i32* %6
ret void
}