#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*/ SquaresSum(int, int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *, int *);
int /*<<< orphan*/ stdin;
int main() {
  int lowerLimit, uperLimit;
  int k = 0;
  do {
    printf("Enter lower and upper integer limits (q - to quit): ");
    k = (scanf("%d %d", &lowerLimit, &uperLimit));
    if (k) {
      SquaresSum(lowerLimit, uperLimit);
    }
    fflush(stdin);
  } while (k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <scanf@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     118e <main+0x4e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <SquaresSum@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
cmpl   $0x0,-0x10(%rbp)
jne    1156 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <scanf@plt>
test   %eax,%eax
je     11d0 <main+0x90>
mov    0x2e6e(%rip),%r13
lea    0xe7f(%rip),%r14
lea    0xead(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <SquaresSum@plt>
mov    0x0(%r13),%edi
call   1050 <fflush@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1060 <scanf@plt>
test   %eax,%eax
jne    11a0 <main+0x60>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Enter lower and upper integer limits (q - to quit): \00"
@.str.1 = [6 x i8] c"%d %d\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %5
5: ; preds = %17, %0
%6 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @SquaresSum(i32 %11, i32 %12)
br label %14
14: ; preds = %10, %5
%15 = load i32, i32* @stdin
%16 = call i32 @fflush(i32 %15)
br label %17
17: ; preds = %14
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 0
br i1 %19, label %5, label %20
20: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"Enter lower and upper integer limits (q - to quit): \00"
@.str.1 = [6 x i8] c"%d %d\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %0, %8
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @SquaresSum(i32 %9, i32 %10)
%12 = load i32, i32* @stdin
%13 = call i32 @fflush(i32 %12)
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %0
%18 = load i32, i32* @stdin
%19 = call i32 @fflush(i32 %18)
ret i32 0
}