#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 atof(char *);
int /*<<< orphan*/ printf(char *, double, double);
double radius(double, double);
double theta(double, double);
int main(int argc, char **argv) {
  double x, y;
  double r, t;
  if (argc == 3 && (x = atof(argv[1])) && (y = atof(argv[2]))) {
    r = radius(x, y);
    t = theta(x, y);
    printf("r: %f, t: %f\n", r, t);
  }
  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)
cmpl   $0x3,-0x8(%rbp)
jne    11f2 <main+0xb2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    118a <main+0x4a>
jp     118a <main+0x4a>
jmp    11f2 <main+0xb2>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b4 <main+0x74>
jp     11b4 <main+0x74>
jmp    11f2 <main+0xb2>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1060 <radius@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1050 <theta@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    0xe13(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
cmp    $0x3,%edi
jne    11bf <main+0x7f>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
xorpd  %xmm1,%xmm1
movsd  %xmm0,0x8(%rsp)
ucomisd %xmm1,%xmm0
jne    1168 <main+0x28>
jnp    11bf <main+0x7f>
mov    0x10(%rbx),%rdi
call   1030 <atof@plt>
ucomisd 0xe87(%rip),%xmm0
jne    117d <main+0x3d>
jnp    11bf <main+0x7f>
movapd %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
movsd  %xmm1,0x10(%rsp)
call   1060 <radius@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1050 <theta@plt>
movapd %xmm0,%xmm1
lea    0xe54(%rip),%rdi
movsd  0x18(%rsp),%xmm0
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"r: %f, t: %f\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 i32, i32* %4
%11 = icmp eq i32 %10, 3
br i1 %11, label %12, label %34
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call double @atof(i8* %15)
store double %16, double* %6
%17 = fcmp une double %16, 0.000000e+00
br i1 %17, label %18, label %34
18: ; preds = %12
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = call double @atof(i8* %21)
store double %22, double* %7
%23 = fcmp une double %22, 0.000000e+00
br i1 %23, label %24, label %34
24: ; preds = %18
%25 = load double, double* %6
%26 = load double, double* %7
%27 = call double @radius(double %25, double %26)
store double %27, double* %8
%28 = load double, double* %6
%29 = load double, double* %7
%30 = call double @theta(double %28, double %29)
store double %30, double* %9
%31 = load double, double* %8
%32 = load double, double* %9
%33 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %31, double %32)
br label %34
34: ; preds = %24, %18, %12, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"r: %f, t: %f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call double @atof(i8* %6)
%8 = fcmp une double %7, 0.000000e+00
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call double @atof(i8* %11)
%13 = fcmp une double %12, 0.000000e+00
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = tail call double @radius(double %7, double %12)
%16 = tail call double @theta(double %7, double %12)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %15, double %16)
br label %18
18: ; preds = %14, %9, %4, %2
ret i32 0
}