#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 first_angle(double, double, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
double second_angle(double, double);
int /*<<< orphan*/ todegree(double);
int main() {
  double x, y;
  printf("Introduce x: ");
  scanf("%lf", &x);
  printf("Introduce y: ");
  scanf("%lf", &y);
  double sec_angle = second_angle(x, y);
  double fir_angle = first_angle(x, y, sec_angle);
  printf("angle 1 is %lf\n", todegree(fir_angle));
  printf("angle 2 is %lf\n", todegree(sec_angle));
  if (fir_angle <= 180.0 && sec_angle <= 180.0)
    printf("Position is legal\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1070 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <second_angle@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1060 <first_angle@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <todegree@plt>
mov    %eax,%esi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
call   1050 <todegree@plt>
mov    %eax,%esi
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  0xdfc(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     1230 <main+0xe0>
movsd  0xde9(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1230 <main+0xe0>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9c(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <second_angle@plt>
movaps %xmm0,%xmm2
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1070 <first_angle@plt>
movsd  %xmm0,0x18(%rsp)
call   1060 <todegree@plt>
lea    0xe4a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
call   1060 <todegree@plt>
lea    0xe40(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsd  0xdf7(%rip),%xmm0
ucomisd (%rsp),%xmm0
jb     1224 <main+0xc4>
ucomisd 0x18(%rsp),%xmm0
jb     1224 <main+0xc4>
lea    0xe29(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Introduce x: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [14 x i8] c"Introduce y: \00"
@.str.3 = [16 x i8] c"angle 1 is %lf\0A\00"
@.str.4 = [16 x i8] c"angle 2 is %lf\0A\00"
@.str.5 = [19 x i8] c"Position is legal\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
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%10 = load double, double* %2
%11 = load double, double* %3
%12 = call double @second_angle(double %10, double %11)
store double %12, double* %4
%13 = load double, double* %2
%14 = load double, double* %3
%15 = load double, double* %4
%16 = call double @first_angle(double %13, double %14, double %15)
store double %16, double* %5
%17 = load double, double* %5
%18 = call i32 @todegree(double %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = load double, double* %4
%21 = call i32 @todegree(double %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = load double, double* %5
%24 = fcmp ole double %23, 1.800000e+02
br i1 %24, label %25, label %30
25: ; preds = %0
%26 = load double, double* %4
%27 = fcmp ole double %26, 1.800000e+02
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
br label %30
30: ; preds = %28, %25, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Introduce x: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [14 x i8] c"Introduce y: \00"
@.str.3 = [16 x i8] c"angle 1 is %lf\0A\00"
@.str.4 = [16 x i8] c"angle 2 is %lf\0A\00"
@str = [18 x i8] c"Position is legal\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%9 = load double, double* %1
%10 = load double, double* %2
%11 = call double @second_angle(double %9, double %10)
%12 = load double, double* %1
%13 = load double, double* %2
%14 = call double @first_angle(double %12, double %13, double %11)
%15 = call i32 @todegree(double %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = call i32 @todegree(double %11)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = fcmp ole double %14, 1.800000e+02
%20 = fcmp ole double %11, 1.800000e+02
%21 = and i1 %20, %19
br i1 %21, label %22, label %24
22: ; preds = %0
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %24
24: ; preds = %22, %0
ret i32 0
}