#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 */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
float sqrt(int);
int /*<<< orphan*/ system(char *);
int main() {
  setlocale(LC_ALL, "Portuguese");
  int valor, quadrado, cubo;
  float raiz;
  printf("(NUMERO MAIOR QUE ZERO)\n\n");
  printf("Digite um valor:  ");
  scanf("%d", &valor);
  quadrado = valor * valor;
  printf("O número %d ao quadrado é: %d\n", valor, quadrado);
  cubo = valor * valor * valor;
  printf("O número %d ao cubo é: %d\n", valor, cubo);
  raiz = sqrt(valor);
  printf("A raiz quadrada de %d é: %f\n", valor, raiz);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1070 <sqrt@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%esi
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe80(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe90(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1060 <setlocale@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xe82(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe87(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%esi
mov    %esi,%edx
imul   %esi,%edx
lea    0xe70(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%esi
mov    %esi,%edx
imul   %esi,%edx
imul   %esi,%edx
lea    0xe77(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1080 <sqrt@plt>
mov    0x4(%rsp),%esi
cvtss2sd %xmm0,%xmm0
lea    0xe75(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe85(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [26 x i8] c"(NUMERO MAIOR QUE ZERO)\0A\0A\00"
@.str.2 = [19 x i8] c"Digite um valor: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [33 x i8] c"O n\C3\BAmero %d ao quadrado \C3\A9: %d\0A\00"
@.str.5 = [29 x i8] c"O n\C3\BAmero %d ao cubo \C3\A9: %d\0A\00"
@.str.6 = [30 x i8] c"A raiz quadrada de %d \C3\A9: %f\0A\00"
@.str.7 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = load i32, i32* @LC_ALL
%6 = call i32 @setlocale(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = load i32, i32* %1
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %2
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i32 %13, i32 %14)
%16 = load i32, i32* %1
%17 = load i32, i32* %1
%18 = mul nsw i32 %16, %17
%19 = load i32, i32* %1
%20 = mul nsw i32 %18, %19
store i32 %20, i32* %3
%21 = load i32, i32* %1
%22 = load i32, i32* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %21, i32 %22)
%24 = load i32, i32* %1
%25 = call float @sqrt(i32 %24)
store float %25, float* %4
%26 = load i32, i32* %1
%27 = load float, float* %4
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %26, double %28)
%30 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.2 = [19 x i8] c"Digite um valor: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [33 x i8] c"O n\C3\BAmero %d ao quadrado \C3\A9: %d\0A\00"
@.str.5 = [29 x i8] c"O n\C3\BAmero %d ao cubo \C3\A9: %d\0A\00"
@.str.6 = [30 x i8] c"A raiz quadrada de %d \C3\A9: %f\0A\00"
@.str.7 = [6 x i8] c"pause\00"
@str = [25 x i8] c"(NUMERO MAIOR QUE ZERO)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, %8
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* %1
%12 = mul nsw i32 %11, %11
%13 = mul nsw i32 %12, %11
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %11, i32 %13)
%15 = load i32, i32* %1
%16 = call float @sqrt(i32 %15)
%17 = load i32, i32* %1
%18 = fpext float %16 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %17, double %18)
%20 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}