#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*/ assert(int);
int /*<<< orphan*/ printf(char *);
int test_add_cols_add_rows();
int test_allocate_matrix();
int test_allocate_matrix__calloc();
int test_constant();
int test_copy_matrix();
int test_hard_transpose();
int test_mat_mat_mul();
int test_matrix_to_str();
int test_parse_matrix();
int test_rand_matrix();
int test_read_file();
int test_select_cols_select_rows();
int test_write_file();
int main() {
  bool testcase = false;
  ;
  testcase = test_read_file();
  assert(testcase);
  ;
  testcase = test_write_file();
  assert(testcase);
  ;
  testcase = test_allocate_matrix();
  assert(testcase);
  ;
  testcase = test_allocate_matrix__calloc();
  assert(testcase);
  ;
  testcase = test_copy_matrix();
  assert(testcase);
  ;
  testcase = test_rand_matrix();
  assert(testcase);
  ;
  testcase = test_constant();
  assert(testcase);
  ;
  testcase = test_parse_matrix();
  assert(testcase);
  ;
  testcase = test_matrix_to_str();
  assert(testcase);
  ;
  testcase = test_mat_mat_mul();
  assert(testcase);
  ;
  testcase = test_hard_transpose();
  assert(testcase);
  ;
  testcase = test_add_cols_add_rows();
  assert(testcase);
  ;
  testcase = test_select_cols_select_rows();
  assert(testcase);
  ;
  printf("\n\n=== All tests passed ===\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   10c0 <test_read_file@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
mov    $0x0,%al
call   10d0 <test_write_file@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
mov    $0x0,%al
call   1100 <test_allocate_matrix@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
mov    $0x0,%al
call   1090 <test_allocate_matrix__calloc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
mov    $0x0,%al
call   1060 <test_copy_matrix@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
mov    $0x0,%al
call   1030 <test_rand_matrix@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
mov    $0x0,%al
call   1040 <test_constant@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
mov    $0x0,%al
call   10b0 <test_parse_matrix@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
mov    $0x0,%al
call   10a0 <test_matrix_to_str@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
mov    $0x0,%al
call   10e0 <test_mat_mat_mul@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
mov    $0x0,%al
call   10f0 <test_hard_transpose@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
mov    $0x0,%al
call   1110 <test_add_cols_add_rows@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
mov    $0x0,%al
call   1070 <test_select_cols_select_rows@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1080 <assert@plt>
lea    0xd09(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10c0 <test_read_file@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %eax,%eax
call   10d0 <test_write_file@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %eax,%eax
call   1100 <test_allocate_matrix@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %eax,%eax
call   1090 <test_allocate_matrix__calloc@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %eax,%eax
call   1060 <test_copy_matrix@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %eax,%eax
call   1030 <test_rand_matrix@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %eax,%eax
call   1050 <test_constant@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %eax,%eax
call   10b0 <test_parse_matrix@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %eax,%eax
call   10a0 <test_matrix_to_str@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %eax,%eax
call   10e0 <test_mat_mat_mul@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %eax,%eax
call   10f0 <test_hard_transpose@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %eax,%eax
call   1110 <test_add_cols_add_rows@plt>
mov    %eax,%edi
call   1080 <assert@plt>
xor    %eax,%eax
call   1070 <test_select_cols_select_rows@plt>
mov    %eax,%edi
call   1080 <assert@plt>
lea    0xd52(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\0A\0A=== All tests passed ===\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @test_read_file()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @assert(i32 %4)
%6 = call i32 (...) @test_write_file()
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @assert(i32 %7)
%9 = call i32 (...) @test_allocate_matrix()
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @assert(i32 %10)
%12 = call i32 (...) @test_allocate_matrix__calloc()
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = call i32 @assert(i32 %13)
%15 = call i32 (...) @test_copy_matrix()
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = call i32 @assert(i32 %16)
%18 = call i32 (...) @test_rand_matrix()
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = call i32 @assert(i32 %19)
%21 = call i32 (...) @test_constant()
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = call i32 @assert(i32 %22)
%24 = call i32 (...) @test_parse_matrix()
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = call i32 @assert(i32 %25)
%27 = call i32 (...) @test_matrix_to_str()
store i32 %27, i32* %2
%28 = load i32, i32* %2
%29 = call i32 @assert(i32 %28)
%30 = call i32 (...) @test_mat_mat_mul()
store i32 %30, i32* %2
%31 = load i32, i32* %2
%32 = call i32 @assert(i32 %31)
%33 = call i32 (...) @test_hard_transpose()
store i32 %33, i32* %2
%34 = load i32, i32* %2
%35 = call i32 @assert(i32 %34)
%36 = call i32 (...) @test_add_cols_add_rows()
store i32 %36, i32* %2
%37 = load i32, i32* %2
%38 = call i32 @assert(i32 %37)
%39 = call i32 (...) @test_select_cols_select_rows()
store i32 %39, i32* %2
%40 = load i32, i32* %2
%41 = call i32 @assert(i32 %40)
%42 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"\0A\0A=== All tests passed ===\00"
define i32 @main() {
%1 = tail call i32 (...) @test_read_file()
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 (...) @test_write_file()
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (...) @test_allocate_matrix()
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 (...) @test_allocate_matrix__calloc()
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 (...) @test_copy_matrix()
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 (...) @test_rand_matrix()
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 (...) @test_constant()
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 (...) @test_parse_matrix()
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 (...) @test_matrix_to_str()
%18 = tail call i32 @assert(i32 %17)
%19 = tail call i32 (...) @test_mat_mat_mul()
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 (...) @test_hard_transpose()
%22 = tail call i32 @assert(i32 %21)
%23 = tail call i32 (...) @test_add_cols_add_rows()
%24 = tail call i32 @assert(i32 %23)
%25 = tail call i32 (...) @test_select_cols_select_rows()
%26 = tail call i32 @assert(i32 %25)
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}