#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 */
struct option {
  char *member_0;
  int member_1;
  char member_3;
  int /*<<< orphan*/ member_2;
};

/* Variables and functions */
int do_multi(unsigned int, unsigned int, unsigned int, int, char *const *);
int getopt_long(int, char *const *, char *, struct option const *,
                int /*<<< orphan*/ *);
int /*<<< orphan*/ optarg;
int optind;
int /*<<< orphan*/ solver_init();
unsigned int strtoul(int /*<<< orphan*/, int /*<<< orphan*/ *,
                     int /*<<< orphan*/);
int /*<<< orphan*/ usage(char *const);
int main(int argc, char *const argv[]) {
  unsigned num_of_sudokus = (4096 * 4);
  unsigned sudoku_num = 0;
  unsigned verbose = 0;
  int c;
  static const struct option opt[] = {
      {"sudoku", 1, 0, 's'},
      {"number", 1, 0, 'n'},
      {"verbose", 0, 0, 'v'},
      {"help", 0, 0, 'h'},
  };
  while ((c = getopt_long(argc, argv, "vhs:n:", opt, NULL)) >= 0) {
    switch (c) {
    case 's':
      sudoku_num = strtoul(optarg, NULL, 0);
      break;
    case 'n':
      num_of_sudokus = strtoul(optarg, NULL, 0);
      break;
    case 'v':
      verbose = 1;
      break;
    case 'h':
    default:
      usage(argv[0]);
      break;
    }
  }
  solver_init();
  return do_multi(verbose, num_of_sudokus, sudoku_num, argc - optind,
                  argv + optind);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4000,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdx
lea    0x2c20(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <getopt_long@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jl     1229 <main+0xd9>
mov    -0x20(%rbp),%eax
add    $0xffffff98,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0xe,%eax
ja     1218 <main+0xc8>
mov    -0x28(%rbp),%rax
lea    0xe3a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1060 <strtoul@plt>
mov    %eax,-0x18(%rbp)
jmp    1224 <main+0xd4>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1060 <strtoul@plt>
mov    %eax,-0x14(%rbp)
jmp    1224 <main+0xd4>
movl   $0x1,-0x1c(%rbp)
jmp    1224 <main+0xd4>
jmp    1218 <main+0xc8>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
jmp    117b <main+0x2b>
mov    $0x0,%al
call   1030 <solver_init@plt>
mov    -0x1c(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    0x2d9d(%rip),%rax
sub    (%rax),%ecx
mov    -0x10(%rbp),%r8
mov    0x2d90(%rip),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%r8
call   1070 <do_multi@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb4(%rip),%rdx
lea    0x2c42(%rip),%rcx
xor    %r14d,%r14d
xor    %r8d,%r8d
call   1040 <getopt_long@plt>
test   %eax,%eax
js     121b <main+0xcb>
xor    %ecx,%ecx
mov    %rcx,(%rsp)
mov    $0x4000,%r12d
lea    0xe87(%rip),%r13
lea    0x2c15(%rip),%r15
xor    %r14d,%r14d
jmp    11bf <main+0x6f>
mov    (%rbx),%rdi
call   1050 <usage@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1040 <getopt_long@plt>
test   %eax,%eax
js     1227 <main+0xd7>
cmp    $0x6e,%eax
je     11f0 <main+0xa0>
cmp    $0x76,%eax
je     1210 <main+0xc0>
cmp    $0x73,%eax
jne    11a0 <main+0x50>
mov    0x2e23(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <strtoul@plt>
mov    %eax,%r14d
jmp    11a8 <main+0x58>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <strtoul@plt>
mov    %eax,%r12d
jmp    11a8 <main+0x58>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%eax
mov    %rax,(%rsp)
jmp    11a8 <main+0x58>
mov    $0x4000,%r12d
xor    %eax,%eax
mov    %rax,(%rsp)
xor    %eax,%eax
call   1030 <solver_init@plt>
mov    0x2dab(%rip),%rax
movslq (%rax),%rax
sub    %eax,%ebp
lea    (%rbx,%rax,8),%r8
mov    (%rsp),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <do_multi@plt>

LLVM IR (-O0):
%struct.option = type { i8*, i32, i8, i32 }
@main.opt = internal constant [4 x %struct.option] [%struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i32 1, i8 0, i32 115 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i32 1, i8 0, i32 110 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i32 0, i8 0, i32 118 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i32 0, i8 0, i32 104 }]
@.str = [7 x i8] c"sudoku\00"
@.str.1 = [7 x i8] c"number\00"
@.str.2 = [8 x i8] c"verbose\00"
@.str.3 = [5 x i8] c"help\00"
@.str.4 = [7 x i8] c"vhs:n:\00"
@optarg = global i32 0
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 16384, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
br label %10
10: ; preds = %30, %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @getopt_long(i32 %11, i8** %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %struct.option* getelementptr inbounds ([4 x %struct.option], [4 x %struct.option]* @main.opt, i64 0, i64 0), i32* null)
store i32 %13, i32* %9
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %31
15: ; preds = %10
%16 = load i32, i32* %9
switch i32 %16, label %25 [
i32 115, label %17
i32 110, label %20
i32 118, label %23
i32 104, label %24
]
17: ; preds = %15
%18 = load i32, i32* @optarg
%19 = call i32 @strtoul(i32 %18, i32* null, i32 0)
store i32 %19, i32* %7
br label %30
20: ; preds = %15
%21 = load i32, i32* @optarg
%22 = call i32 @strtoul(i32 %21, i32* null, i32 0)
store i32 %22, i32* %6
br label %30
23: ; preds = %15
store i32 1, i32* %8
br label %30
24: ; preds = %15
br label %25
25: ; preds = %15, %24
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 0
%28 = load i8*, i8** %27
%29 = call i32 @usage(i8* %28)
br label %30
30: ; preds = %25, %23, %20, %17
br label %10
31: ; preds = %10
%32 = call i32 (...) @solver_init()
%33 = load i32, i32* %8
%34 = load i32, i32* %6
%35 = load i32, i32* %7
%36 = load i32, i32* %4
%37 = load i32, i32* @optind
%38 = sub nsw i32 %36, %37
%39 = load i8**, i8*** %5
%40 = load i32, i32* @optind
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %39, i64 %41
%43 = call i32 @do_multi(i32 %33, i32 %34, i32 %35, i32 %38, i8** %42)
ret i32 %43
}

LLVM IR (-O2):
%struct.option = type { i8*, i32, i8, i32 }
@main.opt = internal constant [4 x %struct.option] [%struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i32 1, i8 0, i32 115 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i32 1, i8 0, i32 110 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i32 0, i8 0, i32 118 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i32 0, i8 0, i32 104 }]
@.str = [7 x i8] c"sudoku\00"
@.str.1 = [7 x i8] c"number\00"
@.str.2 = [8 x i8] c"verbose\00"
@.str.3 = [5 x i8] c"help\00"
@.str.4 = [7 x i8] c"vhs:n:\00"
@optarg = global i32 0
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %struct.option* getelementptr inbounds ([4 x %struct.option], [4 x %struct.option]* @main.opt, i64 0, i64 0), i32* null)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %25
5: ; preds = %2, %19
%6 = phi i32 [ %23, %19 ], [ %3, %2 ]
%7 = phi i32 [ %22, %19 ], [ 16384, %2 ]
%8 = phi i32 [ %21, %19 ], [ 0, %2 ]
%9 = phi i32 [ %20, %19 ], [ 0, %2 ]
switch i32 %6, label %16 [
i32 115, label %10
i32 110, label %13
i32 118, label %19
]
10: ; preds = %5
%11 = load i32, i32* @optarg
%12 = tail call i32 @strtoul(i32 %11, i32* null, i32 0)
br label %19
13: ; preds = %5
%14 = load i32, i32* @optarg
%15 = tail call i32 @strtoul(i32 %14, i32* null, i32 0)
br label %19
16: ; preds = %5
%17 = load i8*, i8** %1
%18 = tail call i32 @usage(i8* %17)
br label %19
19: ; preds = %5, %16, %13, %10
%20 = phi i32 [ %9, %16 ], [ %9, %13 ], [ %12, %10 ], [ %9, %5 ]
%21 = phi i32 [ %8, %16 ], [ %8, %13 ], [ %8, %10 ], [ 1, %5 ]
%22 = phi i32 [ %7, %16 ], [ %15, %13 ], [ %7, %10 ], [ %7, %5 ]
%23 = tail call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %struct.option* getelementptr inbounds ([4 x %struct.option], [4 x %struct.option]* @main.opt, i64 0, i64 0), i32* null)
%24 = icmp sgt i32 %23, -1
br i1 %24, label %5, label %25
25: ; preds = %19, %2
%26 = phi i32 [ 0, %2 ], [ %20, %19 ]
%27 = phi i32 [ 0, %2 ], [ %21, %19 ]
%28 = phi i32 [ 16384, %2 ], [ %22, %19 ]
%29 = tail call i32 (...) @solver_init()
%30 = load i32, i32* @optind
%31 = sub nsw i32 %0, %30
%32 = sext i32 %30 to i64
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = tail call i32 @do_multi(i32 %27, i32 %28, i32 %26, i32 %31, i8** %33)
ret i32 %34
}