#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*/ printf(char *, ...);
int usage(char *arg) {
  printf("\n[0;32m******************************[0m\n");
  printf("[0;32m* MIG Logcleaner v2.0 by [0;31mno1 [0;32m*[0m\n");
  printf("[0;32m******************************[0m\n");
  printf("usage: %s [-u] [-n] [-d] [-a] [-b] [-R] [-A] [-U] [-T] [-H] [-I] "
         "[-O] [-d]\n\n",
         arg);
  printf(" [-u <user>]\t- username\n");
  printf(" [-n <n>]\t- username record number, 0 removes all records (default: "
         "1)\n");
  printf(" [-d <dir>]\t- log directory (default: /var/log/)\n");
  printf(" [-a <string1>]\t- string to remove out of every file in a log dir "
         "(ip?)\n");
  printf(" [-b <string2>]\t- string to remove out of every file in a log dir "
         "(hostname?)\n");
  printf(" [-R]\t\t- replace details of specified user entry\n");
  printf(" [-A]\t\t- add new entry before specified user entry (default: 1st "
         "entry in list)\n");
  printf(" [-U <user>]\t- new username used in -R of -A\n");
  printf(" [-T <tty>]\t- new tty used in -A\n");
  printf(" [-H <host>]\t- new hostname used in -R or -A\n");
  printf(" [-I <n>]\t- new log in time used in -R or -A (unit time format)\n");
  printf(" [-O <n>]\t- new log out time used in -R or -A (unit time format)\n");
  printf(" [-d]\t\t- debug mode\n\n");
  printf("eg:    %s -u john -n 2 -d /secret/logs/ -a 1.2.3.4 -b leet.org\n",
         arg);
  printf("       %s -u john -n 6\n", arg);
  printf("       %s -d /secret/logs/ -a 1.2.3.4\n", arg);
  printf("       %s -u john -n 2 -R -H china.gov\n", arg);
  printf("       %s -u john -n 5 -A -U jane -T tty1 -H arb.com -I 12345334 -O "
         "12345397\n\n",
         arg);
  return (0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xff7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1038(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x105c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x109f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10bf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10d3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10f3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1126(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x115a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x115e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x118c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x1192(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x11a7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x11bd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0x1018(%rip),%rdi
call   1030 <puts@plt>
lea    0x1037(%rip),%rdi
call   1030 <puts@plt>
lea    0x1001(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1046(%rip),%rdi
call   1030 <puts@plt>
lea    0x1052(%rip),%rdi
call   1030 <puts@plt>
lea    0x108d(%rip),%rdi
call   1030 <puts@plt>
lea    0x10b2(%rip),%rdi
call   1030 <puts@plt>
lea    0x10ee(%rip),%rdi
call   1030 <puts@plt>
lea    0x1130(%rip),%rdi
call   1030 <puts@plt>
lea    0x1155(%rip),%rdi
call   1030 <puts@plt>
lea    0x1199(%rip),%rdi
call   1030 <puts@plt>
lea    0x11ba(%rip),%rdi
call   1030 <puts@plt>
lea    0x11cf(%rip),%rdi
call   1030 <puts@plt>
lea    0x11f0(%rip),%rdi
call   1030 <puts@plt>
lea    0x1224(%rip),%rdi
call   1030 <puts@plt>
lea    0x1259(%rip),%rdi
call   1030 <puts@plt>
lea    0xe51(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe80(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe87(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"\0A\1B[0;32m******************************\1B[0m\0A\00"
@.str.1 = [57 x i8] c"\1B[0;32m* MIG Logcleaner v2.0 by \1B[0;31mno1 \1B[0;32m*\1B[0m\0A\00"
@.str.2 = [43 x i8] c"\1B[0;32m******************************\1B[0m\0A\00"
@.str.3 = [77 x i8] c"usage: %s [-u] [-n] [-d] [-a] [-b] [-R] [-A] [-U] [-T] [-H] [-I] [-O] [-d]\0A\0A\00"
@.str.4 = [25 x i8] c" [-u <user>]\09- username\0A\00"
@.str.5 = [72 x i8] c" [-n <n>]\09- username record number, 0 removes all records (default: 1)\0A\00"
@.str.6 = [50 x i8] c" [-d <dir>]\09- log directory (default: /var/log/)\0A\00"
@.str.7 = [73 x i8] c" [-a <string1>]\09- string to remove out of every file in a log dir (ip?)\0A\00"
@.str.8 = [79 x i8] c" [-b <string2>]\09- string to remove out of every file in a log dir (hostname?)\0A\00"
@.str.9 = [50 x i8] c" [-R]\09\09- replace details of specified user entry\0A\00"
@.str.10 = [81 x i8] c" [-A]\09\09- add new entry before specified user entry (default: 1st entry in list)\0A\00"
@.str.11 = [46 x i8] c" [-U <user>]\09- new username used in -R of -A\0A\00"
@.str.12 = [34 x i8] c" [-T <tty>]\09- new tty used in -A\0A\00"
@.str.13 = [46 x i8] c" [-H <host>]\09- new hostname used in -R or -A\0A\00"
@.str.14 = [65 x i8] c" [-I <n>]\09- new log in time used in -R or -A (unit time format)\0A\00"
@.str.15 = [66 x i8] c" [-O <n>]\09- new log out time used in -R or -A (unit time format)\0A\00"
@.str.16 = [22 x i8] c" [-d]\09\09- debug mode\0A\0A\00"
@.str.17 = [64 x i8] c"eg: %s -u john -n 2 -d /secret/logs/ -a 1.2.3.4 -b leet.org\0A\00"
@.str.18 = [24 x i8] c" %s -u john -n 6\0A\00"
@.str.19 = [39 x i8] c" %s -d /secret/logs/ -a 1.2.3.4\0A\00"
@.str.20 = [40 x i8] c" %s -u john -n 2 -R -H china.gov\0A\00"
@.str.21 = [79 x i8] c" %s -u john -n 5 -A -U jane -T tty1 -H arb.com -I 12345334 -O 12345397\0A\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.10, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.11, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.13, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.14, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.15, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0))
%21 = load i8*, i8** %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.17, i64 0, i64 0), i8* %21)
%23 = load i8*, i8** %2
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0), i8* %23)
%25 = load i8*, i8** %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.19, i64 0, i64 0), i8* %25)
%27 = load i8*, i8** %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.20, i64 0, i64 0), i8* %27)
%29 = load i8*, i8** %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.21, i64 0, i64 0), i8* %29)
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [77 x i8] c"usage: %s [-u] [-n] [-d] [-a] [-b] [-R] [-A] [-U] [-T] [-H] [-I] [-O] [-d]\0A\0A\00"
@.str.17 = [64 x i8] c"eg: %s -u john -n 2 -d /secret/logs/ -a 1.2.3.4 -b leet.org\0A\00"
@.str.18 = [24 x i8] c" %s -u john -n 6\0A\00"
@.str.19 = [39 x i8] c" %s -d /secret/logs/ -a 1.2.3.4\0A\00"
@.str.20 = [40 x i8] c" %s -u john -n 2 -R -H china.gov\0A\00"
@.str.21 = [79 x i8] c" %s -u john -n 5 -A -U jane -T tty1 -H arb.com -I 12345334 -O 12345397\0A\0A\00"
@str = [43 x i8] c"\0A\1B[0;32m******************************\1B[0m\00"
@str.22 = [56 x i8] c"\1B[0;32m* MIG Logcleaner v2.0 by \1B[0;31mno1 \1B[0;32m*\1B[0m\00"
@str.23 = [42 x i8] c"\1B[0;32m******************************\1B[0m\00"
@str.24 = [24 x i8] c" [-u <user>]\09- username\00"
@str.25 = [71 x i8] c" [-n <n>]\09- username record number, 0 removes all records (default: 1)\00"
@str.26 = [49 x i8] c" [-d <dir>]\09- log directory (default: /var/log/)\00"
@str.27 = [72 x i8] c" [-a <string1>]\09- string to remove out of every file in a log dir (ip?)\00"
@str.28 = [78 x i8] c" [-b <string2>]\09- string to remove out of every file in a log dir (hostname?)\00"
@str.29 = [49 x i8] c" [-R]\09\09- replace details of specified user entry\00"
@str.30 = [80 x i8] c" [-A]\09\09- add new entry before specified user entry (default: 1st entry in list)\00"
@str.31 = [45 x i8] c" [-U <user>]\09- new username used in -R of -A\00"
@str.32 = [33 x i8] c" [-T <tty>]\09- new tty used in -A\00"
@str.33 = [45 x i8] c" [-H <host>]\09- new hostname used in -R or -A\00"
@str.34 = [64 x i8] c" [-I <n>]\09- new log in time used in -R or -A (unit time format)\00"
@str.35 = [65 x i8] c" [-O <n>]\09- new log out time used in -R or -A (unit time format)\00"
@str.36 = [21 x i8] c" [-d]\09\09- debug mode\0A\00"
define i32 @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.22, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.23, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.24, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.25, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.26, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str.27, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.28, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.29, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.30, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.31, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.32, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.33, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.34, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.35, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.36, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.17, i64 0, i64 0), i8* %0)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0), i8* %0)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.19, i64 0, i64 0), i8* %0)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.20, i64 0, i64 0), i8* %0)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str.21, i64 0, i64 0), i8* %0)
ret i32 0
}