int CMcheck(char collumch, char collum, char order, int rowch, int row) {
  int x = 0;
  switch (collumch) {
  case 'a':
    break;
  case 'b':
    break;
  case 'c':
    break;
  case 'd':
    break;
  case 'e':
    break;
  case 'f':
    break;
  case 'g':
    break;
  case 'h':
    break;
  default: {
    printf("invalid collum 1 \n");
    break;
    x = 1;
  }
  }
  switch (collum) {
  case 'a':
    break;
  case 'b':
    break;
  case 'c':
    break;
  case 'd':
    break;
  case 'e':
    break;
  case 'f':
    break;
  case 'g':
    break;
  case 'h':
    break;
  default: {
    printf("invalid collum 2 \n");
    break;
    x = 1;
  }
  }
  if (rowch < 1 || rowch > 8) {
    printf("row must be between 1-8\n");
    x = 1;
  }
  if (order == "king" || order == "rook" || order == "bishop" ||
      order == "queen" || order == "knight" || order == "pawn") {
    printf("invalid order \n");
    x = 1;
  }
  return x;
}


x86 assembly (clang, -O0):
<CMcheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    %ecx,-0x8(%rbp)
mov    %r8d,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x7,%eax
ja     118a <CMcheck+0x7a>
mov    -0x18(%rbp),%rax
lea    0xea7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1198 <CMcheck+0x88>
jmp    1198 <CMcheck+0x88>
jmp    1198 <CMcheck+0x88>
jmp    1198 <CMcheck+0x88>
jmp    1198 <CMcheck+0x88>
jmp    1198 <CMcheck+0x88>
jmp    1198 <CMcheck+0x88>
jmp    1198 <CMcheck+0x88>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x2(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x7,%eax
ja     11ea <CMcheck+0xda>
mov    -0x20(%rbp),%rax
lea    0xe67(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    11f8 <CMcheck+0xe8>
jmp    11f8 <CMcheck+0xe8>
jmp    11f8 <CMcheck+0xe8>
jmp    11f8 <CMcheck+0xe8>
jmp    11f8 <CMcheck+0xe8>
jmp    11f8 <CMcheck+0xe8>
jmp    11f8 <CMcheck+0xe8>
jmp    11f8 <CMcheck+0xe8>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jl     120c <CMcheck+0xfc>
cmpl   $0x8,-0x8(%rbp)
jle    1221 <CMcheck+0x111>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
movsbq -0x3(%rbp),%rax
lea    0xe52(%rip),%rcx
cmp    %rcx,%rax
je     129f <CMcheck+0x18f>
movsbq -0x3(%rbp),%rax
lea    0xe42(%rip),%rcx
cmp    %rcx,%rax
je     129f <CMcheck+0x18f>
movsbq -0x3(%rbp),%rax
lea    0xe32(%rip),%rcx
cmp    %rcx,%rax
je     129f <CMcheck+0x18f>
movsbq -0x3(%rbp),%rax
lea    0xe24(%rip),%rcx
cmp    %rcx,%rax
je     129f <CMcheck+0x18f>
movsbq -0x3(%rbp),%rax
lea    0xe15(%rip),%rcx
cmp    %rcx,%rax
je     129f <CMcheck+0x18f>
movsbq -0x3(%rbp),%rax
lea    0xe07(%rip),%rcx
cmp    %rcx,%rax
jne    12b4 <CMcheck+0x1a4>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMcheck>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebp
mov    %edx,%r14d
mov    %esi,%ebx
add    $0xffffff9f,%edi
cmp    $0x8,%edi
jb     112f <CMcheck+0x1f>
lea    0xf32(%rip),%rdi
call   1030 <puts@plt>
movsbl %bl,%eax
add    $0xffffff9f,%eax
cmp    $0x8,%eax
jb     1146 <CMcheck+0x36>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
add    $0xfffffff7,%ebp
xor    %eax,%eax
cmp    $0xfffffff7,%ebp
ja     1161 <CMcheck+0x51>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
movsbq %r14b,%rcx
lea    0xeb2(%rip),%rdx
cmp    %rdx,%rcx
je     11ad <CMcheck+0x9d>
lea    0xe9f(%rip),%rdx
cmp    %rdx,%rcx
je     11ad <CMcheck+0x9d>
lea    0xe8d(%rip),%rdx
cmp    %rdx,%rcx
je     11ad <CMcheck+0x9d>
lea    0xe7a(%rip),%rdx
cmp    %rdx,%rcx
je     11ad <CMcheck+0x9d>
lea    0xe64(%rip),%rdx
cmp    %rdx,%rcx
je     11ad <CMcheck+0x9d>
lea    0xe5d(%rip),%rdx
cmp    %rdx,%rcx
jne    11be <CMcheck+0xae>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"invalid collum 1 \0A\00"
@.str.1 = [19 x i8] c"invalid collum 2 \0A\00"
@.str.2 = [25 x i8] c"row must be between 1-8\0A\00"
@.str.3 = [5 x i8] c"king\00"
@.str.4 = [5 x i8] c"rook\00"
@.str.5 = [7 x i8] c"bishop\00"
@.str.6 = [6 x i8] c"queen\00"
@.str.7 = [7 x i8] c"knight\00"
@.str.8 = [5 x i8] c"pawn\00"
@.str.9 = [16 x i8] c"invalid order \0A\00"
define i32 @CMcheck(i8 signext %0, i8 signext %1, i8 signext %2, i32 %3, i32 %4) {
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
store i32 0, i32* %11
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
switch i32 %13, label %22 [
i32 97, label %14
i32 98, label %15
i32 99, label %16
i32 100, label %17
i32 101, label %18
i32 102, label %19
i32 103, label %20
i32 104, label %21
]
14: ; preds = %5
br label %24
15: ; preds = %5
br label %24
16: ; preds = %5
br label %24
17: ; preds = %5
br label %24
18: ; preds = %5
br label %24
19: ; preds = %5
br label %24
20: ; preds = %5
br label %24
21: ; preds = %5
br label %24
22: ; preds = %5
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %24
24: ; preds = %22, %21, %20, %19, %18, %17, %16, %15, %14
%25 = load i8, i8* %7
%26 = sext i8 %25 to i32
switch i32 %26, label %35 [
i32 97, label %27
i32 98, label %28
i32 99, label %29
i32 100, label %30
i32 101, label %31
i32 102, label %32
i32 103, label %33
i32 104, label %34
]
27: ; preds = %24
br label %37
28: ; preds = %24
br label %37
29: ; preds = %24
br label %37
30: ; preds = %24
br label %37
31: ; preds = %24
br label %37
32: ; preds = %24
br label %37
33: ; preds = %24
br label %37
34: ; preds = %24
br label %37
35: ; preds = %24
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %37
37: ; preds = %35, %34, %33, %32, %31, %30, %29, %28, %27
%38 = load i32, i32* %9
%39 = icmp slt i32 %38, 1
br i1 %39, label %43, label %40
40: ; preds = %37
%41 = load i32, i32* %9
%42 = icmp sgt i32 %41, 8
br i1 %42, label %43, label %45
43: ; preds = %40, %37
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %11
br label %45
45: ; preds = %43, %40
%46 = load i8, i8* %8
%47 = sext i8 %46 to i64
%48 = inttoptr i64 %47 to i8*
%49 = icmp eq i8* %48, getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
br i1 %49, label %75, label %50
50: ; preds = %45
%51 = load i8, i8* %8
%52 = sext i8 %51 to i64
%53 = inttoptr i64 %52 to i8*
%54 = icmp eq i8* %53, getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0)
br i1 %54, label %75, label %55
55: ; preds = %50
%56 = load i8, i8* %8
%57 = sext i8 %56 to i64
%58 = inttoptr i64 %57 to i8*
%59 = icmp eq i8* %58, getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
br i1 %59, label %75, label %60
60: ; preds = %55
%61 = load i8, i8* %8
%62 = sext i8 %61 to i64
%63 = inttoptr i64 %62 to i8*
%64 = icmp eq i8* %63, getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0)
br i1 %64, label %75, label %65
65: ; preds = %60
%66 = load i8, i8* %8
%67 = sext i8 %66 to i64
%68 = inttoptr i64 %67 to i8*
%69 = icmp eq i8* %68, getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0)
br i1 %69, label %75, label %70
70: ; preds = %65
%71 = load i8, i8* %8
%72 = sext i8 %71 to i64
%73 = inttoptr i64 %72 to i8*
%74 = icmp eq i8* %73, getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
br i1 %74, label %75, label %77
75: ; preds = %70, %65, %60, %55, %50, %45
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %11
br label %77
77: ; preds = %75, %70
%78 = load i32, i32* %11
ret i32 %78
}

