#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 /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void help(char *prog_name) {
  printf("Version %s\n", "0.1");
  printf("Usage: %s <switches>\n\n", prog_name);
  printf("Switches:\n"
         "-h,     --help            help\n"
         "-s,     --show            show current settings\n"
         "-v,     --volume <vol>    set TV volume (0-63, 0 loudest)\n"
         "-m,     --mute            mute TV volume\n"
         "-u,     --unmute          unmute TV volume\n"
         "-rv,    --route-video <dest> <src>               route VIDEO\n"
         "-ra,    --route-audio <dest> <src>               route AUDIO\n"
         "-zcd,   --zero-cross-detector <on/off>           set ZCD\n"
         "-fnc,   --video-function-switch-control <0/1/2/3 set FNC\n"
         "-ycm,   --y-c-mix <0/1>                          set Y/C Mix (only "
         "cxa2092)\n"
         "-fblk,  --video-fast-blanking-control <0/1/2/3>  set FBLK\n"
         "-log1,  --logic1 <0/1>                           set logic output 1\n"
         "-log2,  --logic2 <0/1>                           set logic output 2\n"
         "-log3,  --logic3 <0/1>                           set logic output 3\n"
         "-log4,  --logic4 <0/1>                           set logic output 4\n"
         "-ttv,  --trash-my-tv                            trashes your tv\n\n");
  exit(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
lea    0xeca(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Version %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@.str.2 = [23 x i8] c"Usage: %s <switches>\0A\0A\00"
@.str.3 = [939 x i8] c"Switches:\0A-h, --help help\0A-s, --show show current settings\0A-v, --volume <vol> set TV volume (0-63, 0 loudest)\0A-m, --mute mute TV volume\0A-u, --unmute unmute TV volume\0A-rv, --route-video <dest> <src> route VIDEO\0A-ra, --route-audio <dest> <src> route AUDIO\0A-zcd, --zero-cross-detector <on/off> set ZCD\0A-fnc, --video-function-switch-control <0/1/2/3 set FNC\0A-ycm, --y-c-mix <0/1> set Y/C Mix (only cxa2092)\0A-fblk, --video-fast-blanking-control <0/1/2/3> set FBLK\0A-log1, --logic1 <0/1> set logic output 1\0A-log2, --logic2 <0/1> set logic output 2\0A-log3, --logic3 <0/1> set logic output 3\0A-log4, --logic4 <0/1> set logic output 4\0A-ttv, --trash-my-tv trashes your tv\0A\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([939 x i8], [939 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"Version %s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@.str.2 = [23 x i8] c"Usage: %s <switches>\0A\0A\00"
@str = [938 x i8] c"Switches:\0A-h, --help help\0A-s, --show show current settings\0A-v, --volume <vol> set TV volume (0-63, 0 loudest)\0A-m, --mute mute TV volume\0A-u, --unmute unmute TV volume\0A-rv, --route-video <dest> <src> route VIDEO\0A-ra, --route-audio <dest> <src> route AUDIO\0A-zcd, --zero-cross-detector <on/off> set ZCD\0A-fnc, --video-function-switch-control <0/1/2/3 set FNC\0A-ycm, --y-c-mix <0/1> set Y/C Mix (only cxa2092)\0A-fblk, --video-fast-blanking-control <0/1/2/3> set FBLK\0A-log1, --logic1 <0/1> set logic output 1\0A-log2, --logic2 <0/1> set logic output 2\0A-log3, --logic3 <0/1> set logic output 3\0A-log4, --logic4 <0/1> set logic output 4\0A-ttv, --trash-my-tv trashes your tv\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([938 x i8], [938 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}