#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ isDebug(int, char const **);
scalar_t__ isHelp(int, char const **);
int /*<<< orphan*/ isSetParams(int, char const **);
int /*<<< orphan*/ preparePositionParam(int, char const **);
int /*<<< orphan*/ readStdin(char const *, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ showHelp(char const *);
int /*<<< orphan*/ stderr;
int main(int argc, const char **argv) {
  if (!isSetParams(argc, argv)) {
    fprintf(stderr, "Nejsou definovany nutne parametry, nebo jsou definovany "
                    "spatne. Pro napovedu pouzijte prepinac --help\n");
    return 64;
  } else if (isHelp(argc, argv)) {
    showHelp(argv[0]);
  } else {
    readStdin(argv[1], preparePositionParam(argc, argv), isDebug(argc, argv));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <isSetParams@plt>
cmp    $0x0,%eax
jne    11bc <main+0x4c>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
lea    0xe55(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0x40,-0x4(%rbp)
jmp    1224 <main+0xb4>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <isHelp@plt>
cmp    $0x0,%rax
je     11e3 <main+0x73>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <showHelp@plt>
jmp    1218 <main+0xa8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <preparePositionParam@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <isDebug@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1050 <readStdin@plt>
jmp    121d <main+0xad>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1090 <isSetParams@plt>
test   %eax,%eax
je     119e <main+0x2e>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <isHelp@plt>
test   %rax,%rax
je     11ba <main+0x4a>
mov    (%rbx),%rdi
call   1030 <showHelp@plt>
jmp    11e2 <main+0x72>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
lea    0xe52(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x40,%eax
jmp    11e4 <main+0x74>
mov    0x8(%rbx),%r14
mov    %ebp,%edi
mov    %rbx,%rsi
call   1070 <preparePositionParam@plt>
mov    %eax,%r15d
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <isDebug@plt>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %eax,%edx
call   1050 <readStdin@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [103 x i8] c"Nejsou definovany nutne parametry, nebo jsou definovany spatne. Pro napovedu pouzijte prepinac --help\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 = load i8**, i8*** %5
%8 = call i32 @isSetParams(i32 %6, i8** %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
store i32 64, i32* %3
br label %36
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = call i64 @isHelp(i32 %14, i8** %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 @showHelp(i8* %21)
br label %34
23: ; preds = %13
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = load i32, i32* %4
%28 = load i8**, i8*** %5
%29 = call i32 @preparePositionParam(i32 %27, i8** %28)
%30 = load i32, i32* %4
%31 = load i8**, i8*** %5
%32 = call i32 @isDebug(i32 %30, i8** %31)
%33 = call i32 @readStdin(i8* %26, i32 %29, i32 %32)
br label %34
34: ; preds = %23, %18
br label %35
35: ; preds = %34
store i32 0, i32* %3
br label %36
36: ; preds = %35, %10
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [103 x i8] c"Nejsou definovany nutne parametry, nebo jsou definovany spatne. Pro napovedu pouzijte prepinac --help\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @isSetParams(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
br label %20
8: ; preds = %2
%9 = tail call i64 @isHelp(i32 %0, i8** %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i8*, i8** %1
%13 = tail call i32 @showHelp(i8* %12)
br label %20
14: ; preds = %8
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32 @preparePositionParam(i32 %0, i8** %1)
%18 = tail call i32 @isDebug(i32 %0, i8** %1)
%19 = tail call i32 @readStdin(i8* %16, i32 %17, i32 %18)
br label %20
20: ; preds = %14, %11, %5
%21 = phi i32 [ 64, %5 ], [ 0, %11 ], [ 0, %14 ]
ret i32 %21
}