#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 *, int, int);
int scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int read, num;
  while (scanf(" %d", &read), read != 0) {
    num = read / 2;
    printf("%d - %d\n", (num + 1) * (num + 1), num * num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
je     1185 <main+0x65>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%eax
add    $0x1,%eax
imul   %eax,%esi
mov    -0x18(%rbp),%edx
imul   -0x18(%rbp),%edx
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     118d <main+0x6d>
lea    0xebb(%rip),%r14
lea    0xeb0(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
sar    %edx
lea    0x1(%rdx),%esi
imul   %esi,%esi
imul   %edx,%edx
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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