#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*/ pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(int);
void pow_test() {
  int cnt;
  int bottom, exp;
  cnt = 0;
  printf("---------pow_test---------");
  while (cnt < 3) {
    printf("input bottom: ");
    scanf(bottom);
    printf("input exponent: ");
    scanf(exp);
    printf("pow: ", pow(bottom, exp));
    cnt = cnt + 1;
  }
  printf("---------pow_test---------");
}


x86 assembly (clang, -O0):
<pow_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x3,-0x4(%rbp)
jge    11ac <pow_test+0x7c>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <scanf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <pow@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114d <pow_test+0x1d>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow_test>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecb(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
call   1040 <scanf@plt>
lea    0xec4(%rip),%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
call   1040 <scanf@plt>
call   1050 <pow@plt>
lea    0xeba(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
call   1040 <scanf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
call   1040 <scanf@plt>
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
call   1040 <scanf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
call   1040 <scanf@plt>
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"---------pow_test---------\00"
@.str.1 = [15 x i8] c"input bottom: \00"
@.str.2 = [17 x i8] c"input exponent: \00"
@.str.3 = [6 x i8] c"pow: \00"
define void @pow_test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = call i32 @scanf(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* %3
%14 = call i32 @scanf(i32 %13)
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = call i32 @pow(i32 %15, i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %5
21: ; preds = %5
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"---------pow_test---------\00"
@.str.1 = [15 x i8] c"input bottom: \00"
@.str.2 = [17 x i8] c"input exponent: \00"
@.str.3 = [6 x i8] c"pow: \00"
define void @pow_test() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @scanf(i32 undef)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @scanf(i32 undef)
%6 = tail call i32 @pow(i32 undef, i32 undef)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @scanf(i32 undef)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%11 = tail call i32 @scanf(i32 undef)
%12 = tail call i32 @pow(i32 undef, i32 undef)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%15 = tail call i32 @scanf(i32 undef)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%17 = tail call i32 @scanf(i32 undef)
%18 = tail call i32 @pow(i32 undef, i32 undef)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}