void usage(char *argv0) {
  printf("%s: [--verbose] [--every=n] [cmd1] [...] [cmdn]\n", argv0);
  printf("%*.*s", (int)strlen(argv0), (int)strlen(argv0), " ");
  printf("Drive a string of GE lights connected to an Arduino.\n");
  printf("\nCommand can be one of:\n");
  printf(
      "\n  bulb:  Write bulbs as per specificed colors and ranges (default)\n");
  printf("  init:    Initialize the bulbs\n");
  printf("  sync:    Synchornize with the arduino\n");
  printf("  status:  Print a sort status message\n");
  printf("  clear:   Clear the bulbs on all strings\n");
  printf("\nAdditional options that apply to bulb mode:\n");
  printf("    [--delay=usecs]\n");
  printf("    [--string=n[-m]] [--addr=n[-m]] [--bright=n[-m]]\n");
  printf("    [--red=n[-m]] [--green=n[-m]] [--blue=n[-m]]\n");
  printf("--every indicates how many bulbs are sent before an ack is required. "
         " Default 24.\n");
  printf("  This prevents over driving the serial line.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xed2(%rip),%rdi
lea    0xed1(%rip),%rcx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xfb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xfbb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xfe3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x1007(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0x104c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xedd(%rip),%rdi
lea    0xedc(%rip),%rcx
mov    %eax,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
lea    0xf39(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf69(%rip),%rdi
call   1030 <puts@plt>
lea    0xf84(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa2(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc3(%rip),%rdi
call   1030 <puts@plt>
lea    0xfcb(%rip),%rdi
call   1030 <puts@plt>
lea    0xff4(%rip),%rdi
call   1030 <puts@plt>
lea    0x1019(%rip),%rdi
call   1030 <puts@plt>
lea    0x105f(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"%s: [--verbose] [--every=n] [cmd1] [...] [cmdn]\0A\00"
@.str.1 = [6 x i8] c"%*.*s\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [54 x i8] c"Drive a string of GE lights connected to an Arduino.\0A\00"
@.str.4 = [25 x i8] c"\0ACommand can be one of:\0A\00"
@.str.5 = [69 x i8] c"\0A bulb: Write bulbs as per specificed colors and ranges (default)\0A\00"
@.str.6 = [33 x i8] c" init: Initialize the bulbs\0A\00"
@.str.7 = [41 x i8] c" sync: Synchornize with the arduino\0A\00"
@.str.8 = [40 x i8] c" status: Print a sort status message\0A\00"
@.str.9 = [43 x i8] c" clear: Clear the bulbs on all strings\0A\00"
@.str.10 = [46 x i8] c"\0AAdditional options that apply to bulb mode:\0A\00"
@.str.11 = [21 x i8] c" [--delay=usecs]\0A\00"
@.str.12 = [54 x i8] c" [--string=n[-m]] [--addr=n[-m]] [--bright=n[-m]]\0A\00"
@.str.13 = [50 x i8] c" [--red=n[-m]] [--green=n[-m]] [--blue=n[-m]]\0A\00"
@.str.14 = [83 x i8] c"--every indicates how many bulbs are sent before an ack is required. Default 24.\0A\00"
@.str.15 = [47 x i8] c" This prevents over driving the serial line.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
%8 = load i8*, i8** %2
%9 = call i64 @strlen(i8* %8)
%10 = trunc i64 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.13, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.14, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.15, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"%s: [--verbose] [--every=n] [cmd1] [...] [cmdn]\0A\00"
@.str.1 = [6 x i8] c"%*.*s\00"
@.str.2 = [2 x i8] c" \00"
@str = [53 x i8] c"Drive a string of GE lights connected to an Arduino.\00"
@str.16 = [24 x i8] c"\0ACommand can be one of:\00"
@str.17 = [68 x i8] c"\0A bulb: Write bulbs as per specificed colors and ranges (default)\00"
@str.18 = [32 x i8] c" init: Initialize the bulbs\00"
@str.19 = [40 x i8] c" sync: Synchornize with the arduino\00"
@str.20 = [39 x i8] c" status: Print a sort status message\00"
@str.21 = [42 x i8] c" clear: Clear the bulbs on all strings\00"
@str.22 = [45 x i8] c"\0AAdditional options that apply to bulb mode:\00"
@str.23 = [20 x i8] c" [--delay=usecs]\00"
@str.24 = [53 x i8] c" [--string=n[-m]] [--addr=n[-m]] [--bright=n[-m]]\00"
@str.25 = [49 x i8] c" [--red=n[-m]] [--green=n[-m]] [--blue=n[-m]]\00"
@str.26 = [82 x i8] c"--every indicates how many bulbs are sent before an ack is required. Default 24.\00"
@str.27 = [46 x i8] c" This prevents over driving the serial line.\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.17, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.18, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.19, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.20, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.21, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.22, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.23, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.24, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.25, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.26, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.27, i64 0, i64 0))
ret void
}