#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_usage(int detail, const char *argerr, const char *err) {
  fprintf(
      stderr,
      "Usage: filedumper [--help]\n"
      "                  [--dir=<dirname>] [--prefix=<name>]\n"
      "                  [--statistics]\n"
      "                  [--visualiser --latmin=<latmin> --latmax=<latmax>\n"
      "                                --lonmin=<lonmin> --lonmax=<lonmax>\n"
      "                                --data=<data-type>]\n"
      "                  [--dump [--node=<node> ...]\n"
      "                          [--segment=<segment> ...]\n"
      "                          [--way=<way> ...]]\n"
      "                          [--turn-relation=<rel> ...]]\n"
      "                  [--dump-osm [--no-super]\n"
      "                              [--latmin=<latmin> --latmax=<latmax>\n"
      "                               --lonmin=<lonmin> --lonmax=<lonmax>]]\n");
  if (argerr)
    fprintf(stderr,
            "\n"
            "Error with command line parameter: %s\n",
            argerr);
  if (err)
    fprintf(stderr,
            "\n"
            "Error: %s\n",
            err);
  if (detail)
    fprintf(
        stderr,
        "\n"
        "--help                    Prints this information.\n"
        "\n"
        "--dir=<dirname>           The directory containing the routing "
        "database.\n"
        "--prefix=<name>           The filename prefix for the routing "
        "database.\n"
        "\n"
        "--statistics              Print statistics about the routing "
        "database.\n"
        "\n"
        "--visualiser              Extract selected data from the routing "
        "database:\n"
        "  --latmin=<latmin>       * the minimum latitude (degrees N).\n"
        "  --latmax=<latmax>       * the maximum latitude (degrees N).\n"
        "  --lonmin=<lonmin>       * the minimum longitude (degrees E).\n"
        "  --lonmax=<lonmax>       * the maximum longitude (degrees E).\n"
        "  --data=<data-type>      * the type of data to select.\n"
        "\n"
        "  <data-type> can be selected from:\n"
        "      junctions = segment count at each junction.\n"
        "      super     = super-node and super-segments.\n"
        "      oneway    = oneway segments.\n"
        "      turns     = turn restrictions.\n"
        "      speed     = speed limits.\n"
        "      weight    = weight limits.\n"
        "      height    = height limits.\n"
        "      width     = width limits.\n"
        "      length    = length limits.\n"
        "\n"
        "--dump                    Dump selected contents of the database.\n"
        "  --node=<node>           * the node with the selected index.\n"
        "  --segment=<segment>     * the segment with the selected index.\n"
        "  --way=<way>             * the way with the selected index.\n"
        "  --turn-relation=<rel>   * the turn relation with the selected "
        "index.\n"
        "                          Use 'all' instead of a number to get all of "
        "them.\n"
        "\n"
        "--dump-osm                Dump all or part of the database as an XML "
        "file.\n"
        "  --no-super              * exclude the super-segments.\n"
        "  --latmin=<latmin>       * the minimum latitude (degrees N).\n"
        "  --latmax=<latmax>       * the maximum latitude (degrees N).\n"
        "  --lonmin=<lonmin>       * the minimum longitude (degrees E).\n"
        "  --lonmax=<lonmax>       * the maximum longitude (degrees E).\n");
  exit(!detail);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1170 <print_usage+0x50>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0x113f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpq   $0x0,-0x18(%rbp)
