#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);
double atof(char *);
int /*<<< orphan*/ printf(char *, ...);
double sqrt(double);
int main(int argc, char **argv) {
  double x = atof(argv[1]);
  double y = atof(argv[2]);
  double rho = sqrt(x * x + y * y);
  double phi = atan2(y, x);
  printf("Բևեռային կոորդնատներն են․ ");
  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)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <atan2@plt>
movsd  %xmm0,-0x30(%rbp)
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    0xe60(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    0x10(%rbx),%rdi
call   1030 <atof@plt>
movapd %xmm0,%xmm2
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     118a <main+0x4a>
sqrtsd %xmm0,%xmm0
jmp    119b <main+0x5b>
movsd  %xmm2,0x18(%rsp)
call   1060 <sqrt@plt>
movsd  0x18(%rsp),%xmm2
movsd  %xmm0,0x10(%rsp)
movapd %xmm2,%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <atan2@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xe43(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe68(%rip),%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [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.1 = [20 x i8] c"\CF\81 = %lf, \CF\86 = %lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call double @atof(i8* %12)
store double %13, double* %6
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call double @atof(i8* %16)
store double %17, double* %7
%18 = load double, double* %6
%19 = load double, double* %6
%20 = load double, double* %7
%21 = load double, double* %7
%22 = fmul double %20, %21
%23 = call double @llvm.fmuladd.f64(double %18, double %19, double %22)
%24 = call double @sqrt(double %23)
store double %24, double* %8
%25 = load double, double* %7
%26 = load double, double* %6
%27 = call double @atan2(double %25, double %26)
store double %27, double* %9
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%29 = load double, double* %8
%30 = load double, double* %9
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %29, double %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [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.1 = [20 x i8] c"\CF\81 = %lf, \CF\86 = %lf\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call double @atof(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call double @atof(i8* %7)
%9 = fmul double %8, %8
%10 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %9)
%11 = tail call double @sqrt(double %10)
%12 = tail call double @atan2(double %8, double %5)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %11, double %12)
ret i32 0
}