#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ convert_new2old(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ convert_old2new(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ *ouvrir(char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
char *strrchr(char *, char);
int /*<<< orphan*/ usage(char *);
int main(int ac, char **av) {
  int new = 0;
  int sor = 1;
  int rev = 1;
  if (ac < 2 || ac > 5) {
    usage(av[0]);
    exit(-1);
  }
  int options = 1;
  int fli_compatible = 0;
  while (options) {
    if ((strcmp(av[1], "-h") == 0) || (strcmp(av[1], "-?") == 0) ||
        (strcmp(av[1], "--help") == 0)) {
      usage(av[0]);
      return (0);
    }
    if (strcmp(av[1], "-n") == 0 || strcmp(av[1], "-f") == 0) {
      new = 1;
      if (strcmp(av[1], "-f") == 0)
        fli_compatible = 1;
      av++;
      ac--;
    } else if (strcmp(av[1], "-s") == 0) {
      sor = 1;
      av++;
      ac--;
    } else if (strcmp(av[1], "-S") == 0) {
      sor = 0;
      av++;
      ac--;
    } else if (strcmp(av[1], "-r") == 0) {
      rev = 1;
      av++;
      ac--;
    } else if (strcmp(av[1], "-R") == 0) {
      rev = 0;
      av++;
      ac--;
    } else
      options = 0;
  }
  fprintf(stderr, " rows are: Sorted: %s  ; Reverted: %s\n",
          (sor ? "yes" : "no"), (rev ? "yes" : "no"));
  FILE *titi;
  if (ac != 2) {
    usage(av[0]);
    exit(-1);
  }
  char *in = av[ac - 1];
  titi = ouvrir(in, "r");
  fprintf(stderr, "converting matrix %s", in);
  if (new == 0) {
    fprintf(stderr, " (from old to new)\n");
    convert_old2new(titi, rev, sor);
  } else {
    fprintf(stderr, " (from new to old)\n");
    if (strcmp(in, "-") != 0) {
      char *found = strrchr(in, '.');
      if (!found || strcmp(found, ".gbm") != 0) {
        fprintf(stderr,
                "warning : file %s has incorrect extension. Expects .gbm\n",
                in);
      }
    }
    convert_new2old(titi, fli_compatible);
  }
  fprintf(stderr, "created file from %s\n", in);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     11bf <main+0x3f>
cmpl   $0x5,-0x8(%rbp)
jle    11d5 <main+0x55>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <usage@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
movl   $0x1,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     13fd <main+0x27d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe04(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1247 <main+0xc7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde9(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1247 <main+0xc7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdce(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    125f <main+0xdf>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1593 <main+0x413>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd9f(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     129b <main+0x11b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd84(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12e1 <main+0x161>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd5f(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12c7 <main+0x147>
movl   $0x1,-0x24(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    13f8 <main+0x278>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd23(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1320 <main+0x1a0>
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    13f3 <main+0x273>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xce7(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    135f <main+0x1df>
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    13ee <main+0x26e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcab(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    139e <main+0x21e>
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    13e9 <main+0x269>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc6f(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13dd <main+0x25d>
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    13e4 <main+0x264>
movl   $0x0,-0x20(%rbp)
jmp    13e9 <main+0x269>
jmp    13ee <main+0x26e>
jmp    13f3 <main+0x273>
jmp    13f8 <main+0x278>
jmp    11e3 <main+0x63>
mov    0x2bdc(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%ecx
lea    0xc3a(%rip),%rdx
lea    0xc2f(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
mov    -0x1c(%rbp),%esi
lea    0xc22(%rip),%rcx
lea    0xc17(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rcx
lea    0xbe2(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
cmpl   $0x2,-0x8(%rbp)
je     1464 <main+0x2e4>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <usage@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xb96(%rip),%rsi
call   1040 <ouvrir@plt>
mov    %rax,-0x30(%rbp)
mov    0x2b4c(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
lea    0xbac(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    14dd <main+0x35d>
mov    0x2b27(%rip),%rax
mov    (%rax),%edi
lea    0xba0(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <convert_old2new@plt>
jmp    1571 <main+0x3f1>
mov    0x2afc(%rip),%rax
mov    (%rax),%edi
lea    0xb89(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xb8b(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1565 <main+0x3e5>
mov    -0x38(%rbp),%rdi
mov    $0x2e,%esi
call   1050 <strrchr@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1545 <main+0x3c5>
mov    -0x40(%rbp),%rdi
lea    0xb56(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1560 <main+0x3e0>
mov    0x2a94(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
lea    0xb38(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    1565 <main+0x3e5>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1060 <convert_new2old@plt>
mov    0x2a68(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
lea    0xb45(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
mov    %edi,%ebx
lea    -0x6(%rbx),%eax
cmp    $0xfffffffc,%eax
jb     1426 <main+0x2a6>
mov    0x8(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12f7 <main+0x177>
add    $0xfffffffe,%ebx
movl   $0x1,0x4(%rsp)
xor    %r15d,%r15d
lea    0xe39(%rip),%r13
lea    0xe3f(%rip),%r14
movl   $0x1,(%rsp)
xor    %r12d,%r12d
jmp    1219 <main+0x99>
nopl   (%rax)
mov    0x8(%rbp),%rdi
mov    %r14,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
mov    $0x1,%r15d
cmove  %r15d,%r12d
mov    0x10(%rbp),%rdi
lea    0xdfc(%rip),%rsi
call   1070 <strcmp@plt>
add    $0x8,%rbp
add    $0xffffffff,%ebx
test   %rax,%rax
je     12f7 <main+0x177>
mov    0x8(%rbp),%rdi
mov    %r13,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12f7 <main+0x177>
mov    0x8(%rbp),%rdi
lea    0xdcd(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12f7 <main+0x177>
mov    0x8(%rbp),%rdi
lea    0xdbb(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     11e0 <main+0x60>
mov    0x8(%rbp),%rdi
mov    %r14,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     11e0 <main+0x60>
mov    0x8(%rbp),%rdi
lea    0xd97(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12d1 <main+0x151>
mov    0x8(%rbp),%rdi
lea    0xd85(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12de <main+0x15e>
mov    0x8(%rbp),%rdi
lea    0xd73(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12eb <main+0x16b>
mov    0x8(%rbp),%rdi
lea    0xd61(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    1311 <main+0x191>
movl   $0x0,(%rsp)
jmp    11f9 <main+0x79>
movl   $0x1,0x4(%rsp)
jmp    11f9 <main+0x79>
movl   $0x0,0x4(%rsp)
jmp    11f9 <main+0x79>
movl   $0x1,(%rsp)
jmp    11f9 <main+0x79>
mov    0x0(%rbp),%rdi
call   1090 <usage@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2cc8(%rip),%r14
mov    0x4(%rsp),%r13d
test   %r13d,%r13d
lea    0xd23(%rip),%rax
lea    0xd18(%rip),%rcx
mov    %rcx,%rdx
cmove  %rax,%rdx
mov    (%r14),%edi
cmpl   $0x0,(%rsp)
cmove  %rax,%rcx
lea    0xcd8(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
test   %ebx,%ebx
jne    1426 <main+0x2a6>
mov    0x8(%rbp),%rbx
lea    0xcb9(%rip),%rsi
mov    %rbx,%rdi
call   1040 <ouvrir@plt>
mov    %rax,%rbp
mov    (%r14),%edi
lea    0xcd7(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%r14),%edi
test   %r15d,%r15d
je     13f1 <main+0x271>
lea    0xce7(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xced(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     13e4 <main+0x264>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
je     13d0 <main+0x250>
lea    0xcc9(%rip),%rsi
mov    %rax,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     13e4 <main+0x264>
mov    (%r14),%edi
lea    0xcb7(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
call   1060 <convert_new2old@plt>
jmp    140d <main+0x28d>
lea    0xc6a(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbp,%rdi
mov    (%rsp),%esi
mov    %r13d,%edx
call   1030 <convert_old2new@plt>
mov    (%r14),%edi
lea    0xcb3(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1300 <main+0x180>
mov    0x0(%rbp),%rdi
call   1090 <usage@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
@.str.1 = [3 x i8] c"-?\00"
@.str.2 = [7 x i8] c"--help\00"
@.str.3 = [3 x i8] c"-n\00"
@.str.4 = [3 x i8] c"-f\00"
@.str.5 = [3 x i8] c"-s\00"
@.str.6 = [3 x i8] c"-S\00"
@.str.7 = [3 x i8] c"-r\00"
@.str.8 = [3 x i8] c"-R\00"
@stderr = global i32 0
@.str.9 = [39 x i8] c" rows are: Sorted: %s ; Reverted: %s\0A\00"
@.str.10 = [4 x i8] c"yes\00"
@.str.11 = [3 x i8] c"no\00"
@.str.12 = [2 x i8] c"r\00"
@.str.13 = [21 x i8] c"converting matrix %s\00"
@.str.14 = [20 x i8] c" (from old to new)\0A\00"
@.str.15 = [20 x i8] c" (from new to old)\0A\00"
@.str.16 = [2 x i8] c"-\00"
@.str.17 = [5 x i8] c".gbm\00"
@.str.18 = [57 x i8] c"warning : file %s has incorrect extension. Expects .gbm\0A\00"
@.str.19 = [22 x i8] c"created file from %s\0A\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 i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i8*
%13 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %7
store i32 1, i32* %8
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 2
br i1 %15, label %19, label %16
16: ; preds = %2
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 5
br i1 %18, label %19, label %25
19: ; preds = %16, %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 @usage(i8* %22)
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %16
store i32 1, i32* %9
store i32 0, i32* %10
br label %26
26: ; preds = %125, %25
%27 = load i32, i32* %9
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %126
29: ; preds = %26
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %47, label %35
35: ; preds = %29
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %47, label %41
41: ; preds = %35
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %52
47: ; preds = %41, %35, %29
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 0
%50 = load i8*, i8** %49
%51 = call i32 @usage(i8* %50)
store i32 0, i32* %3
br label %194
52: ; preds = %41
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 1
%55 = load i8*, i8** %54
%56 = call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %64, label %58
58: ; preds = %52
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 1
%61 = load i8*, i8** %60
%62 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %76
64: ; preds = %58, %52
store i32 1, i32* %6
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %71
70: ; preds = %64
store i32 1, i32* %10
br label %71
71: ; preds = %70, %64
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i32 1
store i8** %73, i8*** %5
%74 = load i32, i32* %4
%75 = add nsw i32 %74, -1
store i32 %75, i32* %4
br label %125
76: ; preds = %58
%77 = load i8**, i8*** %5
%78 = getelementptr inbounds i8*, i8** %77, i64 1
%79 = load i8*, i8** %78
%80 = call i64 @strcmp(i8* %79, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %87
82: ; preds = %76
store i32 1, i32* %7
%83 = load i8**, i8*** %5
%84 = getelementptr inbounds i8*, i8** %83, i32 1
store i8** %84, i8*** %5
%85 = load i32, i32* %4
%86 = add nsw i32 %85, -1
store i32 %86, i32* %4
br label %124
87: ; preds = %76
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 1
%90 = load i8*, i8** %89
%91 = call i64 @strcmp(i8* %90, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%92 = icmp eq i64 %91, 0
br i1 %92, label %93, label %98
93: ; preds = %87
store i32 0, i32* %7
%94 = load i8**, i8*** %5
%95 = getelementptr inbounds i8*, i8** %94, i32 1
store i8** %95, i8*** %5
%96 = load i32, i32* %4
%97 = add nsw i32 %96, -1
store i32 %97, i32* %4
br label %123
98: ; preds = %87
%99 = load i8**, i8*** %5
%100 = getelementptr inbounds i8*, i8** %99, i64 1
%101 = load i8*, i8** %100
%102 = call i64 @strcmp(i8* %101, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%103 = icmp eq i64 %102, 0
br i1 %103, label %104, label %109
104: ; preds = %98
store i32 1, i32* %8
%105 = load i8**, i8*** %5
%106 = getelementptr inbounds i8*, i8** %105, i32 1
store i8** %106, i8*** %5
%107 = load i32, i32* %4
%108 = add nsw i32 %107, -1
store i32 %108, i32* %4
br label %122
109: ; preds = %98
%110 = load i8**, i8*** %5
%111 = getelementptr inbounds i8*, i8** %110, i64 1
%112 = load i8*, i8** %111
%113 = call i64 @strcmp(i8* %112, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%114 = icmp eq i64 %113, 0
br i1 %114, label %115, label %120
115: ; preds = %109
store i32 0, i32* %8
%116 = load i8**, i8*** %5
%117 = getelementptr inbounds i8*, i8** %116, i32 1
store i8** %117, i8*** %5
%118 = load i32, i32* %4
%119 = add nsw i32 %118, -1
store i32 %119, i32* %4
br label %121
120: ; preds = %109
store i32 0, i32* %9
br label %121
121: ; preds = %120, %115
br label %122
122: ; preds = %121, %104
br label %123
123: ; preds = %122, %93
br label %124
124: ; preds = %123, %82
br label %125
125: ; preds = %124, %71
br label %26
126: ; preds = %26
%127 = load i32, i32* @stderr
%128 = load i32, i32* %7
%129 = icmp ne i32 %128, 0
%130 = zext i1 %129 to i64
%131 = select i1 %129, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0)
%132 = load i32, i32* %8
%133 = icmp ne i32 %132, 0
%134 = zext i1 %133 to i64
%135 = select i1 %133, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0)
%136 = call i32 (i32, i8*, ...) @fprintf(i32 %127, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i8* %131, i8* %135)
%137 = load i32, i32* %4
%138 = icmp ne i32 %137, 2
br i1 %138, label %139, label %145
139: ; preds = %126
%140 = load i8**, i8*** %5
%141 = getelementptr inbounds i8*, i8** %140, i64 0
%142 = load i8*, i8** %141
%143 = call i32 @usage(i8* %142)
%144 = call i32 @exit(i32 -1)
unreachable
145: ; preds = %126
%146 = load i8**, i8*** %5
%147 = load i32, i32* %4
%148 = sub nsw i32 %147, 1
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8*, i8** %146, i64 %149
%151 = load i8*, i8** %150
store i8* %151, i8** %12
%152 = load i8*, i8** %12
%153 = call i32* @ouvrir(i8* %152, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32* %153, i32** %11
%154 = load i32, i32* @stderr
%155 = load i8*, i8** %12
%156 = call i32 (i32, i8*, ...) @fprintf(i32 %154, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), i8* %155)
%157 = load i32, i32* %6
%158 = icmp eq i32 %157, 0
br i1 %158, label %159, label %166
159: ; preds = %145
%160 = load i32, i32* @stderr
%161 = call i32 (i32, i8*, ...) @fprintf(i32 %160, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0))
%162 = load i32*, i32** %11
%163 = load i32, i32* %8
%164 = load i32, i32* %7
%165 = call i32 @convert_old2new(i32* %162, i32 %163, i32 %164)
br label %190
166: ; preds = %145
%167 = load i32, i32* @stderr
%168 = call i32 (i32, i8*, ...) @fprintf(i32 %167, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0))
%169 = load i8*, i8** %12
%170 = call i64 @strcmp(i8* %169, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%171 = icmp ne i64 %170, 0
br i1 %171, label %172, label %186
172: ; preds = %166
%173 = load i8*, i8** %12
%174 = call i8* @strrchr(i8* %173, i8 signext 46)
store i8* %174, i8** %13
%175 = load i8*, i8** %13
%176 = icmp ne i8* %175, null
br i1 %176, label %177, label %181
177: ; preds = %172
%178 = load i8*, i8** %13
%179 = call i64 @strcmp(i8* %178, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
%180 = icmp ne i64 %179, 0
br i1 %180, label %181, label %185
181: ; preds = %177, %172
%182 = load i32, i32* @stderr
%183 = load i8*, i8** %12
%184 = call i32 (i32, i8*, ...) @fprintf(i32 %182, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.18, i64 0, i64 0), i8* %183)
br label %185
185: ; preds = %181, %177
br label %186
186: ; preds = %185, %166
%187 = load i32*, i32** %11
%188 = load i32, i32* %10
%189 = call i32 @convert_new2old(i32* %187, i32 %188)
br label %190
190: ; preds = %186, %159
%191 = load i32, i32* @stderr
%192 = load i8*, i8** %12
%193 = call i32 (i32, i8*, ...) @fprintf(i32 %191, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.19, i64 0, i64 0), i8* %192)
store i32 0, i32* %3
br label %194
194: ; preds = %190, %47
%195 = load i32, i32* %3
ret i32 %195
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
@.str.1 = [3 x i8] c"-?\00"
@.str.2 = [7 x i8] c"--help\00"
@.str.3 = [3 x i8] c"-n\00"
@.str.4 = [3 x i8] c"-f\00"
@.str.5 = [3 x i8] c"-s\00"
@.str.6 = [3 x i8] c"-S\00"
@.str.7 = [3 x i8] c"-r\00"
@.str.8 = [3 x i8] c"-R\00"
@stderr = global i32 0
@.str.9 = [39 x i8] c" rows are: Sorted: %s ; Reverted: %s\0A\00"
@.str.10 = [4 x i8] c"yes\00"
@.str.11 = [3 x i8] c"no\00"
@.str.12 = [2 x i8] c"r\00"
@.str.13 = [21 x i8] c"converting matrix %s\00"
@.str.14 = [20 x i8] c" (from old to new)\0A\00"
@.str.15 = [20 x i8] c" (from new to old)\0A\00"
@.str.16 = [2 x i8] c"-\00"
@.str.17 = [5 x i8] c".gbm\00"
@.str.18 = [57 x i8] c"warning : file %s has incorrect extension. Expects .gbm\0A\00"
@.str.19 = [22 x i8] c"created file from %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add i32 %0, -6
%4 = icmp ult i32 %3, -4
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %29, label %14
10: ; preds = %2
%11 = load i8*, i8** %1
%12 = tail call i32 @usage(i8* %11)
%13 = tail call i32 @exit(i32 -1)
unreachable
14: ; preds = %5, %62
%15 = phi i8** [ %68, %62 ], [ %6, %5 ]
%16 = phi i32 [ %63, %62 ], [ 0, %5 ]
%17 = phi i32 [ %64, %62 ], [ 1, %5 ]
%18 = phi i32 [ %65, %62 ], [ 1, %5 ]
%19 = phi i32 [ %66, %62 ], [ 0, %5 ]
%20 = phi i8** [ %15, %62 ], [ %1, %5 ]
%21 = phi i32 [ %67, %62 ], [ %0, %5 ]
%22 = load i8*, i8** %15
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %14
%26 = load i8*, i8** %15
%27 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %62, %14, %25, %5
%30 = phi i8** [ %1, %5 ], [ %15, %62 ], [ %20, %14 ], [ %20, %25 ]
%31 = load i8*, i8** %30
%32 = tail call i32 @usage(i8* %31)
br label %113
33: ; preds = %25
%34 = load i8*, i8** %15
%35 = tail call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %41, label %37
37: ; preds = %33
%38 = load i8*, i8** %15
%39 = tail call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %46
41: ; preds = %37, %33
%42 = load i8*, i8** %15
%43 = tail call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
%45 = select i1 %44, i32 1, i32 %19
br label %62
46: ; preds = %37
%47 = load i8*, i8** %15
%48 = tail call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %62, label %50
50: ; preds = %46
%51 = load i8*, i8** %15
%52 = tail call i64 @strcmp(i8* %51, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %62, label %54
54: ; preds = %50
%55 = load i8*, i8** %15
%56 = tail call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %62, label %58
58: ; preds = %54
%59 = load i8*, i8** %15
%60 = tail call i64 @strcmp(i8* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %72
62: ; preds = %58, %54, %50, %46, %41
%63 = phi i32 [ 1, %41 ], [ %16, %46 ], [ %16, %50 ], [ %16, %54 ], [ %16, %58 ]
%64 = phi i32 [ %17, %41 ], [ 1, %46 ], [ 0, %50 ], [ %17, %54 ], [ %17, %58 ]
%65 = phi i32 [ %18, %41 ], [ %18, %46 ], [ %18, %50 ], [ 1, %54 ], [ 0, %58 ]
%66 = phi i32 [ %45, %41 ], [ %19, %46 ], [ %19, %50 ], [ %19, %54 ], [ %19, %58 ]
%67 = add nsw i32 %21, -1
%68 = getelementptr inbounds i8*, i8** %15, i64 1
%69 = load i8*, i8** %68
%70 = tail call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %29, label %14
72: ; preds = %58
%73 = load i32, i32* @stderr
%74 = icmp eq i32 %17, 0
%75 = select i1 %74, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0)
%76 = icmp eq i32 %18, 0
%77 = select i1 %76, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0)
%78 = tail call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i8* %75, i8* %77)
%79 = icmp eq i32 %21, 2
br i1 %79, label %84, label %80
80: ; preds = %72
%81 = load i8*, i8** %20
%82 = tail call i32 @usage(i8* %81)
%83 = tail call i32 @exit(i32 -1)
unreachable
84: ; preds = %72
%85 = getelementptr inbounds i8*, i8** %20, i64 1
%86 = load i8*, i8** %85
%87 = tail call i32* @ouvrir(i8* %86, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%88 = load i32, i32* @stderr
%89 = tail call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), i8* %86)
%90 = icmp eq i32 %16, 0
%91 = load i32, i32* @stderr
br i1 %90, label %92, label %95
92: ; preds = %84
%93 = tail call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0))
%94 = tail call i32 @convert_old2new(i32* %87, i32 %18, i32 %17)
br label %110
95: ; preds = %84
%96 = tail call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0))
%97 = tail call i64 @strcmp(i8* %86, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%98 = icmp eq i64 %97, 0
br i1 %98, label %108, label %99
99: ; preds = %95
%100 = tail call i8* @strrchr(i8* dereferenceable(1) %86, i8 signext 46)
%101 = icmp eq i8* %100, null
br i1 %101, label %105, label %102
102: ; preds = %99
%103 = tail call i64 @strcmp(i8* %100, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
%104 = icmp eq i64 %103, 0
br i1 %104, label %108, label %105
105: ; preds = %102, %99
%106 = load i32, i32* @stderr
%107 = tail call i32 (i32, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.18, i64 0, i64 0), i8* %86)
br label %108
108: ; preds = %102, %105, %95
%109 = tail call i32 @convert_new2old(i32* %87, i32 %19)
br label %110
110: ; preds = %108, %92
%111 = load i32, i32* @stderr
%112 = tail call i32 (i32, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.19, i64 0, i64 0), i8* %86)
br label %113
113: ; preds = %110, %29
ret i32 0
}