#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*/ print_copyright();
int /*<<< orphan*/ print_version(char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ usage();
void print_help() {
  printf("\nTool name:\n   %s\n", "trim");
  usage();
  printf("Description:\n%s\n\n",
         "   trim allows you to trim/add any number of line or samples to an "
         "image\n"
         "   (in ASF Internal format), and updates the metadata accordingly.");
  if (strlen(
          "   <infile>  The basename of the input data file.  Must be in ASF "
          "Internal\n"
          "        format (.img)\n"
          "   <new_top_line> Line in input that will be the top of output.  "
          "Can be\n"
          "        negative, the top lines in the output image will be zeros.\n"
          "   <new_top_sample> Sample in input that will be left side of "
          "output.  Can\n"
          "        be negative, the left side of the output will be zeros.\n"
          "   When the -to option is used, the new_top_line and new_top_sample "
          "arguments\n"
          "   are not needed.\n"))
    printf(
        "Input:\n%s\n\n",
        "   <infile>  The basename of the input data file.  Must be in ASF "
        "Internal\n"
        "        format (.img)\n"
        "   <new_top_line> Line in input that will be the top of output.  Can "
        "be\n"
        "        negative, the top lines in the output image will be zeros.\n"
        "   <new_top_sample> Sample in input that will be left side of output. "
        " Can\n"
        "        be negative, the left side of the output will be zeros.\n"
        "   When the -to option is used, the new_top_line and new_top_sample "
        "arguments\n"
        "   are not needed.\n");
  if (strlen("   <outfile>  The basename of the output file.  The output file "
             "will be stored\n"
             "        in ASF Internal format (.img and .meta)"))
    printf("Output:\n%s\n\n",
           "   <outfile>  The basename of the output file.  The output file "
           "will be stored\n"
           "        in ASF Internal format (.img and .meta)");
  if (strlen(
          "   -log <logfile>\n"
          "        Save all tool output in <logfile>\n"
          "   -height <height>\n"
          "        Height of the output file.  If the height extends below the "
          "bottom\n"
          "        of the image, it is padded with zeros.\n"
          "   -width <width>\n"
          "        Width of the output file.  If the width extends beyond the "
          "right\n"
          "        edge of the image, it is padded with zeros.\n"
          "   -to <metadata file>\n"
          "        Trims the input file to the extent of the metadata file.  "
          "With this\n"
          "        option you would not use -width, -height, or the new start "
          "line and\n"
          "        sample values.\n"
          "   -lat1 <lat> -lat2 <lat> -lon1 <lon> -lon2 <lon>\n"
          "        Specifies a lat/lon boundary box to use for trimming.  With "
          "these\n"
          "        options you would not use -width, -height, or the new start "
          "lien and\n"
          "        sample vaules.\n"
          "   -license\n"
          "        Print copyright and license for this software then exit.\n"
          "   -version\n"
          "        Print version and copyright then exit.\n"
          "   -help\n"
          "        Print this help information and then exit."))
    printf("Options:\n%s\n\n",
           "   -log <logfile>\n"
           "        Save all tool output in <logfile>\n"
           "   -height <height>\n"
           "        Height of the output file.  If the height extends below "
           "the bottom\n"
           "        of the image, it is padded with zeros.\n"
           "   -width <width>\n"
           "        Width of the output file.  If the width extends beyond the "
           "right\n"
           "        edge of the image, it is padded with zeros.\n"
           "   -to <metadata file>\n"
           "        Trims the input file to the extent of the metadata file.  "
           "With this\n"
           "        option you would not use -width, -height, or the new start "
           "line and\n"
           "        sample values.\n"
           "   -lat1 <lat> -lat2 <lat> -lon1 <lon> -lon2 <lon>\n"
           "        Specifies a lat/lon boundary box to use for trimming.  "
           "With these\n"
           "        options you would not use -width, -height, or the new "
           "start lien and\n"
           "        sample vaules.\n"
           "   -license\n"
           "        Print copyright and license for this software then exit.\n"
           "   -version\n"
           "        Print version and copyright then exit.\n"
           "   -help\n"
           "        Print this help information and then exit.");
  if (strlen("   Remove a 100x100 section, starting at line 50, sample 200\n"
             "   from the file \"test.img\", and \"test.meta\".\n"
             "   > trim -width 100 -height 100 test test_trimmed 50 200\n"
             "\n"
             "   Trim test.img to the extent of \"section.meta\".\n"
             "   > trim -to section test test_trimmed\n"
             "\n"
             "   Trim test.img to the lat/lon area (64,-146) - (65,-147)\n"
             "   > trim -lat1 64 -lat2 65 -lon1 -146 -lon2 -147 test "
             "test_trimmed\n"))
    printf("Examples:\n%s\n\n",
           "   Remove a 100x100 section, starting at line 50, sample 200\n"
           "   from the file \"test.img\", and \"test.meta\".\n"
           "   > trim -width 100 -height 100 test test_trimmed 50 200\n"
           "\n"
           "   Trim test.img to the extent of \"section.meta\".\n"
           "   > trim -to section test test_trimmed\n"
           "\n"
           "   Trim test.img to the lat/lon area (64,-146) - (65,-147)\n"
           "   > trim -lat1 64 -lat2 65 -lon1 -146 -lon2 -147 test "
           "test_trimmed\n");
  if (strlen("   Only works on ASF Internal files."))
    printf("Limitations:\n%s\n\n", "   Only works on ASF Internal files.");
  if (strlen(""))
    printf("See Also:\n%s\n\n", "");
  printf("Contact:\n%s\n", "   "
                           "Alaska Satellite Facility"
                           "\n"
                           "   "
                           "Geophysical Institute"
                           "\n"
                           "   "
                           "University of Alaska Fairbanks"
                           "\n"
                           "   "
                           "P.O. Box 757320"
                           "\n"
                           "   "
                           "Fairbanks, AK 99775-7320"
                           "\n"
                           "   "
                           "http://www.asf.alaska.edu"
                           "\n"
                           "   "
                           "uso@asf.alaska.edu"
                           "\n");
  print_version("trim");
  print_copyright();
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
lea    0xeb1(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <usage@plt>
lea    0xea3(%rip),%rdi
lea    0xeae(%rip),%rsi
call   1050 <printf@plt>
lea    0xf2e(%rip),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
je     11aa <print_help+0x5a>
lea    0x10f1(%rip),%rdi
lea    0xf11(%rip),%rsi
call   1050 <printf@plt>
lea    0x10ea(%rip),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
je     11d3 <print_help+0x83>
lea    0x1153(%rip),%rdi
lea    0x10cd(%rip),%rsi
call   1050 <printf@plt>
lea    0x114d(%rip),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
je     11fc <print_help+0xac>
lea    0x14fb(%rip),%rdi
lea    0x1130(%rip),%rsi
call   1050 <printf@plt>
lea    0x14f6(%rip),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
je     1225 <print_help+0xd5>
lea    0x1661(%rip),%rdi
lea    0x14d9(%rip),%rsi
call   1050 <printf@plt>
lea    0x165d(%rip),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
je     124e <print_help+0xfe>
lea    0x166c(%rip),%rdi
lea    0x1640(%rip),%rsi
call   1050 <printf@plt>
lea    0xdd4(%rip),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
je     1277 <print_help+0x127>
lea    0x1655(%rip),%rdi
lea    0xdb7(%rip),%rsi
call   1050 <printf@plt>
lea    0x1651(%rip),%rdi
lea    0x1657(%rip),%rsi
call   1050 <printf@plt>
lea    0xd82(%rip),%rdi
call   1030 <print_version@plt>
mov    $0x0,%al
call   1060 <print_copyright@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xec4(%rip),%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <usage@plt>
lea    0xeb3(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1040 <printf@plt>
lea    0x1117(%rip),%rdi
lea    0xf37(%rip),%rsi
call   1040 <printf@plt>
lea    0x118f(%rip),%rdi
lea    0x1109(%rip),%rsi
call   1040 <printf@plt>
lea    0x154d(%rip),%rdi
lea    0x1182(%rip),%rsi
call   1040 <printf@plt>
lea    0x16c9(%rip),%rdi
lea    0x1541(%rip),%rsi
call   1040 <printf@plt>
lea    0x16ea(%rip),%rdi
lea    0x16be(%rip),%rsi
call   1040 <printf@plt>
lea    0x16e9(%rip),%rdi
lea    0x16ef(%rip),%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <print_version@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <print_copyright@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\0ATool name:\0A %s\0A\00"
@.str.1 = [5 x i8] c"trim\00"
@.str.2 = [18 x i8] c"Description:\0A%s\0A\0A\00"
@.str.3 = [140 x i8] c" trim allows you to trim/add any number of line or samples to an image\0A (in ASF Internal format), and updates the metadata accordingly.\00"
@.str.4 = [473 x i8] c" <infile> The basename of the input data file. Must be in ASF Internal\0A format (.img)\0A <new_top_line> Line in input that will be the top of output. Can be\0A negative, the top lines in the output image will be zeros.\0A <new_top_sample> Sample in input that will be left side of output. Can\0A be negative, the left side of the output will be zeros.\0A When the -to option is used, the new_top_line and new_top_sample arguments\0A are not needed.\0A\00"
@.str.5 = [12 x i8] c"Input:\0A%s\0A\0A\00"
@.str.6 = [127 x i8] c" <outfile> The basename of the output file. The output file will be stored\0A in ASF Internal format (.img and .meta)\00"
@.str.7 = [13 x i8] c"Output:\0A%s\0A\0A\00"
@.str.8 = [964 x i8] c" -log <logfile>\0A Save all tool output in <logfile>\0A -height <height>\0A Height of the output file. If the height extends below the bottom\0A of the image, it is padded with zeros.\0A -width <width>\0A Width of the output file. If the width extends beyond the right\0A edge of the image, it is padded with zeros.\0A -to <metadata file>\0A Trims the input file to the extent of the metadata file. With this\0A option you would not use -width, -height, or the new start line and\0A sample values.\0A -lat1 <lat> -lat2 <lat> -lon1 <lon> -lon2 <lon>\0A Specifies a lat/lon boundary box to use for trimming. With these\0A options you would not use -width, -height, or the new start lien and\0A sample vaules.\0A -license\0A Print copyright and license for this software then exit.\0A -version\0A Print version and copyright then exit.\0A -help\0A Print this help information and then exit.\00"
@.str.9 = [14 x i8] c"Options:\0A%s\0A\0A\00"
@.str.10 = [385 x i8] c" Remove a 100x100 section, starting at line 50, sample 200\0A from the file \22test.img\22, and \22test.meta\22.\0A > trim -width 100 -height 100 test test_trimmed 50 200\0A\0A Trim test.img to the extent of \22section.meta\22.\0A > trim -to section test test_trimmed\0A\0A Trim test.img to the lat/lon area (64,-146) - (65,-147)\0A > trim -lat1 64 -lat2 65 -lon1 -146 -lon2 -147 test test_trimmed\0A\00"
@.str.11 = [15 x i8] c"Examples:\0A%s\0A\0A\00"
@.str.12 = [37 x i8] c" Only works on ASF Internal files.\00"
@.str.13 = [18 x i8] c"Limitations:\0A%s\0A\0A\00"
@.str.14 = [1 x i8] zeroinitializer
@.str.15 = [15 x i8] c"See Also:\0A%s\0A\0A\00"
@.str.16 = [13 x i8] c"Contact:\0A%s\0A\00"
@.str.17 = [187 x i8] c" Alaska Satellite Facility\0A Geophysical Institute\0A University of Alaska Fairbanks\0A P.O. Box 757320\0A Fairbanks, AK 99775-7320\0A http://www.asf.alaska.edu\0A uso@asf.alaska.edu\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @usage()
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.3, i64 0, i64 0))
%4 = call i64 @strlen(i8* getelementptr inbounds ([473 x i8], [473 x i8]* @.str.4, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([473 x i8], [473 x i8]* @.str.4, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = call i64 @strlen(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.6, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.6, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
%14 = call i64 @strlen(i8* getelementptr inbounds ([964 x i8], [964 x i8]* @.str.8, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([964 x i8], [964 x i8]* @.str.8, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
%19 = call i64 @strlen(i8* getelementptr inbounds ([385 x i8], [385 x i8]* @.str.10, i64 0, i64 0))
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([385 x i8], [385 x i8]* @.str.10, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
%24 = call i64 @strlen(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0))
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
%29 = call i64 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i64 0, i64 0))
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
%34 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str.17, i64 0, i64 0))
%35 = call i32 @print_version(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%36 = call i32 (...) @print_copyright()
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0ATool name:\0A %s\0A\00"
@.str.1 = [5 x i8] c"trim\00"
@.str.2 = [18 x i8] c"Description:\0A%s\0A\0A\00"
@.str.3 = [140 x i8] c" trim allows you to trim/add any number of line or samples to an image\0A (in ASF Internal format), and updates the metadata accordingly.\00"
@.str.4 = [473 x i8] c" <infile> The basename of the input data file. Must be in ASF Internal\0A format (.img)\0A <new_top_line> Line in input that will be the top of output. Can be\0A negative, the top lines in the output image will be zeros.\0A <new_top_sample> Sample in input that will be left side of output. Can\0A be negative, the left side of the output will be zeros.\0A When the -to option is used, the new_top_line and new_top_sample arguments\0A are not needed.\0A\00"
@.str.5 = [12 x i8] c"Input:\0A%s\0A\0A\00"
@.str.6 = [127 x i8] c" <outfile> The basename of the output file. The output file will be stored\0A in ASF Internal format (.img and .meta)\00"
@.str.7 = [13 x i8] c"Output:\0A%s\0A\0A\00"
@.str.8 = [964 x i8] c" -log <logfile>\0A Save all tool output in <logfile>\0A -height <height>\0A Height of the output file. If the height extends below the bottom\0A of the image, it is padded with zeros.\0A -width <width>\0A Width of the output file. If the width extends beyond the right\0A edge of the image, it is padded with zeros.\0A -to <metadata file>\0A Trims the input file to the extent of the metadata file. With this\0A option you would not use -width, -height, or the new start line and\0A sample values.\0A -lat1 <lat> -lat2 <lat> -lon1 <lon> -lon2 <lon>\0A Specifies a lat/lon boundary box to use for trimming. With these\0A options you would not use -width, -height, or the new start lien and\0A sample vaules.\0A -license\0A Print copyright and license for this software then exit.\0A -version\0A Print version and copyright then exit.\0A -help\0A Print this help information and then exit.\00"
@.str.9 = [14 x i8] c"Options:\0A%s\0A\0A\00"
@.str.10 = [385 x i8] c" Remove a 100x100 section, starting at line 50, sample 200\0A from the file \22test.img\22, and \22test.meta\22.\0A > trim -width 100 -height 100 test test_trimmed 50 200\0A\0A Trim test.img to the extent of \22section.meta\22.\0A > trim -to section test test_trimmed\0A\0A Trim test.img to the lat/lon area (64,-146) - (65,-147)\0A > trim -lat1 64 -lat2 65 -lon1 -146 -lon2 -147 test test_trimmed\0A\00"
@.str.11 = [15 x i8] c"Examples:\0A%s\0A\0A\00"
@.str.12 = [37 x i8] c" Only works on ASF Internal files.\00"
@.str.13 = [18 x i8] c"Limitations:\0A%s\0A\0A\00"
@.str.16 = [13 x i8] c"Contact:\0A%s\0A\00"
@.str.17 = [187 x i8] c" Alaska Satellite Facility\0A Geophysical Institute\0A University of Alaska Fairbanks\0A P.O. Box 757320\0A Fairbanks, AK 99775-7320\0A http://www.asf.alaska.edu\0A uso@asf.alaska.edu\0A\00"
define void @print_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @usage()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([473 x i8], [473 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.6, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([964 x i8], [964 x i8]* @.str.8, i64 0, i64 0))
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([385 x i8], [385 x i8]* @.str.10, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0))
%9 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str.17, i64 0, i64 0))
%10 = tail call i32 @print_version(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 (...) @print_copyright()
ret void
}