#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 */
struct option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ *member_2;
  int /*<<< orphan*/ member_1;
};

/* Variables and functions */
int /*<<< orphan*/ BFS(char *, char *, char *, char *);
int /*<<< orphan*/ Dij(char *, char *, char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *const, ...);
int getopt_long(int, char *const *, char const *, struct option *,
                int /*<<< orphan*/ *);
int /*<<< orphan*/ no_argument;
char *optarg;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ required_argument;
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *const argv[]) {
  int c;
  char *file_name;
  char *E;
  char *O;
  char *size;
  const char *short_opt = ":h:f:m:z:s:e:";
  struct option long_opt[] = {{"help", no_argument, NULL, 'h'},
                              {"file", required_argument, NULL, 'f'},
                              {"size", required_argument, NULL, 'z'},
                              {"start", required_argument, NULL, 's'},
                              {"end", required_argument, NULL, 'e'},
                              {"mode", required_argument, NULL, 'm'},
                              {NULL, 0, NULL, 0}};
  while ((c = getopt_long(argc, argv, short_opt, long_opt, NULL)) != -1) {
    switch (c) {
    case -1:
    case 0:
      break;
    case 'f':
      file_name = optarg;
      break;
    case 'e':
      E = optarg;
      break;
    case 's':
      O = optarg;
      break;
    case 'z':
      size = optarg;
      break;
    case 'm':
      if (strcmp(optarg, "BFS") == 0) {
        BFS(size, file_name, O, E);
      } else if (strcmp(optarg, "Dij") == 0) {
        Dij(size, file_name, O, E);
      }
      break;
    case 'h':
      printf("Usage: %s [OPTIONS]\n", argv[0]);
      printf("  -m, --mode                mode BFS or Dijkstra   (ex: -m BFS / "
             "-m Dij)\n");
      printf("  -f, --file                file to construct laby (ex:  "
             "m_file/fichier.txt)\n");
      printf("  -z, --size                size of the labyrinth\n");
      printf("  -s, --start               Robby start case\n");
      printf("  -e, --end                 Robby end case\n");
      printf("  -h, --help                print help and exit\n");
      printf("\n");
      return (0);
    case ':':
    case '?':
      fprintf(stderr, "Try `%s --help' for more information.\n", argv[0]);
      return (-1);
    default:
      fprintf(stderr, "%s: invalid option -- %c\n", argv[0], c);
      fprintf(stderr, "Try `%s --help' for more information.", argv[0]);
      return (-1);
    };
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe70(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    -0x120(%rbp),%rdi
lea    0xe6c(%rip),%rax
mov    %rax,-0x120(%rbp)
mov    0x2e18(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x118(%rbp)
movq   $0x0,-0x110(%rbp)
movl   $0x68,-0x108(%rbp)
add    $0x20,%rdi
lea    0xe3b(%rip),%rax
mov    %rax,-0x100(%rbp)
mov    0x2dfa(%rip),%rax
mov    (%rax),%eax
mov    %al,-0xf8(%rbp)
movq   $0x0,-0xf0(%rbp)
movl   $0x66,-0xe8(%rbp)
add    $0x20,%rdi
lea    0xe0a(%rip),%rax
mov    %rax,-0xe0(%rbp)
mov    0x2dc4(%rip),%rax
mov    (%rax),%eax
mov    %al,-0xd8(%rbp)
movq   $0x0,-0xd0(%rbp)
movl   $0x7a,-0xc8(%rbp)
add    $0x20,%rdi
lea    0xdd9(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0x2d8e(%rip),%rax
mov    (%rax),%eax
mov    %al,-0xb8(%rbp)
movq   $0x0,-0xb0(%rbp)
movl   $0x73,-0xa8(%rbp)
add    $0x20,%rdi
lea    0xda9(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0x2d58(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x98(%rbp)
movq   $0x0,-0x90(%rbp)
movl   $0x65,-0x88(%rbp)
add    $0x20,%rdi
lea    0xd77(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0x2d25(%rip),%rax
mov    (%rax),%eax
mov    %al,-0x78(%rbp)
movq   $0x0,-0x70(%rbp)
movl   $0x6d,-0x68(%rbp)
add    $0x20,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1070 <memset@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x40(%rbp),%rdx
lea    -0x120(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1050 <getopt_long@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1586 <main+0x416>
mov    -0x14(%rbp),%eax
mov    %eax,-0x124(%rbp)
add    $0x1,%eax
sub    $0x2,%eax
jb     13c1 <main+0x251>
jmp    1321 <main+0x1b1>
mov    -0x124(%rbp),%eax
sub    $0x3a,%eax
je     150c <main+0x39c>
jmp    1335 <main+0x1c5>
mov    -0x124(%rbp),%eax
sub    $0x3f,%eax
je     150c <main+0x39c>
jmp    1349 <main+0x1d9>
mov    -0x124(%rbp),%eax
sub    $0x65,%eax
je     13d9 <main+0x269>
jmp    135d <main+0x1ed>
mov    -0x124(%rbp),%eax
sub    $0x66,%eax
je     13c6 <main+0x256>
jmp    1371 <main+0x201>
mov    -0x124(%rbp),%eax
sub    $0x68,%eax
je     1489 <main+0x319>
jmp    1385 <main+0x215>
mov    -0x124(%rbp),%eax
sub    $0x6d,%eax
je     1412 <main+0x2a2>
jmp    1399 <main+0x229>
mov    -0x124(%rbp),%eax
sub    $0x73,%eax
je     13ec <main+0x27c>
jmp    13ad <main+0x23d>
mov    -0x124(%rbp),%eax
sub    $0x7a,%eax
je     13ff <main+0x28f>
jmp    1536 <main+0x3c6>
jmp    1581 <main+0x411>
mov    0x2c2b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1581 <main+0x411>
mov    0x2c18(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    1581 <main+0x411>
mov    0x2c05(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    1581 <main+0x411>
mov    0x2bf2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    1581 <main+0x411>
mov    0x2bdf(%rip),%rax
mov    (%rax),%rdi
lea    0xc09(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    144b <main+0x2db>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <BFS@plt>
jmp    1484 <main+0x314>
mov    0x2ba6(%rip),%rax
mov    (%rax),%rdi
lea    0xbd4(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    147f <main+0x30f>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <Dij@plt>
jmp    1484 <main+0x314>
jmp    1581 <main+0x411>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xb9d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xba4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xbe0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc20(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc45(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc65(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc83(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb98(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    158d <main+0x41d>
mov    0x2abd(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xc7c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    158d <main+0x41d>
mov    0x2a93(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x14(%rbp),%ecx
lea    0xc76(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2a72(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xc72(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    158d <main+0x41d>
jmp    12df <main+0x16f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rsi,%r15
mov    %edi,%r14d
lea    0xf74(%rip),%rax
mov    %rax,0x30(%rsp)
mov    0x2e1e(%rip),%rax
mov    (%rax),%al
mov    %al,0x38(%rsp)
movq   $0x0,0x40(%rsp)
movl   $0x68,0x48(%rsp)
lea    0xf4f(%rip),%rax
mov    %rax,0x50(%rsp)
mov    0x2e0c(%rip),%rax
mov    (%rax),%al
mov    %al,0x58(%rsp)
movq   $0x0,0x60(%rsp)
movl   $0x66,0x68(%rsp)
lea    0xf2a(%rip),%rcx
mov    %rcx,0x70(%rsp)
mov    %al,0x78(%rsp)
movq   $0x0,0x80(%rsp)
movl   $0x7a,0x88(%rsp)
lea    0xf08(%rip),%rcx
mov    %rcx,0x90(%rsp)
mov    %al,0x98(%rsp)
movq   $0x0,0xa0(%rsp)
movl   $0x73,0xa8(%rsp)
lea    0xee1(%rip),%rcx
mov    %rcx,0xb0(%rsp)
mov    %al,0xb8(%rsp)
movq   $0x0,0xc0(%rsp)
movl   $0x65,0xc8(%rsp)
lea    0xeb8(%rip),%rcx
mov    %rcx,0xd0(%rsp)
mov    %al,0xd8(%rsp)
movq   $0x0,0xe0(%rsp)
movl   $0x6d,0xe8(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
lea    0xe51(%rip),%rbp
lea    0x30(%rsp),%rbx
lea    0xd41(%rip),%r12
mov    0x2d32(%rip),%r13
mov    %rsi,0x8(%rsp)
jmp    12e0 <main+0x160>
mov    0x0(%r13),%rax
mov    %rax,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %rbx,%rcx
xor    %r8d,%r8d
call   1070 <getopt_long@plt>
lea    -0x3a(%rax),%ecx
cmp    $0x40,%ecx
ja     1310 <main+0x190>
movslq (%r12,%rcx,4),%rcx
add    %r12,%rcx
jmp    *%rcx
mov    0x0(%r13),%rax
mov    %rax,0x20(%rsp)
jmp    12e0 <main+0x160>
test   %eax,%eax
je     12e0 <main+0x160>
jmp    13d1 <main+0x251>
mov    0x0(%r13),%rax
mov    %rax,0x28(%rsp)
jmp    12e0 <main+0x160>
mov    %r13,%r15
mov    %r13,%rbx
mov    0x0(%r13),%r13
mov    %r13,%rdi
lea    0xdf8(%rip),%rsi
call   1090 <strcmp@plt>
test   %eax,%eax
je     1391 <main+0x211>
mov    %r13,%rdi
lea    0xde9(%rip),%rsi
call   1090 <strcmp@plt>
test   %eax,%eax
mov    %r15,%r13
mov    0x8(%rsp),%r15
lea    0x30(%rsp),%rbx
jne    12e0 <main+0x160>
mov    0x10(%rsp),%rdi
mov    0x28(%rsp),%rsi
mov    0x18(%rsp),%rdx
mov    0x20(%rsp),%rcx
call   1050 <Dij@plt>
jmp    12e0 <main+0x160>
mov    0x0(%r13),%rax
mov    %rax,0x18(%rsp)
jmp    12e0 <main+0x160>
mov    0x10(%rsp),%rdi
mov    0x28(%rsp),%rsi
mov    0x18(%rsp),%rdx
mov    0x20(%rsp),%rcx
call   1060 <BFS@plt>
mov    %r15,%r13
mov    0x8(%rsp),%r15
lea    0x30(%rsp),%rbx
jmp    12e0 <main+0x160>
mov    0x2c0d(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xd7e(%rip),%rsi
jmp    1407 <main+0x287>
cmp    $0xffffffff,%eax
jne    13dd <main+0x25d>
xor    %ebx,%ebx
jmp    147a <main+0x2fa>
mov    0x2bec(%rip),%rbp
mov    0x0(%rbp),%edi
mov    (%r15),%rdx
lea    0xd83(%rip),%rsi
mov    %eax,%ecx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%r15),%rdx
lea    0xd87(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0xffffffff,%ebx
jmp    147a <main+0x2fa>
mov    (%r15),%rsi
lea    0xd19(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd85(%rip),%rdi
call   1040 <puts@plt>
lea    0xdc2(%rip),%rdi
call   1040 <puts@plt>
lea    0xe03(%rip),%rdi
call   1040 <puts@plt>
lea    0xe29(%rip),%rdi
call   1040 <puts@plt>
lea    0xe4a(%rip),%rdi
call   1040 <puts@plt>
lea    0xe69(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32*, i32 }
@.str = [14 x i8] c":h:f:m:z:s:e:\00"
@.str.1 = [5 x i8] c"help\00"
@no_argument = global i32 0
@.str.2 = [5 x i8] c"file\00"
@required_argument = global i32 0
@.str.3 = [5 x i8] c"size\00"
@.str.4 = [6 x i8] c"start\00"
@.str.5 = [4 x i8] c"end\00"
@.str.6 = [5 x i8] c"mode\00"
@optarg = global i8* null
@.str.7 = [4 x i8] c"BFS\00"
@.str.8 = [4 x i8] c"Dij\00"
@.str.9 = [21 x i8] c"Usage: %s [OPTIONS]\0A\00"
@.str.10 = [74 x i8] c" -m, --mode mode BFS or Dijkstra (ex: -m BFS / -m Dij)\0A\00"
@.str.11 = [78 x i8] c" -f, --file file to construct laby (ex: m_file/fichier.txt)\0A\00"
@.str.12 = [51 x i8] c" -z, --size size of the labyrinth\0A\00"
@.str.13 = [46 x i8] c" -s, --start Robby start case\0A\00"
@.str.14 = [44 x i8] c" -e, --end Robby end case\0A\00"
@.str.15 = [49 x i8] c" -h, --help print help and exit\0A\00"
@.str.16 = [2 x i8] c"\0A\00"
@stderr = global i32 0
@.str.17 = [39 x i8] c"Try `%s --help' for more information.\0A\00"
@.str.18 = [26 x i8] c"%s: invalid option -- %c\0A\00"
@.str.19 = [38 x i8] c"Try `%s --help' for more information.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca [7 x %struct.option]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %11
%13 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %12, i64 0, i64 0
%14 = getelementptr inbounds %struct.option, %struct.option* %13, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds %struct.option, %struct.option* %13, i32 0, i32 1
%16 = load i32, i32* @no_argument
%17 = trunc i32 %16 to i8
store i8 %17, i8* %15
%18 = getelementptr inbounds %struct.option, %struct.option* %13, i32 0, i32 2
store i32* null, i32** %18
%19 = getelementptr inbounds %struct.option, %struct.option* %13, i32 0, i32 3
store i32 104, i32* %19
%20 = getelementptr inbounds %struct.option, %struct.option* %13, i64 1
%21 = getelementptr inbounds %struct.option, %struct.option* %20, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %21
%22 = getelementptr inbounds %struct.option, %struct.option* %20, i32 0, i32 1
%23 = load i32, i32* @required_argument
%24 = trunc i32 %23 to i8
store i8 %24, i8* %22
%25 = getelementptr inbounds %struct.option, %struct.option* %20, i32 0, i32 2
store i32* null, i32** %25
%26 = getelementptr inbounds %struct.option, %struct.option* %20, i32 0, i32 3
store i32 102, i32* %26
%27 = getelementptr inbounds %struct.option, %struct.option* %20, i64 1
%28 = getelementptr inbounds %struct.option, %struct.option* %27, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %28
%29 = getelementptr inbounds %struct.option, %struct.option* %27, i32 0, i32 1
%30 = load i32, i32* @required_argument
%31 = trunc i32 %30 to i8
store i8 %31, i8* %29
%32 = getelementptr inbounds %struct.option, %struct.option* %27, i32 0, i32 2
store i32* null, i32** %32
%33 = getelementptr inbounds %struct.option, %struct.option* %27, i32 0, i32 3
store i32 122, i32* %33
%34 = getelementptr inbounds %struct.option, %struct.option* %27, i64 1
%35 = getelementptr inbounds %struct.option, %struct.option* %34, i32 0, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %35
%36 = getelementptr inbounds %struct.option, %struct.option* %34, i32 0, i32 1
%37 = load i32, i32* @required_argument
%38 = trunc i32 %37 to i8
store i8 %38, i8* %36
%39 = getelementptr inbounds %struct.option, %struct.option* %34, i32 0, i32 2
store i32* null, i32** %39
%40 = getelementptr inbounds %struct.option, %struct.option* %34, i32 0, i32 3
store i32 115, i32* %40
%41 = getelementptr inbounds %struct.option, %struct.option* %34, i64 1
%42 = getelementptr inbounds %struct.option, %struct.option* %41, i32 0, i32 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8** %42
%43 = getelementptr inbounds %struct.option, %struct.option* %41, i32 0, i32 1
%44 = load i32, i32* @required_argument
%45 = trunc i32 %44 to i8
store i8 %45, i8* %43
%46 = getelementptr inbounds %struct.option, %struct.option* %41, i32 0, i32 2
store i32* null, i32** %46
%47 = getelementptr inbounds %struct.option, %struct.option* %41, i32 0, i32 3
store i32 101, i32* %47
%48 = getelementptr inbounds %struct.option, %struct.option* %41, i64 1
%49 = getelementptr inbounds %struct.option, %struct.option* %48, i32 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %49
%50 = getelementptr inbounds %struct.option, %struct.option* %48, i32 0, i32 1
%51 = load i32, i32* @required_argument
%52 = trunc i32 %51 to i8
store i8 %52, i8* %50
%53 = getelementptr inbounds %struct.option, %struct.option* %48, i32 0, i32 2
store i32* null, i32** %53
%54 = getelementptr inbounds %struct.option, %struct.option* %48, i32 0, i32 3
store i32 109, i32* %54
%55 = getelementptr inbounds %struct.option, %struct.option* %48, i64 1
%56 = bitcast %struct.option* %55 to i8*
br label %57
57: ; preds = %127, %2
%58 = load i32, i32* %4
%59 = load i8**, i8*** %5
%60 = load i8*, i8** %11
%61 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %12, i64 0, i64 0
%62 = call i32 @getopt_long(i32 %58, i8** %59, i8* %60, %struct.option* %61, i32* null)
store i32 %62, i32* %6
%63 = icmp ne i32 %62, -1
br i1 %63, label %64, label %128
64: ; preds = %57
%65 = load i32, i32* %6
switch i32 %65, label %115 [
i32 -1, label %66
i32 0, label %66
i32 102, label %67
i32 101, label %69
i32 115, label %71
i32 122, label %73
i32 109, label %75
i32 104, label %97
i32 58, label %109
i32 63, label %109
]
66: ; preds = %64, %64
br label %127
67: ; preds = %64
%68 = load i8*, i8** @optarg
store i8* %68, i8** %7
br label %127
69: ; preds = %64
%70 = load i8*, i8** @optarg
store i8* %70, i8** %8
br label %127
71: ; preds = %64
%72 = load i8*, i8** @optarg
store i8* %72, i8** %9
br label %127
73: ; preds = %64
%74 = load i8*, i8** @optarg
store i8* %74, i8** %10
br label %127
75: ; preds = %64
%76 = load i8*, i8** @optarg
%77 = call i32 @strcmp(i8* %76, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %85
79: ; preds = %75
%80 = load i8*, i8** %10
%81 = load i8*, i8** %7
%82 = load i8*, i8** %9
%83 = load i8*, i8** %8
%84 = call i32 @BFS(i8* %80, i8* %81, i8* %82, i8* %83)
br label %96
85: ; preds = %75
%86 = load i8*, i8** @optarg
%87 = call i32 @strcmp(i8* %86, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%88 = icmp eq i32 %87, 0
br i1 %88, label %89, label %95
89: ; preds = %85
%90 = load i8*, i8** %10
%91 = load i8*, i8** %7
%92 = load i8*, i8** %9
%93 = load i8*, i8** %8
%94 = call i32 @Dij(i8* %90, i8* %91, i8* %92, i8* %93)
br label %95
95: ; preds = %89, %85
br label %96
96: ; preds = %95, %79
br label %127
97: ; preds = %64
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 0
%100 = load i8*, i8** %99
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %100)
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.10, i64 0, i64 0))
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.11, i64 0, i64 0))
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.12, i64 0, i64 0))
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.13, i64 0, i64 0))
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.14, i64 0, i64 0))
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.15, i64 0, i64 0))
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
store i32 0, i32* %3
br label %129
109: ; preds = %64, %64
%110 = load i32, i32* @stderr
%111 = load i8**, i8*** %5
%112 = getelementptr inbounds i8*, i8** %111, i64 0
%113 = load i8*, i8** %112
%114 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.17, i64 0, i64 0), i8* %113)
store i32 -1, i32* %3
br label %129
115: ; preds = %64
%116 = load i32, i32* @stderr
%117 = load i8**, i8*** %5
%118 = getelementptr inbounds i8*, i8** %117, i64 0
%119 = load i8*, i8** %118
%120 = load i32, i32* %6
%121 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.18, i64 0, i64 0), i8* %119, i32 %120)
%122 = load i32, i32* @stderr
%123 = load i8**, i8*** %5
%124 = getelementptr inbounds i8*, i8** %123, i64 0
%125 = load i8*, i8** %124
%126 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %122, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.19, i64 0, i64 0), i8* %125)
store i32 -1, i32* %3
br label %129
127: ; preds = %96, %73, %71, %69, %67, %66
br label %57
128: ; preds = %57
store i32 0, i32* %3
br label %129
129: ; preds = %128, %115, %109, %97
%130 = load i32, i32* %3
ret i32 %130
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32*, i32 }
@.str = [14 x i8] c":h:f:m:z:s:e:\00"
@.str.1 = [5 x i8] c"help\00"
@no_argument = global i32 0
@.str.2 = [5 x i8] c"file\00"
@required_argument = global i32 0
@.str.3 = [5 x i8] c"size\00"
@.str.4 = [6 x i8] c"start\00"
@.str.5 = [4 x i8] c"end\00"
@.str.6 = [5 x i8] c"mode\00"
@optarg = global i8* null
@.str.7 = [4 x i8] c"BFS\00"
@.str.8 = [4 x i8] c"Dij\00"
@.str.9 = [21 x i8] c"Usage: %s [OPTIONS]\0A\00"
@stderr = global i32 0
@.str.17 = [39 x i8] c"Try `%s --help' for more information.\0A\00"
@.str.18 = [26 x i8] c"%s: invalid option -- %c\0A\00"
@.str.19 = [38 x i8] c"Try `%s --help' for more information.\00"
@str = [73 x i8] c" -m, --mode mode BFS or Dijkstra (ex: -m BFS / -m Dij)\00"
@str.20 = [77 x i8] c" -f, --file file to construct laby (ex: m_file/fichier.txt)\00"
@str.21 = [50 x i8] c" -z, --size size of the labyrinth\00"
@str.22 = [45 x i8] c" -s, --start Robby start case\00"
@str.23 = [43 x i8] c" -e, --end Robby end case\00"
@str.24 = [48 x i8] c" -h, --help print help and exit\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [7 x %struct.option]
%4 = bitcast [7 x %struct.option]* %3 to i8*
%5 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 0
%6 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 0, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 0, i32 1
%8 = load i32, i32* @no_argument
%9 = trunc i32 %8 to i8
store i8 %9, i8* %7
%10 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 0, i32 2
store i32* null, i32** %10
%11 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 0, i32 3
store i32 104, i32* %11
%12 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 1, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 1, i32 1
%14 = load i32, i32* @required_argument
%15 = trunc i32 %14 to i8
store i8 %15, i8* %13
%16 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 1, i32 2
store i32* null, i32** %16
%17 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 1, i32 3
store i32 102, i32* %17
%18 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 2, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %18
%19 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 2, i32 1
store i8 %15, i8* %19
%20 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 2, i32 2
store i32* null, i32** %20
%21 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 2, i32 3
store i32 122, i32* %21
%22 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 3, i32 0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %22
%23 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 3, i32 1
store i8 %15, i8* %23
%24 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 3, i32 2
store i32* null, i32** %24
%25 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 3, i32 3
store i32 115, i32* %25
%26 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 4, i32 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8** %26
%27 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 4, i32 1
store i8 %15, i8* %27
%28 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 4, i32 2
store i32* null, i32** %28
%29 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 4, i32 3
store i32 101, i32* %29
%30 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 5, i32 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %30
%31 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 5, i32 1
store i8 %15, i8* %31
%32 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 5, i32 2
store i32* null, i32** %32
%33 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 5, i32 3
store i32 109, i32* %33
%34 = getelementptr inbounds [7 x %struct.option], [7 x %struct.option]* %3, i64 0, i64 6
%35 = bitcast %struct.option* %34 to i8*
br label %36
36: ; preds = %42, %2
%37 = phi i8* [ undef, %2 ], [ %43, %42 ]
%38 = phi i8* [ undef, %2 ], [ %44, %42 ]
%39 = phi i8* [ undef, %2 ], [ %45, %42 ]
%40 = phi i8* [ undef, %2 ], [ %46, %42 ]
%41 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.option* %5, i32* null)
switch i32 %41, label %80 [
i32 -1, label %87
i32 63, label %76
i32 0, label %42
i32 102, label %47
i32 101, label %49
i32 115, label %51
i32 122, label %53
i32 109, label %55
i32 104, label %66
i32 58, label %76
]
42: ; preds = %36, %59, %64, %61, %53, %51, %49, %47
%43 = phi i8* [ %37, %59 ], [ %37, %64 ], [ %37, %61 ], [ %37, %53 ], [ %37, %51 ], [ %37, %49 ], [ %48, %47 ], [ %37, %36 ]
%44 = phi i8* [ %38, %59 ], [ %38, %64 ], [ %38, %61 ], [ %38, %53 ], [ %38, %51 ], [ %50, %49 ], [ %38, %47 ], [ %38, %36 ]
%45 = phi i8* [ %39, %59 ], [ %39, %64 ], [ %39, %61 ], [ %39, %53 ], [ %52, %51 ], [ %39, %49 ], [ %39, %47 ], [ %39, %36 ]
%46 = phi i8* [ %40, %59 ], [ %40, %64 ], [ %40, %61 ], [ %54, %53 ], [ %40, %51 ], [ %40, %49 ], [ %40, %47 ], [ %40, %36 ]
br label %36
47: ; preds = %36
%48 = load i8*, i8** @optarg
br label %42
49: ; preds = %36
%50 = load i8*, i8** @optarg
br label %42
51: ; preds = %36
%52 = load i8*, i8** @optarg
br label %42
53: ; preds = %36
%54 = load i8*, i8** @optarg
br label %42
55: ; preds = %36
%56 = load i8*, i8** @optarg
%57 = call i32 @strcmp(i8* dereferenceable(1) %56, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %55
%60 = call i32 @BFS(i8* %40, i8* %37, i8* %39, i8* %38)
br label %42
61: ; preds = %55
%62 = call i32 @strcmp(i8* dereferenceable(1) %56, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %42
64: ; preds = %61
%65 = call i32 @Dij(i8* %40, i8* %37, i8* %39, i8* %38)
br label %42
66: ; preds = %36
%67 = load i8*, i8** %1
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %67)
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.20, i64 0, i64 0))
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.21, i64 0, i64 0))
%72 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.22, i64 0, i64 0))
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.23, i64 0, i64 0))
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.24, i64 0, i64 0))
%75 = call i32 @putchar(i32 10)
br label %87
76: ; preds = %36, %36
%77 = load i32, i32* @stderr
%78 = load i8*, i8** %1
%79 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.17, i64 0, i64 0), i8* %78)
br label %87
80: ; preds = %36
%81 = load i32, i32* @stderr
%82 = load i8*, i8** %1
%83 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %81, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.18, i64 0, i64 0), i8* %82, i32 %41)
%84 = load i32, i32* @stderr
%85 = load i8*, i8** %1
%86 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.19, i64 0, i64 0), i8* %85)
br label %87
87: ; preds = %36, %80, %76, %66
%88 = phi i32 [ -1, %80 ], [ -1, %76 ], [ 0, %66 ], [ 0, %36 ]
ret i32 %88
}