#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*/ G_rotate_around_point(double, double, double *, double *,
                                         double);
scalar_t__ floor(double);
void G_rotate_around_point_int(int X0, int Y0, int *X1, int *Y1, double angle) {
  double x = (double)*X1;
  double y = (double)*Y1;
  if (angle == 0.0)
    return;
  G_rotate_around_point((double)X0, (double)Y0, &x, &y, angle);
  *X1 = (int)floor(x + 0.5);
  *Y1 = (int)floor(y + 0.5);
}


x86 assembly (clang, -O0):
<G_rotate_around_point_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1172 <G_rotate_around_point_int+0x52>
jp     1172 <G_rotate_around_point_int+0x52>
jmp    11c2 <G_rotate_around_point_int+0xa2>
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <G_rotate_around_point@plt>
movsd  0xe6a(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
call   1040 <floor@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  0xe50(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
call   1040 <floor@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G_rotate_around_point_int>:
push   %r14
push   %rbx
sub    $0x18,%rsp
cvtsi2sdl (%rdx),%xmm1
movapd %xmm0,%xmm2
movsd  %xmm1,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl (%rcx),%xmm0
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jne    114e <G_rotate_around_point_int+0x2e>
jnp    119c <G_rotate_around_point_int+0x7c>
mov    %rdx,%rbx
mov    %rcx,%r14
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <G_rotate_around_point@plt>
movsd  0x10(%rsp),%xmm0
addsd  0xe81(%rip),%xmm0
call   1040 <floor@plt>
mov    %eax,(%rbx)
movsd  0xe72(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
call   1040 <floor@plt>
mov    %eax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @G_rotate_around_point_int(i32 %0, i32 %1, i32* %2, i32* %3, double %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca double
%11 = alloca double
%12 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store double %4, double* %10
%13 = load i32*, i32** %8
%14 = load i32, i32* %13
%15 = sitofp i32 %14 to double
store double %15, double* %11
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = sitofp i32 %17 to double
store double %18, double* %12
%19 = load double, double* %10
%20 = fcmp oeq double %19, 0.000000e+00
br i1 %20, label %21, label %22
21: ; preds = %5
br label %39
22: ; preds = %5
%23 = load i32, i32* %6
%24 = sitofp i32 %23 to double
%25 = load i32, i32* %7
%26 = sitofp i32 %25 to double
%27 = load double, double* %10
%28 = call i32 @G_rotate_around_point(double %24, double %26, double* %11, double* %12, double %27)
%29 = load double, double* %11
%30 = fadd double %29, 5.000000e-01
%31 = call i64 @floor(double %30)
%32 = trunc i64 %31 to i32
%33 = load i32*, i32** %8
store i32 %32, i32* %33
%34 = load double, double* %12
%35 = fadd double %34, 5.000000e-01
%36 = call i64 @floor(double %35)
%37 = trunc i64 %36 to i32
%38 = load i32*, i32** %9
store i32 %37, i32* %38
br label %39
39: ; preds = %22, %21
ret void
}

LLVM IR (-O2):
define void @G_rotate_around_point_int(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = bitcast double* %6 to i8*
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to double
store double %10, double* %6
%11 = bitcast double* %7 to i8*
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to double
store double %13, double* %7
%14 = fcmp oeq double %4, 0.000000e+00
br i1 %14, label %27, label %15
15: ; preds = %5
%16 = sitofp i32 %0 to double
%17 = sitofp i32 %1 to double
%18 = call i32 @G_rotate_around_point(double %16, double %17, double* %6, double* %7, double %4)
%19 = load double, double* %6
%20 = fadd double %19, 5.000000e-01
%21 = call i64 @floor(double %20)
%22 = trunc i64 %21 to i32
store i32 %22, i32* %2
%23 = load double, double* %7
%24 = fadd double %23, 5.000000e-01
%25 = call i64 @floor(double %24)
%26 = trunc i64 %25 to i32
store i32 %26, i32* %3
br label %27
27: ; preds = %5, %15
ret void
}