void usage(char **argv) {
  char *arg = argv[0];
  char *p = arg + strlen(arg);
  while (p >= arg && *p != '/')
    p--;
  p++;
  printf("%s %1.2f\n", p, "V 0.3");
  printf(
      "Usage:\n"
      "%s <options> nr_tasks\n\n"
      "-p prio --prio  prio        base priority to start RT tasks with (2) \n"
      "-r time --run-time time     Run time (ms) to busy loop the threads "
      "(20)\n"
      "-s time --sleep-time time   Sleep time (ms) between intervals (100)\n"
      "-m time --maxerr time       Max allowed error (microsecs)\n"
      "-l loops --loops loops      Number of iterations to run (50)\n"
      "-c    --check               Stop if lower prio task is quick than "
      "higher (off)\n"
      "  () above are defaults \n",
      p);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x21(%rbp)
jb     1189 <usage+0x59>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1199 <usage+0x69>
jmp    11aa <usage+0x7a>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1166 <usage+0x36>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe3f(%rip),%rdi
lea    0xe42(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r14,%rax,1),%rbx
test   %rax,%rax
js     115e <usage+0x2e>
nopl   0x0(%rax,%rax,1)
cmpb   $0x2f,(%rbx)
je     115e <usage+0x2e>
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jae    1150 <usage+0x20>
add    $0x1,%rbx
lea    0xe97(%rip),%rdi
lea    0xe9a(%rip),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s %1.2f\0A\00"
@.str.1 = [6 x i8] c"V 0.3\00"
@.str.2 = [464 x i8] c"Usage:\0A%s <options> nr_tasks\0A\0A-p prio --prio prio base priority to start RT tasks with (2) \0A-r time --run-time time Run time (ms) to busy loop the threads (20)\0A-s time --sleep-time time Sleep time (ms) between intervals (100)\0A-m time --maxerr time Max allowed error (microsecs)\0A-l loops --loops loops Number of iterations to run (50)\0A-c --check Stop if lower prio task is quick than higher (off)\0A () above are defaults \0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i8*
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8* %11, i8** %4
br label %12
12: ; preds = %23, %1
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = icmp uge i8* %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 47
br label %21
21: ; preds = %16, %12
%22 = phi i1 [ false, %12 ], [ %20, %16 ]
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 -1
store i8* %25, i8** %4
br label %12
26: ; preds = %21
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %4
%29 = load i8*, i8** %4
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%31 = load i8*, i8** %4
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([464 x i8], [464 x i8]* @.str.2, i64 0, i64 0), i8* %31)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s %1.2f\0A\00"
@.str.1 = [6 x i8] c"V 0.3\00"
@.str.2 = [464 x i8] c"Usage:\0A%s <options> nr_tasks\0A\0A-p prio --prio prio base priority to start RT tasks with (2) \0A-r time --run-time time Run time (ms) to busy loop the threads (20)\0A-s time --sleep-time time Sleep time (ms) between intervals (100)\0A-m time --maxerr time Max allowed error (microsecs)\0A-l loops --loops loops Number of iterations to run (50)\0A-c --check Stop if lower prio task is quick than higher (off)\0A () above are defaults \0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%4 = getelementptr inbounds i8, i8* %2, i64 %3
%5 = icmp slt i64 %3, 0
br i1 %5, label %13, label %6
6: ; preds = %1, %10
%7 = phi i8* [ %11, %10 ], [ %4, %1 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 47
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %7, i64 -1
%12 = icmp ult i8* %11, %2
br i1 %12, label %13, label %6
13: ; preds = %6, %10, %1
%14 = phi i8* [ %4, %1 ], [ %11, %10 ], [ %7, %6 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([464 x i8], [464 x i8]* @.str.2, i64 0, i64 0), i8* %15)
tail call void @exit(i32 0)
unreachable
}