#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 *, ...);
double root1(int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  int num1;
  double root;
  printf("Enter a number greater then 1: ");
  scanf("%d", &num1);
  if (num1 > 1) {
    printf("Enter the value for 'n'(the root to be calculated): ");
    scanf("%d", &n);
    root = root1(num1, n);
    printf("%d th Root of %d is %f\n\n", n, num1, root);
  } else
    printf("Wrong entry");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jle    11b3 <main+0x83>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <root1@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11c1 <main+0x91>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
cmpl   $0x2,(%rsp)
jl     1196 <main+0x66>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
call   1040 <root1@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xecb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11a4 <main+0x74>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Enter a number greater then 1: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [53 x i8] c"Enter the value for 'n'(the root to be calculated): \00"
@.str.3 = [25 x i8] c"%d th Root of %d is %f\0A\0A\00"
@.str.4 = [12 x i8] c"Wrong entry\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 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* %3)
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %19
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = call double @root1(i32 %12, i32 %13)
store double %14, double* %4
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = load double, double* %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %16, double %17)
br label %21
19: ; preds = %0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %21
21: ; preds = %19, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Enter a number greater then 1: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [53 x i8] c"Enter the value for 'n'(the root to be calculated): \00"
@.str.3 = [25 x i8] c"%d th Root of %d is %f\0A\0A\00"
@.str.4 = [12 x i8] c"Wrong entry\00"
define i32 @main() {
%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 ([32 x i8], [32 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* %2)
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %18
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %2
%13 = load i32, i32* %1
%14 = call double @root1(i32 %12, i32 %13)
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %16, double %14)
br label %20
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %20
20: ; preds = %18, %9
ret i32 0
}