#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void usage(const char *execName) {
  printf("%s "
         "1.2.0"
         "\n",
         execName);
  printf(
      "Usage: %s filePath filePrefix maxFileSize maxNbOfFiles [prefixWithDate] "
      "[nbLinesBeforeFlush] [printLogStarted] [printToStdout]\n",
      execName);
  printf("Example: %s $ROOTACT/var/log/scl cvm 2048 4\n", execName);
  printf("  filePath           - folder in which log files will be generated. "
         "This path must exists. Must end with '/'\n");
  printf("  filePrefix         - log file prefix\n");
  printf("  maxFileSize        - maximum log file size in Kb\n");
  printf("  maxNbOfFiles       - maximum number of log files\n");
  printf("  prefixWithDate     - whether logs must be prefixed with the "
         "current date. Default is true\n");
  printf("  nbLinesBeforeFlush - number of lines before flushing to the log "
         "file. Default is 10\n");
  printf("  printLogStarted    - whether to print an entry when starting logs. "
         "Default is true\n");
  printf("  printToStdout      - whether to print logs to stdout. Default is "
         "false\n");
  fflush(stdout);
}


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   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1014(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1063(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10ac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10f4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e07(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@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   1040 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf2d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf49(%rip),%rdi
call   1030 <puts@plt>
lea    0xfaa(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc5(%rip),%rdi
call   1030 <puts@plt>
lea    0xfec(%rip),%rdi
call   1030 <puts@plt>
lea    0x1013(%rip),%rdi
call   1030 <puts@plt>
lea    0x1063(%rip),%rdi
call   1030 <puts@plt>
lea    0x10ad(%rip),%rdi
call   1030 <puts@plt>
lea    0x10f6(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s 1.2.0\0A\00"
@.str.1 = [128 x i8] c"Usage: %s filePath filePrefix maxFileSize maxNbOfFiles [prefixWithDate] [nbLinesBeforeFlush] [printLogStarted] [printToStdout]\0A\00"
@.str.2 = [45 x i8] c"Example: %s $ROOTACT/var/log/scl cvm 2048 4\0A\00"
@.str.3 = [110 x i8] c" filePath - folder in which log files will be generated. This path must exists. Must end with '/'\0A\00"
@.str.4 = [40 x i8] c" filePrefix - log file prefix\0A\00"
@.str.5 = [52 x i8] c" maxFileSize - maximum log file size in Kb\0A\00"
@.str.6 = [52 x i8] c" maxNbOfFiles - maximum number of log files\0A\00"
@.str.7 = [93 x i8] c" prefixWithDate - whether logs must be prefixed with the current date. Default is true\0A\00"
@.str.8 = [87 x i8] c" nbLinesBeforeFlush - number of lines before flushing to the log file. Default is 10\0A\00"
@.str.9 = [86 x i8] c" printLogStarted - whether to print an entry when starting logs. Default is true\0A\00"
@.str.10 = [74 x i8] c" printToStdout - whether to print logs to stdout. Default is false\0A\00"
@stdout = global i32 0
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 ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.9, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.10, i64 0, i64 0))
%17 = load i32, i32* @stdout
%18 = call i32 @fflush(i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s 1.2.0\0A\00"
@.str.1 = [128 x i8] c"Usage: %s filePath filePrefix maxFileSize maxNbOfFiles [prefixWithDate] [nbLinesBeforeFlush] [printLogStarted] [printToStdout]\0A\00"
@.str.2 = [45 x i8] c"Example: %s $ROOTACT/var/log/scl cvm 2048 4\0A\00"
@stdout = global i32 0
@str = [109 x i8] c" filePath - folder in which log files will be generated. This path must exists. Must end with '/'\00"
@str.11 = [39 x i8] c" filePrefix - log file prefix\00"
@str.12 = [51 x i8] c" maxFileSize - maximum log file size in Kb\00"
@str.13 = [51 x i8] c" maxNbOfFiles - maximum number of log files\00"
@str.14 = [92 x i8] c" prefixWithDate - whether logs must be prefixed with the current date. Default is true\00"
@str.15 = [86 x i8] c" nbLinesBeforeFlush - number of lines before flushing to the log file. Default is 10\00"
@str.16 = [85 x i8] c" printLogStarted - whether to print an entry when starting logs. Default is true\00"
@str.17 = [73 x i8] c" printToStdout - whether to print logs to stdout. Default is false\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([109 x i8], [109 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.11, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.12, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.13, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @str.14, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str.15, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str.16, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.17, i64 0, i64 0))
%13 = load i32, i32* @stdout
%14 = tail call i32 @fflush(i32 %13)
ret void
}