#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*/ basename(char *);
int /*<<< orphan*/ stderr_print(char *, ...);
int /*<<< orphan*/ strncpy(char *, char const *, int);
void print_usage(const char *exec_name) {
  char buffer[2048];
  (void)strncpy(buffer, exec_name, 2048);
  buffer[2048 - 1] = 0;
  stderr_print("Usage: %s [option(s)]\n", basename(buffer));
  stderr_print("  -h    print help\n"
               "  -d    path of the file to save the data in screen\n"
               "  -l    0/1/2, the level of output warning message\n"
               "  -f    path of the file to save warning message.\n"
               "        e.g. numatop -l 2 -f /tmp/warn.log.\n"
               "  -s    sampling precision: \n"
               "        normal: balance precision and overhead (default)\n"
               "        high  : high sampling precision\n"
               "                (high overhead, not recommended option)\n"
               "        low   : low sampling precision, suitable for high"
               " load system\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x800,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x11(%rbp)
lea    -0x810(%rbp),%rdi
call   1050 <basename@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <stderr_print@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <stderr_print@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
sub    $0x800,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x800,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x7ff(%rsp)
mov    %rbx,%rdi
call   1050 <basename@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <stderr_print@plt>
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1040 <stderr_print@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s [option(s)]\0A\00"
@.str.1 = [469 x i8] c" -h print help\0A -d path of the file to save the data in screen\0A -l 0/1/2, the level of output warning message\0A -f path of the file to save warning message.\0A e.g. numatop -l 2 -f /tmp/warn.log.\0A -s sampling precision: \0A normal: balance precision and overhead (default)\0A high : high sampling precision\0A (high overhead, not recommended option)\0A low : low sampling precision, suitable for high load system\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
%3 = alloca [2048 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 2048)
%7 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 2047
store i8 0, i8* %7
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%9 = call i32 @basename(i8* %8)
%10 = call i32 (i8*, ...) @stderr_print(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (i8*, ...) @stderr_print(i8* getelementptr inbounds ([469 x i8], [469 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s [option(s)]\0A\00"
@.str.1 = [469 x i8] c" -h print help\0A -d path of the file to save the data in screen\0A -l 0/1/2, the level of output warning message\0A -f path of the file to save warning message.\0A e.g. numatop -l 2 -f /tmp/warn.log.\0A -s sampling precision: \0A normal: balance precision and overhead (default)\0A high : high sampling precision\0A (high overhead, not recommended option)\0A low : low sampling precision, suitable for high load system\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 2048)
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 2047
store i8 0, i8* %5
%6 = call i32 @basename(i8* %3)
%7 = call i32 (i8*, ...) @stderr_print(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @stderr_print(i8* getelementptr inbounds ([469 x i8], [469 x i8]* @.str.1, i64 0, i64 0))
ret void
}