#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*/ printf(char *, ...);
int main() {
  printf("\tPotencias de 2\n");
  int i = 1, temp, j;
  printf("\tPot.| Resultado\n");
  printf("\t  0 |           1\n");
  while (i < 32) {
    temp = 2;
    j = 1;
    while (j < i) {
      temp *= 2;
      j++;
    }
    printf("\t %2d | %11d\n", i, temp);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x20,-0x8(%rbp)
jge    11ad <main+0x9d>
movl   $0x2,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    118b <main+0x7b>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1168 <main+0x58>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
lea    0xeab(%rip),%r14
xor    %r15d,%r15d
jmp    1178 <main+0x58>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
add    $0x1,%r15d
cmp    $0x20,%ebx
je     11c9 <main+0xa9>
mov    $0x2,%edx
cmp    $0x2,%ebx
jb     1160 <main+0x40>
lea    -0x1(%r15),%eax
mov    $0x2,%edx
cmp    $0x7,%eax
jb     11a8 <main+0x88>
mov    %r15d,%eax
and    $0xfffffff8,%eax
mov    $0x2,%edx
nopl   0x0(%rax,%rax,1)
shl    $0x8,%edx
add    $0xfffffff8,%eax
jne    11a0 <main+0x80>
test   $0x7,%r15b
je     1160 <main+0x40>
mov    %r15d,%eax
and    $0x7,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %edx,%edx
add    $0xffffffff,%eax
jne    11c0 <main+0xa0>
jmp    1160 <main+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\09Potencias de 2\0A\00"
@.str.1 = [18 x i8] c"\09Pot.| Resultado\0A\00"
@.str.2 = [20 x i8] c"\09 0 | 1\0A\00"
@.str.3 = [14 x i8] c"\09 %2d | %11d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %21, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 32
br i1 %10, label %11, label %27
11: ; preds = %8
store i32 2, i32* %3
store i32 1, i32* %4
br label %12
12: ; preds = %16, %11
%13 = load i32, i32* %4
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i32, i32* %3
%18 = mul nsw i32 %17, 2
store i32 %18, i32* %3
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %12
21: ; preds = %12
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %22, i32 %23)
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %8
27: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [14 x i8] c"\09 %2d | %11d\0A\00"
@str = [16 x i8] c"\09Potencias de 2\00"
@str.4 = [17 x i8] c"\09Pot.| Resultado\00"
@str.5 = [19 x i8] c"\09 0 | 1\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
br label %4
4: ; preds = %0, %30
%5 = phi i32 [ 0, %0 ], [ %35, %30 ]
%6 = phi i32 [ 1, %0 ], [ %33, %30 ]
%7 = icmp ugt i32 %6, 1
br i1 %7, label %8, label %30
8: ; preds = %4
%9 = add i32 %5, -1
%10 = and i32 %5, 7
%11 = icmp ult i32 %9, 7
br i1 %11, label %20, label %12
12: ; preds = %8
%13 = and i32 %5, -8
br label %14
14: ; preds = %14, %12
%15 = phi i32 [ 2, %12 ], [ %17, %14 ]
%16 = phi i32 [ 0, %12 ], [ %18, %14 ]
%17 = shl i32 %15, 8
%18 = add i32 %16, 8
%19 = icmp eq i32 %18, %13
br i1 %19, label %20, label %14
20: ; preds = %14, %8
%21 = phi i32 [ undef, %8 ], [ %17, %14 ]
%22 = phi i32 [ 2, %8 ], [ %17, %14 ]
%23 = icmp eq i32 %10, 0
br i1 %23, label %30, label %24
24: ; preds = %20, %24
%25 = phi i32 [ %27, %24 ], [ %22, %20 ]
%26 = phi i32 [ %28, %24 ], [ 0, %20 ]
%27 = shl nsw i32 %25, 1
%28 = add i32 %26, 1
%29 = icmp eq i32 %28, %10
br i1 %29, label %30, label %24
30: ; preds = %20, %24, %4
%31 = phi i32 [ 2, %4 ], [ %21, %20 ], [ %27, %24 ]
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %6, i32 %31)
%33 = add nuw nsw i32 %6, 1
%34 = icmp eq i32 %33, 32
%35 = add i32 %5, 1
br i1 %34, label %36, label %4
36: ; preds = %30
ret i32 0
}