#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*/ fflush(int /*<<< orphan*/);
int npowp(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, char *, int *);
int /*<<< orphan*/ stdin;
int main(void) {
  int power, num;
  char sign;
  printf("Enter expression[x^y]: ");
  fflush(stdin);
  scanf("%d%c%d", &num, &sign, &power);
  if (sign == '^') {
    printf("The result is: %d", npowp(num, power));
  } else
    printf("Invalid input");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xea6(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0xd(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1060 <scanf@plt>
movsbl -0xd(%rbp),%eax
cmp    $0x5e,%eax
jne    11b0 <main+0x70>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <npowp@plt>
mov    %eax,%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11be <main+0x7e>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xeb1(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xf(%rsp),%rdx
lea    0x14(%rsp),%rcx
call   1060 <scanf@plt>
cmpb   $0x5e,0xf(%rsp)
jne    11a1 <main+0x61>
mov    0x10(%rsp),%edi
mov    0x14(%rsp),%esi
call   1040 <npowp@plt>
lea    0xe89(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11af <main+0x6f>
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter expression[x^y]: \00"
@stdin = global i32 0
@.str.1 = [7 x i8] c"%d%c%d\00"
@.str.2 = [18 x i8] c"The result is: %d\00"
@.str.3 = [14 x i8] c"Invalid input\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %3, i8* %4, i32* %2)
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 94
br i1 %11, label %12, label %17
12: ; preds = %0
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = call i32 @npowp(i32 %13, i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %19
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %17, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter expression[x^y]: \00"
@stdin = global i32 0
@.str.1 = [7 x i8] c"%d%c%d\00"
@.str.2 = [18 x i8] c"The result is: %d\00"
@.str.3 = [14 x i8] c"Invalid input\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdin
%8 = tail call i32 @fflush(i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2, i8* %3, i32* %1)
%10 = load i8, i8* %3
%11 = icmp eq i8 %10, 94
br i1 %11, label %12, label %17
12: ; preds = %0
%13 = load i32, i32* %2
%14 = load i32, i32* %1
%15 = call i32 @npowp(i32 %13, i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %19
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %17, %12
ret i32 0
}