#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*/ printf(char *);
void usage(int type) {
  printf(
      "\n"
      "Usage:\n"
      "\tgenimage -i <.qtif> [operands ...]\n\n"
      "\tThe following operands are available\n\n"
      "\t-h\t\tDisplay full help information\n"
      "\t-i  <file>\tUse file containing QuickTime uncompressed raw image as\n"
      "\t\t\tthe panic dialog (8 or 24 bit)\n"
      "\t-o  <file>\tWrite the output as a compressed WHD RAW image suitable\n"
      "\t\t\tfor loading into the kernel\n"
      "\t-c  <file>\tUse file containing 256 RGB values for 8-bit indexed \n"
      "\t\t\tlookups, overrides built-in appleClut8\n"
      "\t-fg <color>\tForeground color of font used for panic information in\n"
      "\t\t\t24-bits, default 0xFFFFFF (100%% white)\n"
      "\t-bg <color>\tBackground color of font used for panic information in\n"
      "\t\t\t24-bits, default 0x222222 (13%% white, dark gray)\n"
      "\t-n  <lines>\tNumber of lines that have been reserved to display the\n"
      "\t\t\tpanic information, must be at least 20\n"
      "\n\tThese are useful options for testing\n"
      "\t-io <file>\tUse <file> to override the default C source filename\n"
      "\t-bw\t\tConvert the input image to shades of gray\n"
      "\t-n24\t\tConvert an image from 8 bit to 24 bit mode before\n"
      "\t\t\tprocessing\n"
      "\t-n8\t\tDon't convert an image from 24 bit to 8 bit mode before \n"
      "\t\t\tprocessing, default is to convert\n"
      "\t-qt <file>\t(requires -i) Write QuickTime uncompressed raw .gtif\n"
      "\t\t\tfile containing the input image in 8-bit format\n"
      "\t-r\t\tCreate a Quicktime uncompressed image of the 8-bit\n"
      "\t\t\tsystem CLUT named appleclut8.qtif <debugging>\n"
      "\t-f\t\tCreate a Quicktime uncompressed image of the 8x16\n"
      "\t\t\tbit panic info font named font.qtif <debugging>\n"
      "\n\n");
  if (type > 0)
    printf(
        "This utility is used to convert a panic dialog from .qtif format, "
        "into\none that is suitable for the kernel to display.  The .qtif "
        "image file\ncan be in either 24 or 8 bit mode, but must be in an "
        "uncompressed raw\nformat.  8 bit mode is preferred, as it requires no "
        "conversion to the\ncolors that are contained in the CLUT.  If a color "
        "cannot be found in\nthe CLUT, it will be converted to the nearest "
        "gray.  The default CLUT\nis the same as the system CLUT. If needed, "
        "this can be overridden by\nproviding a new CLUT with the -c "
        "option.\n\nHowever, if you override the default CLUT.  The panic UI "
        "may not appear\nas you intended, when the systme is in 8 bit mode.  "
        "Colors that are not\npresent in the active CLUT, will be converted to "
        "the nearest gray.\n\nThe panic dialog must have a number of lines "
        "reserved at the bottom for\ndisplaying additional panic information.  "
        "The minimum number of lines\nis 20.  The font use to display this "
        "information needs to have the\nforeground and background colors "
        "defined.  The defaults are full white\non dark gray.  This can be "
        "changed by using the -fg and/or -bg options to\nprovide new 24 bit "
        "colors.  These colors must be contained in the CLUT.\n\nThere are two "
        "possible output results.  The default is to create a C\nsource file "
        "named panic_image.c that contains the panic image in a 8 "
        "bit\nmodified RLE compressed format and the CLUT that was used to "
        "create the\nimage.  The second possibility is to create a binary "
        "version of the same\ninformation by using the -o option.  This file "
        "can then be used to replace\nthe panic dialog that is currently "
        "active in the kernel by using\nsysctl(KERN_PANIC_INFO).\n\n\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jle    113d <usage+0x2d>
lea    0x1457(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
test   %ebx,%ebx
jle    1140 <usage+0x20>
lea    0x1455(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1423 x i8] c"\0AUsage:\0A\09genimage -i <.qtif> [operands ...]\0A\0A\09The following operands are available\0A\0A\09-h\09\09Display full help information\0A\09-i <file>\09Use file containing QuickTime uncompressed raw image as\0A\09\09\09the panic dialog (8 or 24 bit)\0A\09-o <file>\09Write the output as a compressed WHD RAW image suitable\0A\09\09\09for loading into the kernel\0A\09-c <file>\09Use file containing 256 RGB values for 8-bit indexed \0A\09\09\09lookups, overrides built-in appleClut8\0A\09-fg <color>\09Foreground color of font used for panic information in\0A\09\09\0924-bits, default 0xFFFFFF (100%% white)\0A\09-bg <color>\09Background color of font used for panic information in\0A\09\09\0924-bits, default 0x222222 (13%% white, dark gray)\0A\09-n <lines>\09Number of lines that have been reserved to display the\0A\09\09\09panic information, must be at least 20\0A\0A\09These are useful options for testing\0A\09-io <file>\09Use <file> to override the default C source filename\0A\09-bw\09\09Convert the input image to shades of gray\0A\09-n24\09\09Convert an image from 8 bit to 24 bit mode before\0A\09\09\09processing\0A\09-n8\09\09Don't convert an image from 24 bit to 8 bit mode before \0A\09\09\09processing, default is to convert\0A\09-qt <file>\09(requires -i) Write QuickTime uncompressed raw .gtif\0A\09\09\09file containing the input image in 8-bit format\0A\09-r\09\09Create a Quicktime uncompressed image of the 8-bit\0A\09\09\09system CLUT named appleclut8.qtif <debugging>\0A\09-f\09\09Create a Quicktime uncompressed image of the 8x16\0A\09\09\09bit panic info font named font.qtif <debugging>\0A\0A\0A\00"
@.str.1 = [1626 x i8] c"This utility is used to convert a panic dialog from .qtif format, into\0Aone that is suitable for the kernel to display. The .qtif image file\0Acan be in either 24 or 8 bit mode, but must be in an uncompressed raw\0Aformat. 8 bit mode is preferred, as it requires no conversion to the\0Acolors that are contained in the CLUT. If a color cannot be found in\0Athe CLUT, it will be converted to the nearest gray. The default CLUT\0Ais the same as the system CLUT. If needed, this can be overridden by\0Aproviding a new CLUT with the -c option.\0A\0AHowever, if you override the default CLUT. The panic UI may not appear\0Aas you intended, when the systme is in 8 bit mode. Colors that are not\0Apresent in the active CLUT, will be converted to the nearest gray.\0A\0AThe panic dialog must have a number of lines reserved at the bottom for\0Adisplaying additional panic information. The minimum number of lines\0Ais 20. The font use to display this information needs to have the\0Aforeground and background colors defined. The defaults are full white\0Aon dark gray. This can be changed by using the -fg and/or -bg options to\0Aprovide new 24 bit colors. These colors must be contained in the CLUT.\0A\0AThere are two possible output results. The default is to create a C\0Asource file named panic_image.c that contains the panic image in a 8 bit\0Amodified RLE compressed format and the CLUT that was used to create the\0Aimage. The second possibility is to create a binary version of the same\0Ainformation by using the -o option. This file can then be used to replace\0Athe panic dialog that is currently active in the kernel by using\0Asysctl(KERN_PANIC_INFO).\0A\0A\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([1423 x i8], [1423 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([1626 x i8], [1626 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [1423 x i8] c"\0AUsage:\0A\09genimage -i <.qtif> [operands ...]\0A\0A\09The following operands are available\0A\0A\09-h\09\09Display full help information\0A\09-i <file>\09Use file containing QuickTime uncompressed raw image as\0A\09\09\09the panic dialog (8 or 24 bit)\0A\09-o <file>\09Write the output as a compressed WHD RAW image suitable\0A\09\09\09for loading into the kernel\0A\09-c <file>\09Use file containing 256 RGB values for 8-bit indexed \0A\09\09\09lookups, overrides built-in appleClut8\0A\09-fg <color>\09Foreground color of font used for panic information in\0A\09\09\0924-bits, default 0xFFFFFF (100%% white)\0A\09-bg <color>\09Background color of font used for panic information in\0A\09\09\0924-bits, default 0x222222 (13%% white, dark gray)\0A\09-n <lines>\09Number of lines that have been reserved to display the\0A\09\09\09panic information, must be at least 20\0A\0A\09These are useful options for testing\0A\09-io <file>\09Use <file> to override the default C source filename\0A\09-bw\09\09Convert the input image to shades of gray\0A\09-n24\09\09Convert an image from 8 bit to 24 bit mode before\0A\09\09\09processing\0A\09-n8\09\09Don't convert an image from 24 bit to 8 bit mode before \0A\09\09\09processing, default is to convert\0A\09-qt <file>\09(requires -i) Write QuickTime uncompressed raw .gtif\0A\09\09\09file containing the input image in 8-bit format\0A\09-r\09\09Create a Quicktime uncompressed image of the 8-bit\0A\09\09\09system CLUT named appleclut8.qtif <debugging>\0A\09-f\09\09Create a Quicktime uncompressed image of the 8x16\0A\09\09\09bit panic info font named font.qtif <debugging>\0A\0A\0A\00"
@str = [1625 x i8] c"This utility is used to convert a panic dialog from .qtif format, into\0Aone that is suitable for the kernel to display. The .qtif image file\0Acan be in either 24 or 8 bit mode, but must be in an uncompressed raw\0Aformat. 8 bit mode is preferred, as it requires no conversion to the\0Acolors that are contained in the CLUT. If a color cannot be found in\0Athe CLUT, it will be converted to the nearest gray. The default CLUT\0Ais the same as the system CLUT. If needed, this can be overridden by\0Aproviding a new CLUT with the -c option.\0A\0AHowever, if you override the default CLUT. The panic UI may not appear\0Aas you intended, when the systme is in 8 bit mode. Colors that are not\0Apresent in the active CLUT, will be converted to the nearest gray.\0A\0AThe panic dialog must have a number of lines reserved at the bottom for\0Adisplaying additional panic information. The minimum number of lines\0Ais 20. The font use to display this information needs to have the\0Aforeground and background colors defined. The defaults are full white\0Aon dark gray. This can be changed by using the -fg and/or -bg options to\0Aprovide new 24 bit colors. These colors must be contained in the CLUT.\0A\0AThere are two possible output results. The default is to create a C\0Asource file named panic_image.c that contains the panic image in a 8 bit\0Amodified RLE compressed format and the CLUT that was used to create the\0Aimage. The second possibility is to create a binary version of the same\0Ainformation by using the -o option. This file can then be used to replace\0Athe panic dialog that is currently active in the kernel by using\0Asysctl(KERN_PANIC_INFO).\0A\0A\00"
define void @usage(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([1423 x i8], [1423 x i8]* @.str, i64 0, i64 0))
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([1625 x i8], [1625 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}