#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*/ generate(int *);
int /*<<< orphan*/ load(int *);
int /*<<< orphan*/ print(int *);
int /*<<< orphan*/ printf(char *);
scalar_t__ verify(int *, int);
int main(int argc, char *argv[]) {
  int grid[9 * 9];
  if (argc == 1) {
    load(grid);
  } else if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'g') {
    generate(grid);
  }
  print(grid);
  if (verify(grid, 1))
    printf("Valid rows, columns and blocks\n");
  else
    printf("Invalid rows, columns and blocks\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1184 <main+0x34>
lea    -0x160(%rbp),%rdi
call   1060 <load@plt>
jmp    11c8 <main+0x78>
cmpl   $0x2,-0x8(%rbp)
jne    11c3 <main+0x73>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11c3 <main+0x73>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x67,%eax
jne    11c3 <main+0x73>
lea    -0x160(%rbp),%rdi
call   1070 <generate@plt>
jmp    11c8 <main+0x78>
lea    -0x160(%rbp),%rdi
call   1040 <print@plt>
lea    -0x160(%rbp),%rdi
mov    $0x1,%esi
call   1050 <verify@plt>
cmp    $0x0,%rax
je     1200 <main+0xb0>
lea    0xe0a(%rip),%rdi
call   1030 <printf@plt>
jmp    120c <main+0xbc>
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x150,%rsp
cmp    $0x2,%edi
je     116c <main+0x1c>
cmp    $0x1,%edi
jne    1183 <main+0x33>
mov    %rsp,%rdi
call   1060 <load@plt>
jmp    1183 <main+0x33>
mov    0x8(%rsi),%rax
cmpb   $0x2d,(%rax)
jne    1183 <main+0x33>
cmpb   $0x67,0x1(%rax)
jne    1183 <main+0x33>
mov    %rsp,%rdi
call   1070 <generate@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <print@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <verify@plt>
test   %rax,%rax
lea    0xe5b(%rip),%rax
lea    0xe75(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Valid rows, columns and blocks\0A\00"
@.str.1 = [34 x i8] c"Invalid rows, columns and blocks\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [81 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = getelementptr inbounds [81 x i32], [81 x i32]* %6, i64 0, i64 0
%11 = call i32 @load(i32* %10)
br label %35
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %34
15: ; preds = %12
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 45
br i1 %22, label %23, label %34
23: ; preds = %15
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 103
br i1 %30, label %31, label %34
31: ; preds = %23
%32 = getelementptr inbounds [81 x i32], [81 x i32]* %6, i64 0, i64 0
%33 = call i32 @generate(i32* %32)
br label %34
34: ; preds = %31, %23, %15, %12
br label %35
35: ; preds = %34, %9
%36 = getelementptr inbounds [81 x i32], [81 x i32]* %6, i64 0, i64 0
%37 = call i32 @print(i32* %36)
%38 = getelementptr inbounds [81 x i32], [81 x i32]* %6, i64 0, i64 0
%39 = call i64 @verify(i32* %38, i32 1)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %35
%42 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %45
43: ; preds = %35
%44 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %45
45: ; preds = %43, %41
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"Invalid rows, columns and blocks\00"
@str.2 = [31 x i8] c"Valid rows, columns and blocks\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [81 x i32]
%4 = bitcast [81 x i32]* %3 to i8*
switch i32 %0, label %20 [
i32 1, label %5
i32 2, label %8
]
5: ; preds = %2
%6 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 0
%7 = call i32 @load(i32* %6)
br label %20
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 45
br i1 %12, label %13, label %20
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 103
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 0
%19 = call i32 @generate(i32* %18)
br label %20
20: ; preds = %2, %8, %13, %17, %5
%21 = getelementptr inbounds [81 x i32], [81 x i32]* %3, i64 0, i64 0
%22 = call i32 @print(i32* %21)
%23 = call i64 @verify(i32* %21, i32 1)
%24 = icmp eq i64 %23, 0
%25 = select i1 %24, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0)
%26 = call i32 @puts(i8* dereferenceable(1) %25)
ret i32 0
}