#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  printf("\t\tMATRIX CALCULATOR");
  printf("Select the operation\n1. Addition\n2. Subtraction\n3. "
         "Multiplication\n4. Transpose\n");
  printf("5. Determinant\n6. Cofactor\n7. Check for Identity matrix\n8. "
         "Inverse\n9. Rank\n");
  int choice;
  scanf("%d", &choice);
  switch (choice) {
  case 1:
    break;
  case 2:
    break;
  case 3:
    break;
  case 4:
    break;
  case 5:
    break;
  case 6:
    break;
  case 7:
    break;
  case 8:
    break;
  case 9:
    break;
  default:
    printf("Invalid Input! Enter a number between 1 to 9!\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf7a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x8,%eax
ja     11b9 <main+0x99>
mov    -0x10(%rbp),%rax
lea    0xe7d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    11c5 <main+0xa5>
jmp    11c5 <main+0xa5>
jmp    11c5 <main+0xa5>
jmp    11c5 <main+0xa5>
jmp    11c5 <main+0xa5>
jmp    11c5 <main+0xa5>
jmp    11c5 <main+0xa5>
jmp    11c5 <main+0xa5>
jmp    11c5 <main+0xa5>
lea    0xf17(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf16(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x9,%eax
jb     117e <main+0x4e>
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\09\09MATRIX CALCULATOR\00"
@.str.1 = [80 x i8] c"Select the operation\0A1. Addition\0A2. Subtraction\0A3. Multiplication\0A4. Transpose\0A\00"
@.str.2 = [76 x i8] c"5. Determinant\0A6. Cofactor\0A7. Check for Identity matrix\0A8. Inverse\0A9. Rank\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [47 x i8] c"Invalid Input! Enter a number between 1 to 9!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
switch i32 %7, label %17 [
i32 1, label %8
i32 2, label %9
i32 3, label %10
i32 4, label %11
i32 5, label %12
i32 6, label %13
i32 7, label %14
i32 8, label %15
i32 9, label %16
]
8: ; preds = %0
br label %19
9: ; preds = %0
br label %19
10: ; preds = %0
br label %19
11: ; preds = %0
br label %19
12: ; preds = %0
br label %19
13: ; preds = %0
br label %19
14: ; preds = %0
br label %19
15: ; preds = %0
br label %19
16: ; preds = %0
br label %19
17: ; preds = %0
%18 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
br label %19
19: ; preds = %17, %16, %15, %14, %13, %12, %11, %10, %9, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"\09\09MATRIX CALCULATOR\00"
@.str.3 = [3 x i8] c"%d\00"
@str = [79 x i8] c"Select the operation\0A1. Addition\0A2. Subtraction\0A3. Multiplication\0A4. Transpose\00"
@str.5 = [75 x i8] c"5. Determinant\0A6. Cofactor\0A7. Check for Identity matrix\0A8. Inverse\0A9. Rank\00"
@str.6 = [46 x i8] c"Invalid Input! Enter a number between 1 to 9!\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.5, i64 0, i64 0))
%5 = bitcast i32* %1 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = add i32 %7, -1
%9 = icmp ult i32 %8, 9
br i1 %9, label %12, label %10
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.6, i64 0, i64 0))
br label %12
12: ; preds = %0, %10
ret i32 0
}