#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 EXIT_SUCCESS;
int /*<<< orphan*/ basename(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getopt(int, char **, char *);
int /*<<< orphan*/ makepmklist(char *, char *);
char *optarg;
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ usage(int /*<<< orphan*/);
int /*<<< orphan*/ usageerror(int /*<<< orphan*/);
int /*<<< orphan*/ version(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int auswahl;
  char *potname = NULL;
  char *pmkname = NULL;
  setbuf(stdout, NULL);
  while ((auswahl = getopt(argc, argv, "p:P:hv")) != -1) {
    switch (auswahl) {
    case 'p':
      potname = optarg;
      break;
    case 'P':
      pmkname = optarg;
      break;
    case 'h':
      usage(basename(argv[0]));
      break;
    case 'v':
      version(basename(argv[0]));
      break;
    case '?':
      usageerror(basename(argv[0]));
      break;
    }
  }
  if (argc < 2) {
    fprintf(stderr, "no option selected\n");
    return EXIT_SUCCESS;
  }
  if ((potname != NULL) && (pmkname != NULL)) {
    makepmklist(potname, pmkname);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    0x2e23(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe3a(%rip),%rdx
call   1090 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     129d <main+0x11d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x3f,%eax
je     1285 <main+0x105>
jmp    11eb <main+0x6b>
mov    -0x2c(%rbp),%eax
sub    $0x50,%eax
je     1242 <main+0xc2>
jmp    11fc <main+0x7c>
mov    -0x2c(%rbp),%eax
sub    $0x68,%eax
je     1255 <main+0xd5>
jmp    120d <main+0x8d>
mov    -0x2c(%rbp),%eax
sub    $0x70,%eax
je     122f <main+0xaf>
jmp    121e <main+0x9e>
mov    -0x2c(%rbp),%eax
sub    $0x76,%eax
je     126d <main+0xed>
jmp    1298 <main+0x118>
mov    0x2dc2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1298 <main+0x118>
mov    0x2daf(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    1298 <main+0x118>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <basename@plt>
mov    %eax,%edi
call   1070 <usage@plt>
jmp    1298 <main+0x118>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <basename@plt>
mov    %eax,%edi
call   1060 <version@plt>
jmp    1298 <main+0x118>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <basename@plt>
mov    %eax,%edi
call   10a0 <usageerror@plt>
jmp    11b8 <main+0x38>
cmpl   $0x2,-0x8(%rbp)
jge    12cd <main+0x14d>
mov    0x2d2a(%rip),%rax
mov    (%rax),%edi
lea    0xd50(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2d05(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12fc <main+0x17c>
cmpq   $0x0,-0x20(%rbp)
je     12f0 <main+0x170>
cmpq   $0x0,-0x28(%rbp)
je     12f0 <main+0x170>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <makepmklist@plt>
mov    0x2cd1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
xor    %r14d,%r14d
xor    %esi,%esi
call   1030 <setbuf@plt>
lea    0xef2(%rip),%r12
lea    0xe4f(%rip),%r13
xor    %r15d,%r15d
jmp    11cf <main+0x4f>
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx),%rdi
call   1050 <basename@plt>
mov    %eax,%edi
call   1060 <version@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1090 <getopt@plt>
lea    -0x50(%rax),%ecx
cmp    $0x26,%ecx
ja     1200 <main+0x80>
movslq 0x0(%r13,%rcx,4),%rax
add    %r13,%rax
jmp    *%rax
mov    (%rbx),%rdi
call   1050 <basename@plt>
mov    %eax,%edi
call   1070 <usage@plt>
jmp    11cf <main+0x4f>
nop
cmp    $0x3f,%eax
je     120c <main+0x8c>
cmp    $0xffffffff,%eax
jne    11cf <main+0x4f>
jmp    1235 <main+0xb5>
mov    (%rbx),%rdi
call   1050 <basename@plt>
mov    %eax,%edi
call   10a0 <usageerror@plt>
jmp    11cf <main+0x4f>
mov    0x2dd4(%rip),%rax
mov    (%rax),%r15
jmp    11cf <main+0x4f>
mov    0x2dc8(%rip),%rax
mov    (%rax),%r14
jmp    11cf <main+0x4f>
cmp    $0x1,%ebp
jg     1251 <main+0xd1>
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
lea    0xe59(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1266 <main+0xe6>
test   %r14,%r14
je     1266 <main+0xe6>
test   %r15,%r15
je     1266 <main+0xe6>
mov    %r14,%rdi
mov    %r15,%rsi
call   1080 <makepmklist@plt>
mov    0x2d5b(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"p:P:hv\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [20 x i8] c"no option selected\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %7
store i8* null, i8** %8
%9 = load i32, i32* @stdout
%10 = call i32 @setbuf(i32 %9, i32* null)
br label %11
11: ; preds = %40, %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @getopt(i32 %12, i8** %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %14, i32* %6
%15 = icmp ne i32 %14, -1
br i1 %15, label %16, label %41
16: ; preds = %11
%17 = load i32, i32* %6
switch i32 %17, label %40 [
i32 112, label %18
i32 80, label %20
i32 104, label %22
i32 118, label %28
i32 63, label %34
]
18: ; preds = %16
%19 = load i8*, i8** @optarg
store i8* %19, i8** %7
br label %40
20: ; preds = %16
%21 = load i8*, i8** @optarg
store i8* %21, i8** %8
br label %40
22: ; preds = %16
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 0
%25 = load i8*, i8** %24
%26 = call i32 @basename(i8* %25)
%27 = call i32 @usage(i32 %26)
br label %40
28: ; preds = %16
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 0
%31 = load i8*, i8** %30
%32 = call i32 @basename(i8* %31)
%33 = call i32 @version(i32 %32)
br label %40
34: ; preds = %16
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 0
%37 = load i8*, i8** %36
%38 = call i32 @basename(i8* %37)
%39 = call i32 @usageerror(i32 %38)
br label %40
40: ; preds = %16, %34, %28, %22, %20, %18
br label %11
41: ; preds = %11
%42 = load i32, i32* %4
%43 = icmp slt i32 %42, 2
br i1 %43, label %44, label %48
44: ; preds = %41
%45 = load i32, i32* @stderr
%46 = call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%47 = load i32, i32* @EXIT_SUCCESS
store i32 %47, i32* %3
br label %60
48: ; preds = %41
%49 = load i8*, i8** %7
%50 = icmp ne i8* %49, null
br i1 %50, label %51, label %58
51: ; preds = %48
%52 = load i8*, i8** %8
%53 = icmp ne i8* %52, null
br i1 %53, label %54, label %58
54: ; preds = %51
%55 = load i8*, i8** %7
%56 = load i8*, i8** %8
%57 = call i32 @makepmklist(i8* %55, i8* %56)
br label %58
58: ; preds = %54, %51, %48
%59 = load i32, i32* @EXIT_SUCCESS
store i32 %59, i32* %3
br label %60
60: ; preds = %58, %44
%61 = load i32, i32* %3
ret i32 %61
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"p:P:hv\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [20 x i8] c"no option selected\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @setbuf(i32 %3, i32* null)
br label %5
5: ; preds = %13, %2
%6 = phi i8* [ %14, %13 ], [ null, %2 ]
%7 = phi i8* [ %9, %13 ], [ null, %2 ]
br label %8
8: ; preds = %5, %15
%9 = phi i8* [ %7, %5 ], [ %16, %15 ]
br label %10
10: ; preds = %12, %8
%11 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
switch i32 %11, label %12 [
i32 -1, label %29
i32 112, label %13
i32 80, label %15
i32 104, label %17
i32 118, label %21
i32 63, label %25
]
12: ; preds = %10, %25, %21, %17
br label %10
13: ; preds = %10
%14 = load i8*, i8** @optarg
br label %5
15: ; preds = %10
%16 = load i8*, i8** @optarg
br label %8
17: ; preds = %10
%18 = load i8*, i8** %1
%19 = tail call i32 @basename(i8* %18)
%20 = tail call i32 @usage(i32 %19)
br label %12
21: ; preds = %10
%22 = load i8*, i8** %1
%23 = tail call i32 @basename(i8* %22)
%24 = tail call i32 @version(i32 %23)
br label %12
25: ; preds = %10
%26 = load i8*, i8** %1
%27 = tail call i32 @basename(i8* %26)
%28 = tail call i32 @usageerror(i32 %27)
br label %12
29: ; preds = %10
%30 = icmp slt i32 %0, 2
br i1 %30, label %31, label %34
31: ; preds = %29
%32 = load i32, i32* @stderr
%33 = tail call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %40
34: ; preds = %29
%35 = icmp ne i8* %6, null
%36 = icmp ne i8* %9, null
%37 = select i1 %35, i1 %36, i1 false
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = tail call i32 @makepmklist(i8* %6, i8* %9)
br label %40
40: ; preds = %34, %38, %31
%41 = load i32, i32* @EXIT_SUCCESS
ret i32 %41
}