#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*/ kubedoku(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, char *argv[]) {
  if ((argc == 1) || (argc > 2) || (strlen(argv[1]) != 81)) {
    printf("Usage: %s \"123456789...\"\n", argv[0]);
    return 1;
  } else {
    char sudoku[82];
    strcpy(sudoku, argv[1]);
    printf("%s\n", sudoku);
    kubedoku(sudoku);
    printf("%s\n", sudoku);
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1180 <main+0x40>
cmpl   $0x2,-0x8(%rbp)
jg     1180 <main+0x40>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x51,%eax
je     119f <main+0x5f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe72(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e0 <main+0xa0>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rsi
lea    0xe5f(%rip),%rdi
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1060 <kubedoku@plt>
lea    -0x70(%rbp),%rsi
lea    0xe46(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
je     119a <main+0x5a>
cmp    $0x2,%edi
jg     119a <main+0x5a>
mov    0x8(%rbx),%rdi
call   1040 <strlen@plt>
cmp    $0x51,%eax
jne    119a <main+0x5a>
mov    0x8(%rbx),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xea2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <kubedoku@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
jmp    11ae <main+0x6e>
mov    (%rbx),%rsi
lea    0xe5c(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: %s \22123456789...\22\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [82 x i8]
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 %18, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 2
br i1 %11, label %18, label %12
12: ; preds = %9
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @strlen(i8* %15)
%17 = icmp ne i32 %16, 81
br i1 %17, label %18, label %23
18: ; preds = %12, %9, %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %21)
store i32 1, i32* %3
br label %35
23: ; preds = %12
%24 = getelementptr inbounds [82 x i8], [82 x i8]* %6, i64 0, i64 0
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @strcpy(i8* %24, i8* %27)
%29 = getelementptr inbounds [82 x i8], [82 x i8]* %6, i64 0, i64 0
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = getelementptr inbounds [82 x i8], [82 x i8]* %6, i64 0, i64 0
%32 = call i32 @kubedoku(i8* %31)
%33 = getelementptr inbounds [82 x i8], [82 x i8]* %6, i64 0, i64 0
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %33)
store i32 0, i32* %3
br label %35
35: ; preds = %23, %18
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: %s \22123456789...\22\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [82 x i8]
%4 = icmp eq i32 %0, 1
%5 = icmp sgt i32 %0, 2
%6 = or i1 %4, %5
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @strlen(i8* %9)
%11 = icmp eq i32 %10, 81
br i1 %11, label %15, label %12
12: ; preds = %7, %2
%13 = load i8*, i8** %1
%14 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %22
15: ; preds = %7
%16 = getelementptr inbounds [82 x i8], [82 x i8]* %3, i64 0, i64 0
%17 = load i8*, i8** %8
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%20 = call i32 @kubedoku(i8* %16)
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %22
22: ; preds = %15, %12
%23 = phi i32 [ 1, %12 ], [ 0, %15 ]
ret i32 %23
}