#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int n1 = 0, n2 = 0, i = 0, resultado = 1;
  char linea[180];
  printf("Intruduce el primer numero entero: ");
  fgets(linea, 180, stdin);
  sscanf(linea, "%d", &n1);
  printf("Intruduce el segundo numero entero: ");
  fgets(linea, 180, stdin);
  sscanf(linea, "%d", &n2);
  while (i < n2) {
    resultado = resultado * n1;
    i++;
  }
  printf("\nEl resultado de %d elevado a %d es: %d", n1, n2, resultado);
  printf("\nPulsa Cuanquier tecla para terminar: ");
  fgets(linea, 180, stdin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
mov    0x2e67(%rip),%rax
mov    (%rax),%edx
mov    $0xb4,%esi
call   1040 <fgets@plt>
lea    -0xe0(%rbp),%rdi
lea    0xed3(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
mov    0x2e28(%rip),%rax
mov    (%rax),%edx
mov    $0xb4,%esi
call   1040 <fgets@plt>
lea    -0xe0(%rbp),%rdi
lea    0xe94(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1207 <main+0xd7>
mov    -0x20(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e3 <main+0xb3>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
mov    0x2dae(%rip),%rax
mov    (%rax),%edx
mov    $0xb4,%esi
call   1040 <fgets@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xc8,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xebb(%rip),%rdi
xor    %r12d,%r12d
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e82(%rip),%r15
mov    (%r15),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xb4,%esi
call   1040 <fgets@plt>
lea    0xefc(%rip),%r14
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <sscanf@plt>
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0xb4,%esi
call   1040 <fgets@plt>
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <sscanf@plt>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%esi
mov    $0x1,%ecx
test   %edx,%edx
jle    1388 <main+0x258>
cmp    $0x8,%edx
jb     136c <main+0x23c>
mov    %edx,%r12d
and    $0xfffffff8,%r12d
movd   %esi,%xmm0
pshufd $0x0,%xmm0,%xmm0
lea    -0x8(%r12),%edi
mov    %edi,%ecx
shr    $0x3,%ecx
add    $0x1,%ecx
mov    %ecx,%eax
and    $0x7,%eax
pshufd $0xf5,%xmm0,%xmm1
cmp    $0x38,%edi
jae    121b <main+0xeb>
movdqa 0xdee(%rip),%xmm3
movdqa %xmm3,%xmm2
jmp    12df <main+0x1af>
and    $0xfffffff8,%ecx
movdqa 0xdda(%rip),%xmm3
movdqa %xmm3,%xmm2
nopw   0x0(%rax,%rax,1)
pshufd $0xf5,%xmm3,%xmm5
pmuludq %xmm1,%xmm5
pmuludq %xmm0,%xmm3
pshufd $0xf5,%xmm2,%xmm4
pmuludq %xmm1,%xmm4
pmuludq %xmm0,%xmm2
pmuludq %xmm0,%xmm3
pmuludq %xmm1,%xmm5
pmuludq %xmm0,%xmm2
pmuludq %xmm1,%xmm4
pmuludq %xmm1,%xmm5
pmuludq %xmm0,%xmm3
pmuludq %xmm1,%xmm4
pmuludq %xmm0,%xmm2
pmuludq %xmm0,%xmm3
pmuludq %xmm1,%xmm5
pmuludq %xmm0,%xmm2
pmuludq %xmm1,%xmm4
pmuludq %xmm1,%xmm5
pmuludq %xmm0,%xmm3
pmuludq %xmm1,%xmm4
pmuludq %xmm0,%xmm2
pmuludq %xmm0,%xmm3
pmuludq %xmm1,%xmm5
pmuludq %xmm0,%xmm2
pmuludq %xmm1,%xmm4
pmuludq %xmm1,%xmm5
pmuludq %xmm0,%xmm3
pmuludq %xmm1,%xmm4
pmuludq %xmm0,%xmm2
pmuludq %xmm0,%xmm3
pshufd $0xe8,%xmm3,%xmm3
pmuludq %xmm1,%xmm5
pshufd $0xe8,%xmm5,%xmm5
punpckldq %xmm5,%xmm3
pmuludq %xmm0,%xmm2
pshufd $0xe8,%xmm2,%xmm2
pmuludq %xmm1,%xmm4
pshufd $0xe8,%xmm4,%xmm4
punpckldq %xmm4,%xmm2
add    $0xfffffff8,%ecx
jne    1230 <main+0x100>
movdqa %xmm3,%xmm4
movdqa %xmm2,%xmm5
test   %eax,%eax
je     133b <main+0x20b>
nopl   0x0(%rax,%rax,1)
movdqa %xmm0,%xmm4
pmuludq %xmm3,%xmm4
pshufd $0xe8,%xmm4,%xmm4
pshufd $0xf5,%xmm3,%xmm3
pmuludq %xmm1,%xmm3
pshufd $0xe8,%xmm3,%xmm3
punpckldq %xmm3,%xmm4
movdqa %xmm0,%xmm3
pmuludq %xmm2,%xmm3
pshufd $0xe8,%xmm3,%xmm5
pshufd $0xf5,%xmm2,%xmm2
pmuludq %xmm1,%xmm2
pshufd $0xe8,%xmm2,%xmm2
punpckldq %xmm2,%xmm5
movdqa %xmm4,%xmm3
movdqa %xmm5,%xmm2
add    $0xffffffff,%eax
jne    12f0 <main+0x1c0>
pshufd $0xf5,%xmm4,%xmm0
pshufd $0xf5,%xmm5,%xmm1
pmuludq %xmm0,%xmm1
pmuludq %xmm4,%xmm5
pshufd $0xee,%xmm5,%xmm0
pmuludq %xmm5,%xmm0
pshufd $0xaa,%xmm1,%xmm2
pmuludq %xmm1,%xmm2
pmuludq %xmm0,%xmm2
movd   %xmm2,%ecx
cmp    %r12d,%edx
je     1388 <main+0x258>
mov    %edx,%eax
sub    %r12d,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %esi,%ecx
add    $0xffffffff,%eax
jne    1380 <main+0x250>
lea    0xcca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xce4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%r15),%edx
lea    0x10(%rsp),%rdi
mov    $0xb4,%esi
call   1040 <fgets@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Intruduce el primer numero entero: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"Intruduce el segundo numero entero: \00"
@.str.3 = [40 x i8] c"\0AEl resultado de %d elevado a %d es: %d\00"
@.str.4 = [39 x i8] c"\0APulsa Cuanquier tecla para terminar: \00"
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
%10 = alloca [180 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 1, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [180 x i8], [180 x i8]* %10, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i32 @fgets(i8* %12, i32 180, i32 %13)
%15 = getelementptr inbounds [180 x i8], [180 x i8]* %10, i64 0, i64 0
%16 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%18 = getelementptr inbounds [180 x i8], [180 x i8]* %10, i64 0, i64 0
%19 = load i32, i32* @stdin
%20 = call i32 @fgets(i8* %18, i32 180, i32 %19)
%21 = getelementptr inbounds [180 x i8], [180 x i8]* %10, i64 0, i64 0
%22 = call i32 @sscanf(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
br label %23
23: ; preds = %27, %2
%24 = load i32, i32* %8
%25 = load i32, i32* %7
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %33
27: ; preds = %23
%28 = load i32, i32* %9
%29 = load i32, i32* %6
%30 = mul nsw i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %8
%32 = add nsw i32 %31, 1
store i32 %32, i32* %8
br label %23
33: ; preds = %23
%34 = load i32, i32* %6
%35 = load i32, i32* %7
%36 = load i32, i32* %9
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 %34, i32 %35, i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%39 = getelementptr inbounds [180 x i8], [180 x i8]* %10, i64 0, i64 0
%40 = load i32, i32* @stdin
%41 = call i32 @fgets(i8* %39, i32 180, i32 %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Intruduce el primer numero entero: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"Intruduce el segundo numero entero: \00"
@.str.3 = [40 x i8] c"\0AEl resultado de %d elevado a %d es: %d\00"
@.str.4 = [39 x i8] c"\0APulsa Cuanquier tecla para terminar: \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [180 x i8]
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = getelementptr inbounds [180 x i8], [180 x i8]* %5, i64 0, i64 0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %8, i32 180, i32 %10)
%12 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* @stdin
%15 = call i32 @fgets(i8* %8, i32 180, i32 %14)
%16 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 0
%19 = load i32, i32* %3
br i1 %18, label %20, label %86
20: ; preds = %2
%21 = icmp ult i32 %17, 8
br i1 %21, label %77, label %22
22: ; preds = %20
%23 = and i32 %17, -8
%24 = insertelement <4 x i32> poison, i32 %19, i64 0
%25 = shufflevector <4 x i32> %24, <4 x i32> poison, <4 x i32> zeroinitializer
%26 = insertelement <4 x i32> poison, i32 %19, i64 0
%27 = shufflevector <4 x i32> %26, <4 x i32> poison, <4 x i32> zeroinitializer
%28 = add i32 %23, -8
%29 = lshr exact i32 %28, 3
%30 = add nuw nsw i32 %29, 1
%31 = and i32 %30, 7
%32 = icmp ult i32 %28, 56
br i1 %32, label %57, label %33
33: ; preds = %22
%34 = and i32 %30, 1073741816
br label %35
35: ; preds = %35, %33
%36 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %33 ], [ %53, %35 ]
%37 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %33 ], [ %54, %35 ]
%38 = phi i32 [ 0, %33 ], [ %55, %35 ]
%39 = mul <4 x i32> %25, %36
%40 = mul <4 x i32> %27, %37
%41 = mul <4 x i32> %25, %39
%42 = mul <4 x i32> %27, %40
%43 = mul <4 x i32> %25, %41
%44 = mul <4 x i32> %27, %42
%45 = mul <4 x i32> %25, %43
%46 = mul <4 x i32> %27, %44
%47 = mul <4 x i32> %25, %45
%48 = mul <4 x i32> %27, %46
%49 = mul <4 x i32> %25, %47
%50 = mul <4 x i32> %27, %48
%51 = mul <4 x i32> %25, %49
%52 = mul <4 x i32> %27, %50
%53 = mul <4 x i32> %25, %51
%54 = mul <4 x i32> %27, %52
%55 = add nuw i32 %38, 8
%56 = icmp eq i32 %55, %34
br i1 %56, label %57, label %35
57: ; preds = %35, %22
%58 = phi <4 x i32> [ undef, %22 ], [ %53, %35 ]
%59 = phi <4 x i32> [ undef, %22 ], [ %54, %35 ]
%60 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %22 ], [ %53, %35 ]
%61 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %22 ], [ %54, %35 ]
%62 = icmp eq i32 %31, 0
br i1 %62, label %71, label %63
63: ; preds = %57, %63
%64 = phi <4 x i32> [ %67, %63 ], [ %60, %57 ]
%65 = phi <4 x i32> [ %68, %63 ], [ %61, %57 ]
%66 = phi i32 [ %69, %63 ], [ 0, %57 ]
%67 = mul <4 x i32> %25, %64
%68 = mul <4 x i32> %27, %65
%69 = add i32 %66, 1
%70 = icmp eq i32 %69, %31
br i1 %70, label %71, label %63
71: ; preds = %63, %57
%72 = phi <4 x i32> [ %58, %57 ], [ %67, %63 ]
%73 = phi <4 x i32> [ %59, %57 ], [ %68, %63 ]
%74 = mul <4 x i32> %73, %72
%75 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %74)
%76 = icmp eq i32 %17, %23
br i1 %76, label %86, label %77
77: ; preds = %20, %71
%78 = phi i32 [ 1, %20 ], [ %75, %71 ]
%79 = phi i32 [ 0, %20 ], [ %23, %71 ]
br label %80
80: ; preds = %77, %80
%81 = phi i32 [ %83, %80 ], [ %78, %77 ]
%82 = phi i32 [ %84, %80 ], [ %79, %77 ]
%83 = mul nsw i32 %19, %81
%84 = add nuw nsw i32 %82, 1
%85 = icmp eq i32 %84, %17
br i1 %85, label %86, label %80
86: ; preds = %80, %71, %2
%87 = phi i32 [ 1, %2 ], [ %75, %71 ], [ %83, %80 ]
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i32 %19, i32 %17, i32 %87)
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%90 = load i32, i32* @stdin
%91 = call i32 @fgets(i8* %8, i32 180, i32 %90)
ret i32 0
}