#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ tdmr_extend(int, char **);
int /*<<< orphan*/ tdmr_slide(int, char **);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    fprintf(stderr, "\n");
    fprintf(stderr, "Fuck the tDMR detection\n\n");
    fprintf(stderr, "Usage:         tdmr <prog> [opt] <infile>\n");
    fprintf(stderr, "Prog:          slide    using sliding window to calculate "
                    "the significant regions\n");
    fprintf(stderr, "               extend   extend the significant regions\n");
    fprintf(stderr, "\n");
    exit(0);
  }
  if (strcmp(argv[1], "slide") == 0)
    tdmr_slide(argc - 1, argv + 1);
  else if (strcmp(argv[1], "extend") == 0)
    tdmr_extend(argc - 1, argv + 1);
  else {
    fprintf(stderr, "Unrecognized program identifier %s\n\n", argv[1]);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1201 <main+0xb1>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
lea    0xe6c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
lea    0xe25(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xec0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1237 <main+0xe7>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <tdmr_slide@plt>
jmp    1291 <main+0x141>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe90(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    126d <main+0x11d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1060 <tdmr_extend@plt>
jmp    128c <main+0x13c>
mov    0x2d6c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe58(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1291 <main+0x141>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x1,%edi
jle    11ce <main+0x7e>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
add    $0x8,%rbx
lea    0xf64(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11a6 <main+0x56>
mov    (%rbx),%rdi
lea    0xf56(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11b5 <main+0x65>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xf40(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    11c2 <main+0x72>
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <tdmr_slide@plt>
jmp    11c2 <main+0x72>
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <tdmr_extend@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e0b(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xe39(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xe0d(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xe16(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xe30(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xe72(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [26 x i8] c"Fuck the tDMR detection\0A\0A\00"
@.str.2 = [43 x i8] c"Usage: tdmr <prog> [opt] <infile>\0A\00"
@.str.3 = [83 x i8] c"Prog: slide using sliding window to calculate the significant regions\0A\00"
@.str.4 = [56 x i8] c" extend extend the significant regions\0A\00"
@.str.5 = [6 x i8] c"slide\00"
@.str.6 = [7 x i8] c"extend\00"
@.str.7 = [37 x i8] c"Unrecognized program identifier %s\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %22
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.3, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 0)
unreachable
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %22
%29 = load i32, i32* %4
%30 = sub nsw i32 %29, 1
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = call i32 @tdmr_slide(i32 %30, i8** %32)
br label %53
34: ; preds = %22
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %46
40: ; preds = %34
%41 = load i32, i32* %4
%42 = sub nsw i32 %41, 1
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = call i32 @tdmr_extend(i32 %42, i8** %44)
br label %52
46: ; preds = %34
%47 = load i32, i32* @stderr
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 1
%50 = load i8*, i8** %49
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* %50)
br label %52
52: ; preds = %46, %40
br label %53
53: ; preds = %52, %28
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [26 x i8] c"Fuck the tDMR detection\0A\0A\00"
@.str.2 = [43 x i8] c"Usage: tdmr <prog> [opt] <infile>\0A\00"
@.str.3 = [83 x i8] c"Prog: slide using sliding window to calculate the significant regions\0A\00"
@.str.4 = [56 x i8] c" extend extend the significant regions\0A\00"
@.str.5 = [6 x i8] c"slide\00"
@.str.6 = [7 x i8] c"extend\00"
@.str.7 = [37 x i8] c"Unrecognized program identifier %s\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.3, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%17 = tail call i32 @exit(i32 0)
unreachable
18: ; preds = %2
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = add nsw i32 %0, -1
%25 = tail call i32 @tdmr_slide(i32 %24, i8** %19)
br label %37
26: ; preds = %18
%27 = load i8*, i8** %19
%28 = tail call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = add nsw i32 %0, -1
%32 = tail call i32 @tdmr_extend(i32 %31, i8** %19)
br label %37
33: ; preds = %26
%34 = load i32, i32* @stderr
%35 = load i8*, i8** %19
%36 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i8* %35)
br label %37
37: ; preds = %30, %33, %23
ret i32 1
}