#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 */
float potencia(float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float base, expo, resp;
  do {
    printf("entre com a base: ");
    scanf("%f", &base);
  } while (base < 0);
  do {
    printf("entre com o espoente: ");
    scanf("%f", &expo);
  } while (expo < 0);
  resp = potencia(base, expo);
  printf("%.2f elevado a %.2f = %.2f ", base, expo, resp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
ja     113f <main+0xf>
jmp    116f <main+0x3f>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
ja     116f <main+0x3f>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1050 <potencia@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe5d(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%r14
lea    0xed0(%rip),%r15
lea    0x8(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
ucomiss 0x8(%rsp),%xmm0
ja     1150 <main+0x20>
lea    0xea4(%rip),%r14
lea    0xe9a(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
ja     1190 <main+0x60>
movss  0x8(%rsp),%xmm0
call   1050 <potencia@plt>
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm3
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm0,%xmm2
lea    0xe54(%rip),%rdi
movaps %xmm3,%xmm0
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"entre com a base: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [23 x i8] c"entre com o espoente: \00"
@.str.3 = [28 x i8] c"%.2f elevado a %.2f = %.2f \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
br label %5
5: ; preds = %8, %0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
br label %8
8: ; preds = %5
%9 = load float, float* %2
%10 = fcmp olt float %9, 0.000000e+00
br i1 %10, label %5, label %11
11: ; preds = %8
br label %12
12: ; preds = %15, %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
br label %15
15: ; preds = %12
%16 = load float, float* %3
%17 = fcmp olt float %16, 0.000000e+00
br i1 %17, label %12, label %18
18: ; preds = %15
%19 = load float, float* %2
%20 = load float, float* %3
%21 = call float @potencia(float %19, float %20)
store float %21, float* %4
%22 = load float, float* %2
%23 = fpext float %22 to double
%24 = load float, float* %3
%25 = fpext float %24 to double
%26 = load float, float* %4
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), double %23, double %25, double %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"entre com a base: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [23 x i8] c"entre com o espoente: \00"
@.str.3 = [28 x i8] c"%.2f elevado a %.2f = %.2f \00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
br label %5
5: ; preds = %5, %0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%8 = load float, float* %1
%9 = fcmp olt float %8, 0.000000e+00
br i1 %9, label %5, label %10
10: ; preds = %5, %10
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%13 = load float, float* %2
%14 = fcmp olt float %13, 0.000000e+00
br i1 %14, label %10, label %15
15: ; preds = %10
%16 = load float, float* %1
%17 = call float @potencia(float %16, float %13)
%18 = load float, float* %1
%19 = fpext float %18 to double
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = fpext float %17 to double
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), double %19, double %21, double %22)
ret i32 0
}