#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 potencia(int, int);
int main(int argc, char const *argv[]) {
  int b = 2;
  int e = 5;
  int i;
  int resultado = potencia(b, e);
  potencia(2, 3);
  potencia(5, 3);
  for (i = 0; i <= 10; i++) {
    potencia(2, i);
  }
  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)
movl   $0x2,-0x14(%rbp)
movl   $0x5,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <potencia@plt>
mov    %eax,-0x20(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <potencia@plt>
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <potencia@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jg     118c <main+0x7c>
mov    -0x1c(%rbp),%esi
mov    $0x2,%edi
call   1030 <potencia@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1167 <main+0x57>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x5,%esi
call   1030 <potencia@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <potencia@plt>
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <potencia@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <potencia@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <potencia@plt>
mov    $0x2,%edi
mov    $0x2,%esi
call   1030 <potencia@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <potencia@plt>
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <potencia@plt>
mov    $0x2,%edi
mov    $0x5,%esi
call   1030 <potencia@plt>
mov    $0x2,%edi
mov    $0x6,%esi
call   1030 <potencia@plt>
mov    $0x2,%edi
mov    $0x7,%esi
call   1030 <potencia@plt>
mov    $0x2,%edi
mov    $0x8,%esi
call   1030 <potencia@plt>
mov    $0x2,%edi
mov    $0x9,%esi
call   1030 <potencia@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <potencia@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %6
store i32 5, i32* %7
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @potencia(i32 %10, i32 %11)
store i32 %12, i32* %9
%13 = call i32 @potencia(i32 2, i32 3)
%14 = call i32 @potencia(i32 5, i32 3)
store i32 0, i32* %8
br label %15
15: ; preds = %21, %2
%16 = load i32, i32* %8
%17 = icmp sle i32 %16, 10
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = load i32, i32* %8
%20 = call i32 @potencia(i32 2, i32 %19)
br label %21
21: ; preds = %18
%22 = load i32, i32* %8
%23 = add nsw i32 %22, 1
store i32 %23, i32* %8
br label %15
24: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @potencia(i32 2, i32 5)
%4 = tail call i32 @potencia(i32 2, i32 3)
%5 = tail call i32 @potencia(i32 5, i32 3)
%6 = tail call i32 @potencia(i32 2, i32 0)
%7 = tail call i32 @potencia(i32 2, i32 1)
%8 = tail call i32 @potencia(i32 2, i32 2)
%9 = tail call i32 @potencia(i32 2, i32 3)
%10 = tail call i32 @potencia(i32 2, i32 4)
%11 = tail call i32 @potencia(i32 2, i32 5)
%12 = tail call i32 @potencia(i32 2, i32 6)
%13 = tail call i32 @potencia(i32 2, i32 7)
%14 = tail call i32 @potencia(i32 2, i32 8)
%15 = tail call i32 @potencia(i32 2, i32 9)
%16 = tail call i32 @potencia(i32 2, i32 10)
ret i32 0
}