#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*/ printSolution(int **, int);
int /*<<< orphan*/ printf(char *);
scalar_t__ solveKTUtil(int /*<<< orphan*/, int /*<<< orphan*/, int, int **,
                       int);
void solveKT(int size) {
  int sol[30][30];
  int x, y;
  for (x = 0; x < 30; x++)
    for (y = 0; y < 30; y++)
      sol[x][y] = -1;
  sol[0][0] = 0;
  if (solveKTUtil(0, 0, 1, sol, size) == 0) {
    printf("Solution does not exist");
  } else
    printSolution(sol, size);
}


x86 assembly (clang, -O0):
<solveKT>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe30,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xe24(%rbp)
cmpl   $0x1e,-0xe24(%rbp)
jge    11bc <solveKT+0x8c>
movl   $0x0,-0xe28(%rbp)
cmpl   $0x1e,-0xe28(%rbp)
jge    11a3 <solveKT+0x73>
movslq -0xe24(%rbp),%rcx
lea    -0xe20(%rbp),%rax
imul   $0x78,%rcx,%rcx
add    %rcx,%rax
movslq -0xe28(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0xe28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe28(%rbp)
jmp    115f <solveKT+0x2f>
jmp    11a8 <solveKT+0x78>
mov    -0xe24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe24(%rbp)
jmp    1148 <solveKT+0x18>
movl   $0x0,-0xe20(%rbp)
lea    -0xe20(%rbp),%rcx
mov    -0x4(%rbp),%r8d
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1050 <solveKTUtil@plt>
cmp    $0x0,%rax
jne    11fa <solveKT+0xca>
lea    0xe10(%rip),%rdi
call   1030 <printf@plt>
jmp    1209 <solveKT+0xd9>
lea    -0xe20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <printSolution@plt>
add    $0xe30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solveKT>:
push   %r14
push   %rbx
sub    $0xe18,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    $0xe10,%edx
mov    %r14,%rdi
mov    $0xff,%esi
call   1040 <memset@plt>
movl   $0x0,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    %r14,%rcx
mov    %ebx,%r8d
call   1060 <solveKTUtil@plt>
test   %rax,%rax
je     118d <solveKT+0x4d>
mov    %rsp,%rdi
mov    %ebx,%esi
call   1050 <printSolution@plt>
jmp    1199 <solveKT+0x59>
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
add    $0xe18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Solution does not exist\00"
define void @solveKT(i32 %0) {
%2 = alloca i32
%3 = alloca [30 x [30 x i32]]
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
br label %6
6: ; preds = %24, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 30
br i1 %8, label %9, label %27
9: ; preds = %6
store i32 0, i32* %5
br label %10
10: ; preds = %20, %9
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 30
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [30 x [30 x i32]], [30 x [30 x i32]]* %3, i64 0, i64 %15
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [30 x i32], [30 x i32]* %16, i64 0, i64 %18
store i32 -1, i32* %19
br label %20
20: ; preds = %13
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %10
23: ; preds = %10
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %6
27: ; preds = %6
%28 = getelementptr inbounds [30 x [30 x i32]], [30 x [30 x i32]]* %3, i64 0, i64 0
%29 = getelementptr inbounds [30 x i32], [30 x i32]* %28, i64 0, i64 0
store i32 0, i32* %29
%30 = getelementptr inbounds [30 x [30 x i32]], [30 x [30 x i32]]* %3, i64 0, i64 0
%31 = bitcast [30 x i32]* %30 to i32**
%32 = load i32, i32* %2
%33 = call i64 @solveKTUtil(i32 0, i32 0, i32 1, i32** %31, i32 %32)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %27
%36 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %42
37: ; preds = %27
%38 = getelementptr inbounds [30 x [30 x i32]], [30 x [30 x i32]]* %3, i64 0, i64 0
%39 = bitcast [30 x i32]* %38 to i32**
%40 = load i32, i32* %2
%41 = call i32 @printSolution(i32** %39, i32 %40)
br label %42
42: ; preds = %37, %35
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Solution does not exist\00"
define void @solveKT(i32 %0) {
%2 = alloca [30 x [30 x i32]]
%3 = bitcast [30 x [30 x i32]]* %2 to i8*
%4 = getelementptr inbounds [30 x [30 x i32]], [30 x [30 x i32]]* %2, i64 0, i64 0, i64 0
store i32 0, i32* %4
%5 = bitcast [30 x [30 x i32]]* %2 to i32**
%6 = call i64 @solveKTUtil(i32 0, i32 0, i32 1, i32** %5, i32 %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 @printSolution(i32** %5, i32 %0)
br label %12
12: ; preds = %10, %8
ret void
}