#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 */
scalar_t__ EOF;
int NumWei(int);
int /*<<< orphan*/ printf(char *, int, int);
scalar_t__ scanf(char *, int *);
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    if (n == 0)
      return 0;
    printf("%d %d\n", NumWei(n), NumWei(n * n));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     11a2 <main+0x72>
cmpl   $0x0,-0x8(%rbp)
jne    1175 <main+0x45>
movl   $0x0,-0x4(%rbp)
jmp    11a9 <main+0x79>
mov    -0x8(%rbp),%edi
call   1050 <NumWei@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
imul   -0x8(%rbp),%edi
call   1050 <NumWei@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2e94(%rip),%rbx
cmp    (%rbx),%rax
je     11a7 <main+0x77>
lea    0xea3(%rip),%r14
lea    0xe99(%rip),%r15
lea    0xc(%rsp),%r12
nopl   0x0(%rax)
mov    0xc(%rsp),%edi
test   %edi,%edi
je     11a7 <main+0x77>
call   1050 <NumWei@plt>
mov    %eax,%ebp
mov    0xc(%rsp),%edi
imul   %edi,%edi
call   1050 <NumWei@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
cmp    (%rbx),%rax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %19
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 0, i32* %1
br label %20
11: ; preds = %7
%12 = load i32, i32* %2
%13 = call i32 @NumWei(i32 %12)
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = mul nsw i32 %14, %15
%17 = call i32 @NumWei(i32 %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %17)
br label %3
19: ; preds = %3
store i32 0, i32* %1
br label %20
20: ; preds = %19, %10
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %18, label %6
6: ; preds = %0, %9
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = call i32 @NumWei(i32 %7)
%11 = load i32, i32* %1
%12 = mul nsw i32 %11, %11
%13 = call i32 @NumWei(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %13)
%15 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%16 = load i64, i64* @EOF
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %6
18: ; preds = %6, %9, %0
ret i32 0
}