#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*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void printUsage(FILE *stream, const char *programName) {
  fprintf(stream, "Usage: %s <option(s)> <file>\n", programName);
  fprintf(stream,
          " Disassembles AVR program file <file>. Use - for standard input.\n");
  fprintf(stream, " Written by Vanya A. Sergeev - <vsergeev@gmail.com>.\n\n");
  fprintf(stream,
          " Additional Options:\n  -o, --out-file <output file>	Write to "
          "output file instead of standard output.\n  -t, --file-type "
          "<type>	Specify the file type of the object file.\n  -l, "
          "--address-label <prefix> 	Create ghetto address labels with "
          "\n				the specified label prefix.\n  "
          "--original			Print original opcode data "
          "alongside\n				disassembly.\n  "
          "--data-base-hex		Represent data constants in "
          "hexadecimal\n				(default).\n  "
          "--data-base-bin		Represent data constants in binary.\n  "
          "--data-base-dec		Represent data constants in decimal.\n "
          " --no-addresses		Do not display the address "
          "alongside\n				disassembly.\n  "
          "--no-destination-comments	Do not display the destination "
          "address\n				comments of relative "
          "branch/jump/call\n				instructions.\n  -h, "
          "--help			Display this usage/help.\n  -v, "
          "--version			Display the program's version.\n\n");
  fprintf(stream, "Supported file types:\n  Atmel Generic		"
                  "	generic\n  Intel HEX8 			ihex\n  "
                  "Motorola S-Record 		srecord\n\n");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf0d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf32(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x124b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xee2(%rip),%rdi
mov    $0x41,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf0b(%rip),%rdi
mov    $0x36,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf29(%rip),%rdi
mov    $0x32a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0x123b(%rip),%rdi
mov    $0x64,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: %s <option(s)> <file>\0A\00"
@.str.1 = [66 x i8] c" Disassembles AVR program file <file>. Use - for standard input.\0A\00"
@.str.2 = [55 x i8] c" Written by Vanya A. Sergeev - <vsergeev@gmail.com>.\0A\0A\00"
@.str.3 = [811 x i8] c" Additional Options:\0A -o, --out-file <output file>\09Write to output file instead of standard output.\0A -t, --file-type <type>\09Specify the file type of the object file.\0A -l, --address-label <prefix> \09Create ghetto address labels with \0A\09\09\09\09the specified label prefix.\0A --original\09\09\09Print original opcode data alongside\0A\09\09\09\09disassembly.\0A --data-base-hex\09\09Represent data constants in hexadecimal\0A\09\09\09\09(default).\0A --data-base-bin\09\09Represent data constants in binary.\0A --data-base-dec\09\09Represent data constants in decimal.\0A --no-addresses\09\09Do not display the address alongside\0A\09\09\09\09disassembly.\0A --no-destination-comments\09Do not display the destination address\0A\09\09\09\09comments of relative branch/jump/call\0A\09\09\09\09instructions.\0A -h, --help\09\09\09Display this usage/help.\0A -v, --version\09\09\09Display the program's version.\0A\0A\00"
@.str.4 = [101 x i8] c"Supported file types:\0A Atmel Generic\09\09\09generic\0A Intel HEX8 \09\09\09ihex\0A Motorola S-Record \09\09srecord\0A\0A\00"
define void @printUsage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %3
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %3
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %10, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32*, i32** %3
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([811 x i8], [811 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32*, i32** %3
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Usage: %s <option(s)> <file>\0A\00"
@.str.1 = [66 x i8] c" Disassembles AVR program file <file>. Use - for standard input.\0A\00"
@.str.2 = [55 x i8] c" Written by Vanya A. Sergeev - <vsergeev@gmail.com>.\0A\0A\00"
@.str.3 = [811 x i8] c" Additional Options:\0A -o, --out-file <output file>\09Write to output file instead of standard output.\0A -t, --file-type <type>\09Specify the file type of the object file.\0A -l, --address-label <prefix> \09Create ghetto address labels with \0A\09\09\09\09the specified label prefix.\0A --original\09\09\09Print original opcode data alongside\0A\09\09\09\09disassembly.\0A --data-base-hex\09\09Represent data constants in hexadecimal\0A\09\09\09\09(default).\0A --data-base-bin\09\09Represent data constants in binary.\0A --data-base-dec\09\09Represent data constants in decimal.\0A --no-addresses\09\09Do not display the address alongside\0A\09\09\09\09disassembly.\0A --no-destination-comments\09Do not display the destination address\0A\09\09\09\09comments of relative branch/jump/call\0A\09\09\09\09instructions.\0A -h, --help\09\09\09Display this usage/help.\0A -v, --version\09\09\09Display the program's version.\0A\0A\00"
@.str.4 = [101 x i8] c"Supported file types:\0A Atmel Generic\09\09\09generic\0A Intel HEX8 \09\09\09ihex\0A Motorola S-Record \09\09srecord\0A\0A\00"
define void @printUsage(i32* nocapture %0, i8* %1) {
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), i64 65, i64 1, i32* %0)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i64 54, i64 1, i32* %0)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([811 x i8], [811 x i8]* @.str.3, i64 0, i64 0), i64 810, i64 1, i32* %0)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.4, i64 0, i64 0), i64 100, i64 1, i32* %0)
ret void
}