#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 pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ system(char *);
int main() {
  setlocale(LC_ALL, "Portuguese");
  int elevado, numero1, numero2;
  printf("\t Obs:NUMEROS MAIORES QUE 0\n\n");
  printf("Digite um número: ");
  scanf("%d", &numero1);
  if (numero1 == 0 || numero1 < 0) {
    printf("Não podemos calcular com números negativo!\n");
  }
  printf("Digite outro: ");
  scanf("%d", &numero2);
  if (numero2 == 0 || numero2 < 0) {
    printf("Não podemos calcular com números negativos!\n");
  }
  elevado = pow(numero1, numero2);
  printf("%d elevado a %d é %d", numero1, numero2, elevado);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1050 <setlocale@plt>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf25(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
je     11b4 <main+0x64>
cmpl   $0x0,-0xc(%rbp)
jge    11c2 <main+0x72>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,-0x10(%rbp)
je     11f4 <main+0xa4>
cmpl   $0x0,-0x10(%rbp)
jge    1202 <main+0xb2>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1070 <pow@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe91(%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    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xe82(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jg     11b4 <main+0x54>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xe64(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe78(%rip),%rdi
mov    %rsp,%rsi
call   1070 <scanf@plt>
mov    (%rsp),%esi
test   %esi,%esi
jg     11e7 <main+0x87>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edi
call   1080 <pow@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe30(%rip),%rdi
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe36(%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 = [30 x i8] c"\09 Obs:NUMEROS MAIORES QUE 0\0A\0A\00"
@.str.2 = [20 x i8] c"Digite um n\C3\BAmero: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [46 x i8] c"N\C3\A3o podemos calcular com n\C3\BAmeros negativo!\0A\00"
@.str.5 = [15 x i8] c"Digite outro: \00"
@.str.6 = [47 x i8] c"N\C3\A3o podemos calcular com n\C3\BAmeros negativos!\0A\00"
@.str.7 = [22 x i8] c"%d elevado a %d \C3\A9 %d\00"
@.str.8 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%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 ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 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* %3)
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %0
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12, %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %17
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22, %17
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = call i32 @pow(i32 %28, i32 %29)
store i32 %30, i32* %2
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = load i32, i32* %2
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %31, i32 %32, i32 %33)
%35 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.2 = [20 x i8] c"Digite um n\C3\BAmero: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.5 = [15 x i8] c"Digite outro: \00"
@.str.7 = [22 x i8] c"%d elevado a %d \C3\A9 %d\00"
@.str.8 = [6 x i8] c"pause\00"
@str = [29 x i8] c"\09 Obs:NUMEROS MAIORES QUE 0\0A\00"
@str.9 = [46 x i8] c"N\C3\A3o podemos calcular com n\C3\BAmeros negativos!\00"
@str.10 = [45 x i8] c"N\C3\A3o podemos calcular com n\C3\BAmeros negativo!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @LC_ALL
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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 = icmp slt i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.10, i64 0, i64 0))
br label %14
14: ; preds = %0, %12
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 1
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.9, i64 0, i64 0))
%21 = load i32, i32* %2
br label %22
22: ; preds = %14, %19
%23 = phi i32 [ %17, %14 ], [ %21, %19 ]
%24 = load i32, i32* %1
%25 = call i32 @pow(i32 %24, i32 %23)
%26 = load i32, i32* %1
%27 = load i32, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %26, i32 %27, i32 %25)
%29 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}