#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 M_PI;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
double sin(double);
int main(int argc, char *argv[]) {
  double edge1, edge2, angle, radian, area;
  scanf("%lf", &edge1);
  scanf("%lf", &edge2);
  scanf("%lf", &angle);
  if (angle == 90)
    if (edge1 == edge2)
      printf("This is square\n");
    else
      printf("This is rectangle\n");
  else if (edge1 == edge2)
    printf("This is diamond\n");
  else
    printf("This is parallelogram\n");
  radian = angle * M_PI / 180;
  area = edge1 * edge2 * sin(radian);
  printf("%.2lf\n", area);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea3(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  0xe7d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11cf <main+0x9f>
jp     11cf <main+0x9f>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    11bc <main+0x8c>
jp     11bc <main+0x8c>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ca <main+0x9a>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120b <main+0xdb>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    11f8 <main+0xc8>
jp     11f8 <main+0xc8>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1206 <main+0xd6>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120b <main+0xdb>
movsd  -0x28(%rbp),%xmm0
mov    0x2dd1(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xde5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xdfd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movsd  0x10(%rsp),%xmm0
ucomisd 0x8(%rsp),%xmm0
lea    0xebd(%rip),%rax
lea    0xec8(%rip),%rdi
cmovne %rax,%rdi
cmovp  %rax,%rdi
lea    0xe81(%rip),%rax
lea    0xe90(%rip),%rcx
cmovne %rax,%rcx
cmovp  %rax,%rcx
movsd  (%rsp),%xmm0
ucomisd 0xe4a(%rip),%xmm0
cmovne %rcx,%rdi
cmovp  %rcx,%rdi
call   1030 <puts@plt>
movsd  (%rsp),%xmm0
mov    0x2e19(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xe2d(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x18(%rsp)
call   1050 <sin@plt>
mulsd  0x18(%rsp),%xmm0
lea    0xe15(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"This is square\0A\00"
@.str.2 = [19 x i8] c"This is rectangle\0A\00"
@.str.3 = [17 x i8] c"This is diamond\0A\00"
@.str.4 = [23 x i8] c"This is parallelogram\0A\00"
@M_PI = global double 0.000000e+00
@.str.5 = [7 x i8] c"%.2lf\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
%10 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %8)
%14 = load double, double* %8
%15 = fcmp oeq double %14, 9.000000e+01
br i1 %15, label %16, label %25
16: ; preds = %2
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fcmp oeq double %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %24
22: ; preds = %16
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
br label %34
25: ; preds = %2
%26 = load double, double* %6
%27 = load double, double* %7
%28 = fcmp oeq double %26, %27
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %33
31: ; preds = %25
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
br label %34
34: ; preds = %33, %24
%35 = load double, double* %8
%36 = load double, double* @M_PI
%37 = fmul double %35, %36
%38 = fdiv double %37, 1.800000e+02
store double %38, double* %9
%39 = load double, double* %6
%40 = load double, double* %7
%41 = fmul double %39, %40
%42 = load double, double* %9
%43 = call double @sin(double %42)
%44 = fmul double %41, %43
store double %44, double* %10
%45 = load double, double* %10
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %45)
%47 = load i32, i32* %3
ret i32 %47
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@M_PI = global double 0.000000e+00
@.str.5 = [7 x i8] c"%.2lf\0A\00"
@str = [22 x i8] c"This is parallelogram\00"
@str.6 = [16 x i8] c"This is diamond\00"
@str.7 = [18 x i8] c"This is rectangle\00"
@str.8 = [15 x i8] c"This is square\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %3 to i8*
%7 = bitcast double* %4 to i8*
%8 = bitcast double* %5 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %5)
%12 = load double, double* %5
%13 = fcmp oeq double %12, 9.000000e+01
%14 = load double, double* %3
%15 = load double, double* %4
%16 = fcmp oeq double %14, %15
%17 = select i1 %16, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.7, i64 0, i64 0)
%18 = select i1 %16, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0)
%19 = select i1 %13, i8* %17, i8* %18
%20 = call i32 @puts(i8* dereferenceable(1) %19)
%21 = load double, double* %5
%22 = load double, double* @M_PI
%23 = fmul double %21, %22
%24 = fdiv double %23, 1.800000e+02
%25 = load double, double* %3
%26 = load double, double* %4
%27 = fmul double %25, %26
%28 = call double @sin(double %24)
%29 = fmul double %27, %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %29)
ret i32 0
}