#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 /*<<< orphan*/ scanf(char *, int *);
int getSize() {
  int option;
  printf("\nChoose a Pattern Size (between 2 and 9): ");
  scanf("%d", &option);
  while (option < 2 || option > 9) {
    printf("Your Pattern Size is incorrect.  Please try again.");
    printf("\nChoose a Pattern Size (between 2 and 9): ");
    scanf("%d", &option);
  }
  return option;
}


x86 assembly (clang, -O0):
<getSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     115d <getSize+0x3d>
cmpl   $0x9,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    116d <getSize+0x4d>
jmp    119a <getSize+0x7a>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
jmp    1144 <getSize+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSize>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0xa(%rax),%ecx
cmp    $0xfffffff7,%ecx
ja     1197 <getSize+0x77>
lea    0xed6(%rip),%r14
lea    0xea1(%rip),%r15
lea    0xec5(%rip),%r12
lea    0x4(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0xa(%rax),%ecx
cmp    $0xfffffff8,%ecx
jb     1170 <getSize+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [43 x i8] c"\0AChoose a Pattern Size (between 2 and 9): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [51 x i8] c"Your Pattern Size is incorrect. Please try again.\00"
define i32 @getSize() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 2
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 9
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ true, %4 ], [ %9, %7 ]
br i1 %11, label %12, label %16
12: ; preds = %10
%13 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %4
16: ; preds = %10
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [43 x i8] c"\0AChoose a Pattern Size (between 2 and 9): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [51 x i8] c"Your Pattern Size is incorrect. Please try again.\00"
define i32 @getSize() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add i32 %5, -10
%7 = icmp ult i32 %6, -8
br i1 %7, label %8, label %15
8: ; preds = %0, %8
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = add i32 %12, -10
%14 = icmp ult i32 %13, -8
br i1 %14, label %8, label %15
15: ; preds = %8, %0
%16 = phi i32 [ %5, %0 ], [ %12, %8 ]
ret i32 %16
}