LLVM IR (-O2):
@.str.3 = [5 x i8] c"king\00"
@.str.4 = [5 x i8] c"rook\00"
@.str.5 = [7 x i8] c"bishop\00"
@.str.6 = [6 x i8] c"queen\00"
@.str.7 = [7 x i8] c"knight\00"
@.str.8 = [5 x i8] c"pawn\00"
@str = [15 x i8] c"invalid order \00"
@str.10 = [24 x i8] c"row must be between 1-8\00"
@str.11 = [18 x i8] c"invalid collum 2 \00"
@str.12 = [18 x i8] c"invalid collum 1 \00"
define i32 @CMcheck(i8 signext %0, i8 signext %1, i8 signext %2, i32 %3, i32 %4) {
%6 = sext i8 %0 to i32
%7 = add nsw i32 %6, -97
%8 = icmp ult i32 %7, 8
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.12, i64 0, i64 0))
br label %11
11: ; preds = %5, %9
%12 = sext i8 %1 to i32
%13 = add nsw i32 %12, -97
%14 = icmp ult i32 %13, 8
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.11, i64 0, i64 0))
br label %17
17: ; preds = %11, %15
%18 = add i32 %3, -9
%19 = icmp ult i32 %18, -8
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.10, i64 0, i64 0))
br label %22
22: ; preds = %17, %20
%23 = phi i32 [ 1, %20 ], [ 0, %17 ]
%24 = sext i8 %2 to i64
%25 = inttoptr i64 %24 to i8*
%26 = icmp eq i8* %25, getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%27 = icmp eq i8* %25, getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0)
%28 = or i1 %26, %27
%29 = icmp eq i8* %25, getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%30 = or i1 %29, %28
%31 = icmp eq i8* %25, getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0)
%32 = or i1 %31, %30
%33 = icmp eq i8* %25, getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0)
%34 = or i1 %33, %32
%35 = icmp eq i8* %25, getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%36 = or i1 %35, %34
br i1 %36, label %37, label %39
37: ; preds = %22
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %39
39: ; preds = %22, %37
%40 = phi i32 [ 1, %37 ], [ %23, %22 ]
ret i32 %40
}