#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*/ dump_matrix(char *, int, int, int);
scalar_t__ strcmp(char *, char *);
int main(int nargs, char **argv) {
  int all = 0;
  int strict = 0;
  int magma = 0;
  if (nargs > 1 && (strcmp(argv[1], "-l") == 0)) {
    all = 1;
    strict = 0;
    nargs--;
    argv++;
  }
  if (nargs > 1 && (strcmp(argv[1], "-m") == 0)) {
    all = 1;
    strict = 0;
    magma = 1;
    nargs--;
    argv++;
  }
  if (nargs > 1 && (strcmp(argv[1], "-s") == 0)) {
    all = 1;
    strict = 1;
    nargs--;
    argv++;
  }
  {
    char *fic = (nargs > 1 ? argv[1] : "mat1");
    dump_matrix(fic, all, strict, magma);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1196 <main+0x76>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1196 <main+0x76>
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11e8 <main+0xc8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe54(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11e8 <main+0xc8>
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1233 <main+0x113>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe05(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1233 <main+0x113>
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    124e <main+0x12e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    125e <main+0x13e>
lea    0xdb4(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    125e <main+0x13e>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1030 <dump_matrix@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xeda(%rip),%r14
xor    %edx,%edx
cmp    $0x2,%edi
jl     1158 <main+0x38>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xeba(%rip),%rsi
call   1040 <strcmp@plt>
xor    %r15d,%r15d
test   %rax,%rax
je     1163 <main+0x43>
xor    %r12d,%r12d
jmp    1177 <main+0x57>
xor    %r12d,%r12d
xor    %r15d,%r15d
jmp    11e5 <main+0xc5>
add    $0xffffffff,%ebp
xor    %edx,%edx
mov    $0x1,%r12d
cmp    $0x2,%ebp
jb     11e2 <main+0xc2>
add    $0x8,%rbx
mov    0x8(%rbx),%rdi
lea    0xe81(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11a6 <main+0x86>
add    $0xffffffff,%ebp
xor    %edx,%edx
mov    $0x1,%r15d
cmp    $0x2,%ebp
jb     11da <main+0xba>
add    $0x8,%rbx
mov    $0x1,%r12d
mov    0x8(%rbx),%rdi
lea    0xe55(%rip),%rsi
call   1040 <strcmp@plt>
xor    %edx,%edx
test   %rax,%rax
jne    11d4 <main+0xb4>
add    $0xfffffffd,%ebp
mov    $0x1,%edx
cmp    $0xfffffffd,%ebp
ja     11da <main+0xba>
add    $0x8,%rbx
mov    $0x1,%r12d
mov    0x8(%rbx),%r14
jmp    11e5 <main+0xc5>
mov    $0x1,%r12d
jmp    11e5 <main+0xc5>
xor    %r15d,%r15d
mov    %r14,%rdi
mov    %r12d,%esi
mov    %r15d,%ecx
call   1030 <dump_matrix@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-l\00"
@.str.1 = [3 x i8] c"-m\00"
@.str.2 = [3 x i8] c"-s\00"
@.str.3 = [5 x i8] c"mat1\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %23
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %12
store i32 1, i32* %6
store i32 0, i32* %7
%19 = load i32, i32* %4
%20 = add nsw i32 %19, -1
store i32 %20, i32* %4
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i32 1
store i8** %22, i8*** %5
br label %23
23: ; preds = %18, %12, %2
%24 = load i32, i32* %4
%25 = icmp sgt i32 %24, 1
br i1 %25, label %26, label %37
26: ; preds = %23
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %26
store i32 1, i32* %6
store i32 0, i32* %7
store i32 1, i32* %8
%33 = load i32, i32* %4
%34 = add nsw i32 %33, -1
store i32 %34, i32* %4
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i32 1
store i8** %36, i8*** %5
br label %37
37: ; preds = %32, %26, %23
%38 = load i32, i32* %4
%39 = icmp sgt i32 %38, 1
br i1 %39, label %40, label %51
40: ; preds = %37
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 1
%43 = load i8*, i8** %42
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %51
46: ; preds = %40
store i32 1, i32* %6
store i32 1, i32* %7
%47 = load i32, i32* %4
%48 = add nsw i32 %47, -1
store i32 %48, i32* %4
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i32 1
store i8** %50, i8*** %5
br label %51
51: ; preds = %46, %40, %37
%52 = load i32, i32* %4
%53 = icmp sgt i32 %52, 1
br i1 %53, label %54, label %58
54: ; preds = %51
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 1
%57 = load i8*, i8** %56
br label %59
58: ; preds = %51
br label %59
59: ; preds = %58, %54
%60 = phi i8* [ %57, %54 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %58 ]
store i8* %60, i8** %9
%61 = load i8*, i8** %9
%62 = load i32, i32* %6
%63 = load i32, i32* %7
%64 = load i32, i32* %8
%65 = call i32 @dump_matrix(i8* %61, i32 %62, i32 %63, i32 %64)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-l\00"
@.str.1 = [3 x i8] c"-m\00"
@.str.2 = [3 x i8] c"-s\00"
@.str.3 = [5 x i8] c"mat1\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %41
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = add nsw i32 %0, -1
%11 = icmp ugt i32 %10, 1
br i1 %11, label %12, label %41
12: ; preds = %4, %9
%13 = phi i32 [ %10, %9 ], [ %0, %4 ]
%14 = phi i32 [ 1, %9 ], [ 0, %4 ]
%15 = phi i8** [ %5, %9 ], [ %1, %4 ]
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %12
%21 = add nsw i32 %13, -1
%22 = icmp ugt i32 %21, 1
br i1 %22, label %23, label %41
23: ; preds = %12, %20
%24 = phi i32 [ %21, %20 ], [ %13, %12 ]
%25 = phi i32 [ 1, %20 ], [ 0, %12 ]
%26 = phi i32 [ 1, %20 ], [ %14, %12 ]
%27 = phi i8** [ %16, %20 ], [ %15, %12 ]
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %23
%33 = add nsw i32 %24, -3
%34 = icmp ult i32 %33, -2
br i1 %34, label %35, label %41
35: ; preds = %23, %32
%36 = phi i32 [ 1, %32 ], [ 0, %23 ]
%37 = phi i32 [ 1, %32 ], [ %26, %23 ]
%38 = phi i8** [ %28, %32 ], [ %27, %23 ]
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
br label %41
41: ; preds = %2, %9, %20, %32, %35
%42 = phi i32 [ %36, %35 ], [ 1, %32 ], [ 0, %20 ], [ 0, %9 ], [ 0, %2 ]
%43 = phi i32 [ %37, %35 ], [ 1, %32 ], [ 1, %20 ], [ 1, %9 ], [ 0, %2 ]
%44 = phi i32 [ %25, %35 ], [ %25, %32 ], [ 1, %20 ], [ 0, %9 ], [ 0, %2 ]
%45 = phi i8* [ %40, %35 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %32 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %20 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %9 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %2 ]
%46 = tail call i32 @dump_matrix(i8* %45, i32 %43, i32 %42, i32 %44)
ret i32 0
}