#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 Quadrado(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b, flag = 1;
  printf("0 0 para sair do programa\n\n");
  while (flag != 0) {
    printf("Digite o numero e o valor a ser elevado\n");
    scanf("%d %d", &a, &b);
    if ((a == 0) && (b == 0))
      flag = 0;
    printf("%d elevado a %d eh igual a: %d\n", a, b, Quadrado(a, b));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x10(%rbp)
je     11cd <main+0x9d>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    119b <main+0x6b>
cmpl   $0x0,-0xc(%rbp)
jne    119b <main+0x6b>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <Quadrado@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1154 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xea2(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%r13
lea    0xe99(%rip),%rbx
nopl   (%rax)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%ebp
mov    (%rsp),%r14d
mov    %ebp,%edi
mov    %r14d,%esi
call   1060 <Quadrado@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
or     %ebp,%r14d
jne    1170 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"0 0 para sair do programa\0A\0A\00"
@.str.1 = [41 x i8] c"Digite o numero e o valor a ser elevado\0A\00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [32 x i8] c"%d elevado a %d eh igual a: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %18, %0
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %25
9: ; preds = %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3)
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 0, i32* %4
br label %18
18: ; preds = %17, %14, %9
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = call i32 @Quadrado(i32 %21, i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %19, i32 %20, i32 %23)
br label %6
25: ; preds = %6
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [32 x i8] c"%d elevado a %d eh igual a: %d\0A\00"
@str = [27 x i8] c"0 0 para sair do programa\0A\00"
@str.4 = [40 x i8] c"Digite o numero e o valor a ser elevado\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 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %0, %6
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.4, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = or i32 %10, %9
%12 = icmp eq i32 %11, 0
%13 = call i32 @Quadrado(i32 %9, i32 %10)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 %10, i32 %13)
br i1 %12, label %15, label %6
15: ; preds = %6
ret i32 0
}