#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*/ column_selector(int *, int *, int);
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ row_selector(int *, int *, int);
int scanf(char *, int *);
void *sector_selector(int *row_begin, int *row_final, int *column_begin,
                      int *column_final) {
  int sector;
  printf("Enter the sector to check: ");
  while (scanf("%d", &sector) != 1 || (sector < 1 || sector >= 10)) {
    printf("Error the sudoku have only 9 sector\n");
    while ((getchar()) != '\n') {
      printf("\x1b[31m"
             "ONLY NUMBERS"
             "\x1b[0m\n");
    }
  }
  row_selector(row_begin, row_final, sector);
  column_selector(column_begin, column_final, sector);
}


x86 assembly (clang, -O0):
<sector_selector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1070 <scanf@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x2d(%rbp)
jne    11b3 <sector_selector+0x63>
mov    $0x1,%al
cmpl   $0x1,-0x2c(%rbp)
mov    %al,-0x2e(%rbp)
jl     11ad <sector_selector+0x5d>
cmpl   $0xa,-0x2c(%rbp)
setge  %al
mov    %al,-0x2e(%rbp)
mov    -0x2e(%rbp),%al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
test   $0x1,%al
jne    11c3 <sector_selector+0x73>
jmp    11f8 <sector_selector+0xa8>
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     11f3 <sector_selector+0xa3>
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
jmp    11cf <sector_selector+0x7f>
jmp    1174 <sector_selector+0x24>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1060 <row_selector@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1040 <column_selector@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sector_selector>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,0x10(%rsp)
mov    %rdx,0x8(%rsp)
mov    %rsi,%r12
mov    %rdi,%r13
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8b(%rip),%rbx
lea    0x4(%rsp),%rbp
lea    0xe82(%rip),%r14
lea    0xe9f(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1080 <scanf@plt>
cmp    $0x1,%eax
jne    11cc <sector_selector+0x6c>
mov    0x4(%rsp),%edx
lea    -0xa(%rdx),%eax
cmp    $0xfffffff6,%eax
ja     11e5 <sector_selector+0x85>
mov    %r14,%rdi
nop
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     11b0 <sector_selector+0x50>
mov    %r15,%rdi
jmp    11d0 <sector_selector+0x70>
mov    %r13,%rdi
mov    %r12,%rsi
call   1070 <row_selector@plt>
mov    0x4(%rsp),%edx
mov    0x8(%rsp),%rdi
mov    0x10(%rsp),%rsi
call   1050 <column_selector@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter the sector to check: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"Error the sudoku have only 9 sector\0A\00"
@.str.3 = [23 x i8] c"\1B[31mONLY NUMBERS\1B[0m\0A\00"
define i8* @sector_selector(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %33, %4
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%14 = icmp ne i32 %13, 1
br i1 %14, label %23, label %15
15: ; preds = %12
%16 = load i32, i32* %10
%17 = icmp slt i32 %16, 1
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %10
%20 = icmp sge i32 %19, 10
br label %21
21: ; preds = %18, %15
%22 = phi i1 [ true, %15 ], [ %20, %18 ]
br label %23
23: ; preds = %21, %12
%24 = phi i1 [ true, %12 ], [ %22, %21 ]
br i1 %24, label %25, label %34
25: ; preds = %23
%26 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %31, %25
%28 = call signext i8 (...) @getchar()
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 10
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %27
33: ; preds = %27
br label %12
34: ; preds = %23
%35 = load i32*, i32** %6
%36 = load i32*, i32** %7
%37 = load i32, i32* %10
%38 = call i32 @row_selector(i32* %35, i32* %36, i32 %37)
%39 = load i32*, i32** %8
%40 = load i32*, i32** %9
%41 = load i32, i32* %10
%42 = call i32 @column_selector(i32* %39, i32* %40, i32 %41)
%43 = load i8*, i8** %5
ret i8* %43
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter the sector to check: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [36 x i8] c"Error the sudoku have only 9 sector\00"
@str.4 = [22 x i8] c"\1B[31mONLY NUMBERS\1B[0m\00"
define noalias i8* @sector_selector(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %19, %4
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* %5
%13 = add i32 %12, -10
%14 = icmp ult i32 %13, -9
br i1 %14, label %15, label %24
15: ; preds = %8, %11
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%17 = call signext i8 (...) @getchar()
%18 = icmp eq i8 %17, 10
br i1 %18, label %19, label %20
19: ; preds = %20, %15
br label %8
20: ; preds = %15, %20
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.4, i64 0, i64 0))
%22 = call signext i8 (...) @getchar()
%23 = icmp eq i8 %22, 10
br i1 %23, label %19, label %20
24: ; preds = %11
%25 = call i32 @row_selector(i32* %0, i32* %1, i32 %12)
%26 = load i32, i32* %5
%27 = call i32 @column_selector(i32* %2, i32* %3, i32 %26)
ret i8* undef
}