#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 */
double atan2(double, double);
int /*<<< orphan*/ printf(char *, double, double);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, double *, double *);
double sqrt(double);
int main() {
  double x = 0.0, y = 0.0;
  puts("Ներածիր դեկարտյան կոորդինատները x,y․ ");
  scanf("%lf,%lf", &x, &y);
  double rho = sqrt(x * x + y * y);
  double phi = atan2(y, x);
  puts("Բևեռային կոորդնատներն են․ ");
  printf("ρ = %lf, φ = %lf\n", rho, phi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <atan2@plt>
movsd  %xmm0,-0x28(%rbp)
lea    0xe7d(%rip),%rdi
call   1030 <puts@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11b0 <main+0x60>
sqrtsd %xmm0,%xmm0
jmp    11b5 <main+0x65>
call   1070 <sqrt@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <atan2@plt>
movsd  %xmm0,0x20(%rsp)
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9b(%rip),%rdi
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [69 x i8] c"\D5\86\D5\A5\D6\80\D5\A1\D5\AE\D5\AB\D6\80 \D5\A4\D5\A5\D5\AF\D5\A1\D6\80\D5\BF\D5\B5\D5\A1\D5\B6 \D5\AF\D5\B8\D5\B8\D6\80\D5\A4\D5\AB\D5\B6\D5\A1\D5\BF\D5\B6\D5\A5\D6\80\D5\A8 x,y\E2\80\A4 \00"
@.str.1 = [8 x i8] c"%lf,%lf\00"
@.str.2 = [51 x i8] c"\D4\B2\D6\87\D5\A5\D5\BC\D5\A1\D5\B5\D5\AB\D5\B6 \D5\AF\D5\B8\D5\B8\D6\80\D5\A4\D5\B6\D5\A1\D5\BF\D5\B6\D5\A5\D6\80\D5\B6 \D5\A5\D5\B6\E2\80\A4 \00"
@.str.3 = [20 x i8] c"\CF\81 = %lf, \CF\86 = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
%6 = call i32 @puts(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3)
%8 = load double, double* %2
%9 = load double, double* %2
%10 = load double, double* %3
%11 = load double, double* %3
%12 = fmul double %10, %11
%13 = call double @llvm.fmuladd.f64(double %8, double %9, double %12)
%14 = call double @sqrt(double %13)
store double %14, double* %4
%15 = load double, double* %3
%16 = load double, double* %2
%17 = call double @atan2(double %15, double %16)
store double %17, double* %5
%18 = call i32 @puts(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%19 = load double, double* %4
%20 = load double, double* %5
%21 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %19, double %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [69 x i8] c"\D5\86\D5\A5\D6\80\D5\A1\D5\AE\D5\AB\D6\80 \D5\A4\D5\A5\D5\AF\D5\A1\D6\80\D5\BF\D5\B5\D5\A1\D5\B6 \D5\AF\D5\B8\D5\B8\D6\80\D5\A4\D5\AB\D5\B6\D5\A1\D5\BF\D5\B6\D5\A5\D6\80\D5\A8 x,y\E2\80\A4 \00"
@.str.1 = [8 x i8] c"%lf,%lf\00"
@.str.2 = [51 x i8] c"\D4\B2\D6\87\D5\A5\D5\BC\D5\A1\D5\B5\D5\AB\D5\B6 \D5\AF\D5\B8\D5\B8\D6\80\D5\A4\D5\B6\D5\A1\D5\BF\D5\B6\D5\A5\D6\80\D5\B6 \D5\A5\D5\B6\E2\80\A4 \00"
@.str.3 = [20 x i8] c"\CF\81 = %lf, \CF\86 = %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%4 = bitcast double* %2 to i8*
store double 0.000000e+00, double* %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2)
%7 = load double, double* %1
%8 = load double, double* %2
%9 = fmul double %8, %8
%10 = call double @llvm.fmuladd.f64(double %7, double %7, double %9)
%11 = call double @sqrt(double %10)
%12 = load double, double* %2
%13 = load double, double* %1
%14 = call double @atan2(double %12, double %13)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %11, double %14)
ret i32 0
}