#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 *, char *, ...);
int strlen(char *);
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, 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 quicker 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    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x21(%rbp)
jb     118b <usage+0x5b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    119b <usage+0x6b>
jmp    11ac <usage+0x7c>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1168 <usage+0x38>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe45(%rip),%rdi
movsd  0xe35(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe35(%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>
cltq
lea    (%r14,%rax,1),%rbx
test   %eax,%eax
js     115e <usage+0x2e>
nopl   0x0(%rax)
cmpb   $0x2f,(%rbx)
je     115e <usage+0x2e>
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jae    1150 <usage+0x20>
add    $0x1,%rbx
lea    0xe9f(%rip),%rdi
movsd  0xe8f(%rip),%xmm0
mov    %rbx,%rsi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe90(%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 = [466 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 quicker 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 i32 @strlen(i8* %9)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8* %12, i8** %4
br label %13
13: ; preds = %24, %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = icmp uge i8* %14, %15
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 47
br label %22
22: ; preds = %17, %13
%23 = phi i1 [ false, %13 ], [ %21, %17 ]
br i1 %23, label %24, label %27
24: ; preds = %22
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 -1
store i8* %26, i8** %4
br label %13
27: ; preds = %22
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %4
%30 = load i8*, i8** %4
%31 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %30, double 3.000000e-01)
%32 = load i8*, i8** %4
%33 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([466 x i8], [466 x i8]* @.str.1, i64 0, i64 0), i8* %32)
%34 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s %1.2f\0A\00"
@.str.1 = [466 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 quicker than higher (off)\0A () above are defaults \0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @strlen(i8* %2)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 %4
%6 = icmp slt i32 %3, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %11
%8 = phi i8* [ %12, %11 ], [ %5, %1 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 47
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = getelementptr inbounds i8, i8* %8, i64 -1
%13 = icmp ult i8* %12, %2
br i1 %13, label %14, label %7
14: ; preds = %7, %11, %1
%15 = phi i8* [ %5, %1 ], [ %12, %11 ], [ %8, %7 ]
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %16, double 3.000000e-01)
%18 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([466 x i8], [466 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%19 = tail call i32 @exit(i32 0)
unreachable
}