#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 arctan(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(int argc, const char *argv[]) {
  float valor;
  printf("digite o valor\n");
  scanf("%f", &valor);
  if (valor >= 0 && valor <= 1) {
    printf("o resultado é :%f\n", arctan(valor));
  } else {
    printf("o valor é invalido\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     11a4 <main+0x74>
movss  0xe83(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jb     11a4 <main+0x74>
movss  -0x14(%rbp),%xmm0
call   1030 <arctan@plt>
lea    0xe7f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11b2 <main+0x82>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     118e <main+0x4e>
movss  0xe8c(%rip),%xmm1
ucomiss %xmm0,%xmm1
jb     118e <main+0x4e>
call   1040 <arctan@plt>
lea    0xe82(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    119a <main+0x5a>
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"digite o valor\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [20 x i8] c"o resultado \C3\A9 :%f\0A\00"
@.str.3 = [21 x i8] c"o valor \C3\A9 invalido\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
%9 = load float, float* %6
%10 = fcmp oge float %9, 0.000000e+00
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load float, float* %6
%13 = fcmp ole float %12, 1.000000e+00
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load float, float* %6
%16 = call double @arctan(float %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %16)
br label %20
18: ; preds = %11, %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [20 x i8] c"o resultado \C3\A9 :%f\0A\00"
@str = [15 x i8] c"digite o valor\00"
@str.4 = [20 x i8] c"o valor \C3\A9 invalido\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 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 = load float, float* %3
%8 = fcmp oge float %7, 0.000000e+00
%9 = fcmp ole float %7, 1.000000e+00
%10 = and i1 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call double @arctan(float %7)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %12)
br label %16
14: ; preds = %2
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
br label %16
16: ; preds = %14, %11
ret i32 0
}