#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*/ convertToBooleanMatrix(int **, int **);
int /*<<< orphan*/ initializeMatrix(int **);
int /*<<< orphan*/ logicalMultiplication(int **, int **, int **);
int /*<<< orphan*/ printMatrix(int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readMatrix(int **);
int main(void) {
  int matrix1[5][5], matrix2[5][5];
  int boolean_matrix1[5][5], boolean_matrix2[5][5];
  int result_matrix[5][5];
  initializeMatrix(matrix1);
  printf(
      "Please enter the values of the first 5x5 matrix, in a single line.\n");
  readMatrix(matrix1);
  initializeMatrix(matrix2);
  printf(
      "Please enter the values of the second 5x5 matrix, in a single line.\n");
  readMatrix(matrix2);
  convertToBooleanMatrix(matrix1, boolean_matrix1);
  convertToBooleanMatrix(matrix2, boolean_matrix2);
  printf("The boolean form of the matrices entered are:\n");
  printMatrix(boolean_matrix1);
  printf("\n");
  printMatrix(boolean_matrix2);
  logicalMultiplication(matrix1, matrix2, result_matrix);
  printf("The logical multiplication of the matrices is\n");
  printMatrix(result_matrix);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
call   1070 <initializeMatrix@plt>
lea    0xe7e(%rip),%rdi
call   1060 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <readMatrix@plt>
lea    -0xe0(%rbp),%rdi
call   1070 <initializeMatrix@plt>
lea    0xea1(%rip),%rdi
call   1060 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1040 <readMatrix@plt>
lea    -0x70(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   1050 <convertToBooleanMatrix@plt>
lea    -0xe0(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
call   1050 <convertToBooleanMatrix@plt>
lea    0xeab(%rip),%rdi
call   1060 <printf@plt>
lea    -0x150(%rbp),%rdi
call   1080 <printMatrix@plt>
lea    0xe91(%rip),%rdi
call   1060 <printf@plt>
lea    -0x1c0(%rbp),%rdi
call   1080 <printMatrix@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
lea    -0x230(%rbp),%rdx
call   1030 <logicalMultiplication@plt>
lea    0xe93(%rip),%rdi
call   1060 <printf@plt>
lea    -0x230(%rbp),%rdi
call   1080 <printMatrix@plt>
xor    %eax,%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x228,%rsp
lea    0x1c0(%rsp),%r14
mov    %r14,%rdi
call   1080 <initializeMatrix@plt>
lea    0xe6b(%rip),%rdi
call   1060 <puts@plt>
mov    %r14,%rdi
call   1050 <readMatrix@plt>
lea    0x150(%rsp),%r15
mov    %r15,%rdi
call   1080 <initializeMatrix@plt>
lea    0xe8a(%rip),%rdi
call   1060 <puts@plt>
mov    %r15,%rdi
call   1050 <readMatrix@plt>
lea    0xe0(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <convertToBooleanMatrix@plt>
lea    0x70(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <convertToBooleanMatrix@plt>
lea    0xe97(%rip),%rdi
call   1060 <puts@plt>
mov    %rbx,%rdi
call   1090 <printMatrix@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
call   1090 <printMatrix@plt>
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <logicalMultiplication@plt>
lea    0xe8e(%rip),%rdi
call   1060 <puts@plt>
mov    %rbx,%rdi
call   1090 <printMatrix@plt>
xor    %eax,%eax
add    $0x228,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [68 x i8] c"Please enter the values of the first 5x5 matrix, in a single line.\0A\00"
@.str.1 = [69 x i8] c"Please enter the values of the second 5x5 matrix, in a single line.\0A\00"
@.str.2 = [47 x i8] c"The boolean form of the matrices entered are:\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [47 x i8] c"The logical multiplication of the matrices is\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [5 x i32]]
%3 = alloca [5 x [5 x i32]]
%4 = alloca [5 x [5 x i32]]
%5 = alloca [5 x [5 x i32]]
%6 = alloca [5 x [5 x i32]]
store i32 0, i32* %1
%7 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%8 = bitcast [5 x i32]* %7 to i32**
%9 = call i32 @initializeMatrix(i32** %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%12 = bitcast [5 x i32]* %11 to i32**
%13 = call i32 @readMatrix(i32** %12)
%14 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 0
%15 = bitcast [5 x i32]* %14 to i32**
%16 = call i32 @initializeMatrix(i32** %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
%18 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 0
%19 = bitcast [5 x i32]* %18 to i32**
%20 = call i32 @readMatrix(i32** %19)
%21 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%22 = bitcast [5 x i32]* %21 to i32**
%23 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %4, i64 0, i64 0
%24 = bitcast [5 x i32]* %23 to i32**
%25 = call i32 @convertToBooleanMatrix(i32** %22, i32** %24)
%26 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 0
%27 = bitcast [5 x i32]* %26 to i32**
%28 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %5, i64 0, i64 0
%29 = bitcast [5 x i32]* %28 to i32**
%30 = call i32 @convertToBooleanMatrix(i32** %27, i32** %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%32 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %4, i64 0, i64 0
%33 = bitcast [5 x i32]* %32 to i32**
%34 = call i32 @printMatrix(i32** %33)
%35 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%36 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %5, i64 0, i64 0
%37 = bitcast [5 x i32]* %36 to i32**
%38 = call i32 @printMatrix(i32** %37)
%39 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%40 = bitcast [5 x i32]* %39 to i32**
%41 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 0
%42 = bitcast [5 x i32]* %41 to i32**
%43 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 0
%44 = bitcast [5 x i32]* %43 to i32**
%45 = call i32 @logicalMultiplication(i32** %40, i32** %42, i32** %44)
%46 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%47 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %6, i64 0, i64 0
%48 = bitcast [5 x i32]* %47 to i32**
%49 = call i32 @printMatrix(i32** %48)
ret i32 0
}

LLVM IR (-O2):
@str = [67 x i8] c"Please enter the values of the first 5x5 matrix, in a single line.\00"
@str.5 = [68 x i8] c"Please enter the values of the second 5x5 matrix, in a single line.\00"
@str.6 = [46 x i8] c"The boolean form of the matrices entered are:\00"
@str.7 = [46 x i8] c"The logical multiplication of the matrices is\00"
define i32 @main() {
%1 = alloca [5 x [5 x i32]]
%2 = alloca [5 x [5 x i32]]
%3 = alloca [5 x [5 x i32]]
%4 = alloca [5 x [5 x i32]]
%5 = alloca [5 x [5 x i32]]
%6 = bitcast [5 x [5 x i32]]* %1 to i8*
%7 = bitcast [5 x [5 x i32]]* %2 to i8*
%8 = bitcast [5 x [5 x i32]]* %3 to i8*
%9 = bitcast [5 x [5 x i32]]* %4 to i8*
%10 = bitcast [5 x [5 x i32]]* %5 to i8*
%11 = bitcast [5 x [5 x i32]]* %1 to i32**
%12 = call i32 @initializeMatrix(i32** %11)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%14 = call i32 @readMatrix(i32** %11)
%15 = bitcast [5 x [5 x i32]]* %2 to i32**
%16 = call i32 @initializeMatrix(i32** %15)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.5, i64 0, i64 0))
%18 = call i32 @readMatrix(i32** %15)
%19 = bitcast [5 x [5 x i32]]* %3 to i32**
%20 = call i32 @convertToBooleanMatrix(i32** %11, i32** %19)
%21 = bitcast [5 x [5 x i32]]* %4 to i32**
%22 = call i32 @convertToBooleanMatrix(i32** %15, i32** %21)
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.6, i64 0, i64 0))
%24 = call i32 @printMatrix(i32** %19)
%25 = call i32 @putchar(i32 10)
%26 = call i32 @printMatrix(i32** %21)
%27 = bitcast [5 x [5 x i32]]* %5 to i32**
%28 = call i32 @logicalMultiplication(i32** %11, i32** %15, i32** %27)
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.7, i64 0, i64 0))
%30 = call i32 @printMatrix(i32** %27)
ret i32 0
}