#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 cos(float);
int /*<<< orphan*/ printf(char *, float, float);
int /*<<< orphan*/ scanf(char *, float *, float *);
float sin(float);
int main() {
  float r, th, x, y;
  scanf("%f %f", &r, &th);
  x = r * cos(th / 180 * 3.1415926);
  y = r * sin(th / 180 * 3.1415926);
  printf("%f %f\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb6(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe8e(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe76(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe49(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe31(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <scanf@plt>
movss  0x10(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
divss  0xe8c(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe88(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1060 <cos@plt>
mulss  0x8(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0x10(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
movss  0xc(%rsp),%xmm0
divss  0xe51(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe4d(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <sin@plt>
movss  0x14(%rsp),%xmm1
mulss  %xmm0,%xmm1
lea    0xe41(%rip),%rdi
movss  0x8(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [7 x i8] c"%f %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %2, float* %3)
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fdiv float %8, 1.800000e+02
%10 = fpext float %9 to double
%11 = fmul double %10, 0x400921FB4D12D84A
%12 = fptrunc double %11 to float
%13 = call float @cos(float %12)
%14 = fmul float %7, %13
store float %14, float* %4
%15 = load float, float* %2
%16 = load float, float* %3
%17 = fdiv float %16, 1.800000e+02
%18 = fpext float %17 to double
%19 = fmul double %18, 0x400921FB4D12D84A
%20 = fptrunc double %19 to float
%21 = call float @sin(float %20)
%22 = fmul float %15, %21
store float %22, float* %5
%23 = load float, float* %4
%24 = load float, float* %5
%25 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %23, float %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [7 x i8] c"%f %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fdiv float %7, 1.800000e+02
%9 = fpext float %8 to double
%10 = fmul double %9, 0x400921FB4D12D84A
%11 = fptrunc double %10 to float
%12 = call float @cos(float %11)
%13 = fmul float %6, %12
%14 = load float, float* %1
%15 = load float, float* %2
%16 = fdiv float %15, 1.800000e+02
%17 = fpext float %16 to double
%18 = fmul double %17, 0x400921FB4D12D84A
%19 = fptrunc double %18 to float
%20 = call float @sin(float %19)
%21 = fmul float %14, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %13, float %21)
ret i32 0
}