je     1196 <print_usage+0x76>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0x1141(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x0,-0x4(%rbp)
je     11b7 <print_usage+0x97>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    0x112c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%rbp
mov    %edi,%r14d
mov    0x2ea9(%rip),%r15
mov    (%r15),%edi
lea    0xebf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %rbp,%rbp
jne    1176 <print_usage+0x56>
test   %rbx,%rbx
jne    118f <print_usage+0x6f>
test   %r14d,%r14d
je     1168 <print_usage+0x48>
mov    (%r15),%edi
lea    0x117b(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %edi,%edi
test   %r14d,%r14d
sete   %dil
call   1040 <exit@plt>
mov    (%r15),%edi
lea    0x1128(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %rbx,%rbx
je     1152 <print_usage+0x32>
mov    (%r15),%edi
lea    0x1137(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %r14d,%r14d
jne    1157 <print_usage+0x37>
jmp    1168 <print_usage+0x48>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [680 x i8] c"Usage: filedumper [--help]\0A [--dir=<dirname>] [--prefix=<name>]\0A [--statistics]\0A [--visualiser --latmin=<latmin> --latmax=<latmax>\0A --lonmin=<lonmin> --lonmax=<lonmax>\0A --data=<data-type>]\0A [--dump [--node=<node> ...]\0A [--segment=<segment> ...]\0A [--way=<way> ...]]\0A [--turn-relation=<rel> ...]]\0A [--dump-osm [--no-super]\0A [--latmin=<latmin> --latmax=<latmax>\0A --lonmin=<lonmin> --lonmax=<lonmax>]]\0A\00"
@.str.1 = [40 x i8] c"\0AError with command line parameter: %s\0A\00"
@.str.2 = [12 x i8] c"\0AError: %s\0A\00"
@.str.3 = [1808 x i8] c"\0A--help Prints this information.\0A\0A--dir=<dirname> The directory containing the routing database.\0A--prefix=<name> The filename prefix for the routing database.\0A\0A--statistics Print statistics about the routing database.\0A\0A--visualiser Extract selected data from the routing database:\0A --latmin=<latmin> * the minimum latitude (degrees N).\0A --latmax=<latmax> * the maximum latitude (degrees N).\0A --lonmin=<lonmin> * the minimum longitude (degrees E).\0A --lonmax=<lonmax> * the maximum longitude (degrees E).\0A --data=<data-type> * the type of data to select.\0A\0A <data-type> can be selected from:\0A junctions = segment count at each junction.\0A super = super-node and super-segments.\0A oneway = oneway segments.\0A turns = turn restrictions.\0A speed = speed limits.\0A weight = weight limits.\0A height = height limits.\0A width = width limits.\0A length = length limits.\0A\0A--dump Dump selected contents of the database.\0A --node=<node> * the node with the selected index.\0A --segment=<segment> * the segment with the selected index.\0A --way=<way> * the way with the selected index.\0A --turn-relation=<rel> * the turn relation with the selected index.\0A Use 'all' instead of a number to get all of them.\0A\0A--dump-osm Dump all or part of the database as an XML file.\0A --no-super * exclude the super-segments.\0A --latmin=<latmin> * the minimum latitude (degrees N).\0A --latmax=<latmax> * the maximum latitude (degrees N).\0A --lonmin=<lonmin> * the minimum longitude (degrees E).\0A --lonmax=<lonmax> * the maximum longitude (degrees E).\0A\00"
define void @print_usage(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([680 x i8], [680 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %5
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %11, %3
%16 = load i8*, i8** %6
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %6
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %18, %15
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([1808 x i8], [1808 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %25, %22
%29 = load i32, i32* %4
%30 = icmp ne i32 %29, 0
%31 = xor i1 %30, true
%32 = zext i1 %31 to i32
%33 = call i32 @exit(i32 %32)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [680 x i8] c"Usage: filedumper [--help]\0A [--dir=<dirname>] [--prefix=<name>]\0A [--statistics]\0A [--visualiser --latmin=<latmin> --latmax=<latmax>\0A --lonmin=<lonmin> --lonmax=<lonmax>\0A --data=<data-type>]\0A [--dump [--node=<node> ...]\0A [--segment=<segment> ...]\0A [--way=<way> ...]]\0A [--turn-relation=<rel> ...]]\0A [--dump-osm [--no-super]\0A [--latmin=<latmin> --latmax=<latmax>\0A --lonmin=<lonmin> --lonmax=<lonmax>]]\0A\00"
@.str.1 = [40 x i8] c"\0AError with command line parameter: %s\0A\00"
@.str.2 = [12 x i8] c"\0AError: %s\0A\00"
@.str.3 = [1808 x i8] c"\0A--help Prints this information.\0A\0A--dir=<dirname> The directory containing the routing database.\0A--prefix=<name> The filename prefix for the routing database.\0A\0A--statistics Print statistics about the routing database.\0A\0A--visualiser Extract selected data from the routing database:\0A --latmin=<latmin> * the minimum latitude (degrees N).\0A --latmax=<latmax> * the maximum latitude (degrees N).\0A --lonmin=<lonmin> * the minimum longitude (degrees E).\0A --lonmax=<lonmax> * the maximum longitude (degrees E).\0A --data=<data-type> * the type of data to select.\0A\0A <data-type> can be selected from:\0A junctions = segment count at each junction.\0A super = super-node and super-segments.\0A oneway = oneway segments.\0A turns = turn restrictions.\0A speed = speed limits.\0A weight = weight limits.\0A height = height limits.\0A width = width limits.\0A length = length limits.\0A\0A--dump Dump selected contents of the database.\0A --node=<node> * the node with the selected index.\0A --segment=<segment> * the segment with the selected index.\0A --way=<way> * the way with the selected index.\0A --turn-relation=<rel> * the turn relation with the selected index.\0A Use 'all' instead of a number to get all of them.\0A\0A--dump-osm Dump all or part of the database as an XML file.\0A --no-super * exclude the super-segments.\0A --latmin=<latmin> * the minimum latitude (degrees N).\0A --latmax=<latmax> * the maximum latitude (degrees N).\0A --lonmin=<lonmin> * the minimum longitude (degrees E).\0A --lonmax=<lonmax> * the maximum longitude (degrees E).\0A\00"
define void @print_usage(i32 %0, i8* %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([680 x i8], [680 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %1, null
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %10
10: ; preds = %7, %3
%11 = icmp eq i8* %2, null
br i1 %11, label %15, label %12
12: ; preds = %10
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %2)
br label %15
15: ; preds = %12, %10
%16 = icmp eq i32 %0, 0
br i1 %16, label %20, label %17
17: ; preds = %15
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([1808 x i8], [1808 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %17, %15
%21 = zext i1 %16 to i32
%22 = tail call i32 @exit(i32 %21)
unreachable
}