#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 alfa(float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float radiandos = 180, x, y;
  printf("Digite um valor para o x \n");
  scanf("%f", &x);
  printf("Digie um valor para o y \n");
  scanf("%f", &y);
  if (x == 0 && y == 0) {
    printf("O valor digitado é invalido");
  } else {
    if (x >= 0 && y >= 0) {
      printf("O valor é %f\n", alfa(x, y));
    } else {
      printf("O valor digitado é invalido");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11c9 <main+0x99>
jp     11c9 <main+0x99>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11c9 <main+0x99>
jp     11c9 <main+0x99>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1220 <main+0xf0>
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     120d <main+0xdd>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     120d <main+0xdd>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1050 <alfa@plt>
lea    0xe58(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    121b <main+0xeb>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1220 <main+0xf0>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
movss  0x8(%rsp),%xmm1
jne    119b <main+0x5b>
jp     119b <main+0x5b>
ucomiss %xmm2,%xmm1
jne    119b <main+0x5b>
jnp    11bd <main+0x7d>
ucomiss %xmm2,%xmm0
jb     11bd <main+0x7d>
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jb     11bd <main+0x7d>
call   1060 <alfa@plt>
lea    0xe6c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11cb <main+0x8b>
lea    0xe3f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Digite um valor para o x \0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [26 x i8] c"Digie um valor para o y \0A\00"
@.str.3 = [29 x i8] c"O valor digitado \C3\A9 invalido\00"
@.str.4 = [15 x i8] c"O valor \C3\A9 %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store float 1.800000e+02, float* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%9 = load float, float* %3
%10 = fcmp oeq float %9, 0.000000e+00
br i1 %10, label %11, label %16
11: ; preds = %0
%12 = load float, float* %4
%13 = fcmp oeq float %12, 0.000000e+00
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %30
16: ; preds = %11, %0
%17 = load float, float* %3
%18 = fcmp oge float %17, 0.000000e+00
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load float, float* %4
%21 = fcmp oge float %20, 0.000000e+00
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load float, float* %3
%24 = load float, float* %4
%25 = call double @alfa(float %23, float %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %25)
br label %29
27: ; preds = %19, %16
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %29
29: ; preds = %27, %22
br label %30
30: ; preds = %29, %14
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [29 x i8] c"O valor digitado \C3\A9 invalido\00"
@.str.4 = [15 x i8] c"O valor \C3\A9 %f\0A\00"
@str = [26 x i8] c"Digite um valor para o x \00"
@str.5 = [25 x i8] c"Digie um valor para o y \00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.5, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = load float, float* %1
%10 = fcmp oeq float %9, 0.000000e+00
%11 = load float, float* %2
%12 = fcmp oeq float %11, 0.000000e+00
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %25
16: ; preds = %0
%17 = fcmp oge float %9, 0.000000e+00
%18 = fcmp oge float %11, 0.000000e+00
%19 = select i1 %17, i1 %18, i1 false
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = call double @alfa(float %9, float %11)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %21)
br label %25
23: ; preds = %16
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %20, %23, %14
ret i32 0
}