#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 */
double pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void get_root() {
  int n, power;
  printf("Introduce el numero: ");
  scanf("%d", &n);
  printf("Introduce la raiz: ");
  scanf("%d", &power);
  printf("\nLa raiz %d de %d es %.3f\n", power, n, pow(n, (1. / power)));
}


x86 assembly (clang, -O0):
<get_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe70(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
call   1050 <pow@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe8b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_root>:
push   %rbp
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    (%rsp),%ebx
mov    0x4(%rsp),%ebp
cvtsi2sd %ebx,%xmm0
movsd  0xe7f(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%esi
mov    %ebp,%edi
call   1050 <pow@plt>
lea    0xe9e(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Introduce el numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Introduce la raiz: \00"
@.str.3 = [27 x i8] c"\0ALa raiz %d de %d es %.3f\0A\00"
define void @get_root() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to double
%12 = fdiv double 1.000000e+00, %11
%13 = fptosi double %12 to i32
%14 = call double @pow(i32 %9, i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %7, i32 %8, double %14)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Introduce el numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Introduce la raiz: \00"
@.str.3 = [27 x i8] c"\0ALa raiz %d de %d es %.3f\0A\00"
define void @get_root() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = sitofp i32 %9 to double
%12 = fdiv double 1.000000e+00, %11
%13 = fptosi double %12 to i32
%14 = call double @pow(i32 %10, i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 %10, double %14)
ret void
}