#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 */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
char *basename(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ filecombiout(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ filepmkout(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              char *, int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getopt(int, char **, char *);
char *optarg;
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ singlepmkout(char *, int, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strdupa(char *);
int strlen(char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  FILE *fhpwlist = NULL;
  FILE *fhascii = NULL;
  FILE *fhasciipw = NULL;
  FILE *fhcow = NULL;
  FILE *fhcombi = NULL;
  int auswahl;
  int pwlen = 0;
  uint8_t essidlen = 0;
  char *eigenname = NULL;
  char *eigenpfadname = NULL;
  char *pwname = NULL;
  char *essidname = NULL;
  eigenpfadname = strdupa(argv[0]);
  eigenname = basename(eigenpfadname);
  setbuf(stdout, NULL);
  while ((auswahl = getopt(argc, argv, "p:e:i:I:a:A:c:h")) != -1) {
    switch (auswahl) {
    case 'e':
      essidname = optarg;
      essidlen = strlen(essidname);
      if ((essidlen < 1) || (essidlen > 32)) {
        fprintf(stderr, "error wrong essid len\n");
        exit(EXIT_FAILURE);
      }
      break;
    case 'p':
      pwname = optarg;
      pwlen = strlen(pwname);
      if ((pwlen < 1) || (pwlen > 63)) {
        fprintf(stderr, "error wrong password len\n");
        exit(EXIT_FAILURE);
      }
      break;
    case 'i':
      if ((fhpwlist = fopen(optarg, "r")) == NULL) {
        fprintf(stderr, "error opening %s\n", optarg);
        exit(EXIT_FAILURE);
      }
      break;
    case 'I':
      if ((fhcombi = fopen(optarg, "r")) == NULL) {
        fprintf(stderr, "error opening %s\n", optarg);
        exit(EXIT_FAILURE);
      }
      break;
    case 'a':
      if ((fhascii = fopen(optarg, "a")) == NULL) {
        fprintf(stderr, "error opening %s\n", optarg);
        exit(EXIT_FAILURE);
      }
      break;
    case 'A':
      if ((fhasciipw = fopen(optarg, "a")) == NULL) {
        fprintf(stderr, "error opening %s\n", optarg);
        exit(EXIT_FAILURE);
      }
      break;
    case 'c':
      if ((fhcow = fopen(optarg, "w")) == NULL) {
        fprintf(stderr, "error opening %s\n", optarg);
        exit(EXIT_FAILURE);
      }
      break;
    case 'h':
      usage(eigenname);
      break;
    default:
      usage(eigenname);
      break;
    }
  }
  if ((essidname != NULL) && (pwname != NULL))
    singlepmkout(pwname, pwlen, essidname, essidlen);
  else if ((essidname != NULL) && (fhpwlist != NULL))
    filepmkout(fhpwlist, fhascii, fhasciipw, fhcow, essidname, essidlen);
  else if (fhcombi != NULL)
    filecombiout(fhcombi, fhascii, fhasciipw, fhcow);
  if (fhcombi != NULL)
    fclose(fhcombi);
  if (fhpwlist != NULL)
    fclose(fhpwlist);
  if (fhascii != NULL)
    fclose(fhascii);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1080 <strdupa@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
call   1070 <basename@plt>
mov    %rax,-0x50(%rbp)
mov    0x2d68(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <setbuf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe47(%rip),%rdx
call   10c0 <getopt@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0xffffffff,%eax
je     1537 <main+0x367>
mov    -0x3c(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x70(%rbp)
sub    $0x2f,%eax
ja     1529 <main+0x359>
mov    -0x70(%rbp),%rax
lea    0xd56(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2d3e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x1,-0x44(%rbp)
jl     12e1 <main+0x111>
cmpl   $0x20,-0x44(%rbp)
jle    1306 <main+0x136>
mov    0x2cf0(%rip),%rax
mov    (%rax),%edi
lea    0xddf(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2cd1(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    1532 <main+0x362>
mov    0x2ce6(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x1,-0x40(%rbp)
jl     1339 <main+0x169>
cmpl   $0x3f,-0x40(%rbp)
jle    135e <main+0x18e>
mov    0x2c98(%rip),%rax
mov    (%rax),%edi
lea    0xd9e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c79(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    1532 <main+0x362>
mov    0x2c8e(%rip),%rax
mov    (%rax),%rdi
lea    0xd8d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    13b6 <main+0x1e6>
mov    0x2c4a(%rip),%rax
mov    (%rax),%edi
mov    0x2c61(%rip),%rax
mov    (%rax),%rdx
lea    0xd62(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c21(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    1532 <main+0x362>
mov    0x2c36(%rip),%rax
mov    (%rax),%rdi
lea    0xd35(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    140e <main+0x23e>
mov    0x2bf2(%rip),%rax
mov    (%rax),%edi
mov    0x2c09(%rip),%rax
mov    (%rax),%rdx
lea    0xd0a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2bc9(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    1532 <main+0x362>
mov    0x2bde(%rip),%rax
mov    (%rax),%rdi
lea    0xcf1(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1466 <main+0x296>
mov    0x2b9a(%rip),%rax
mov    (%rax),%edi
mov    0x2bb1(%rip),%rax
mov    (%rax),%rdx
lea    0xcb2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2b71(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    1532 <main+0x362>
mov    0x2b86(%rip),%rax
mov    (%rax),%rdi
lea    0xc99(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    14be <main+0x2ee>
mov    0x2b42(%rip),%rax
mov    (%rax),%edi
mov    0x2b59(%rip),%rax
mov    (%rax),%rdx
lea    0xc5a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2b19(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    1532 <main+0x362>
mov    0x2b2e(%rip),%rax
mov    (%rax),%rdi
lea    0xc43(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    1516 <main+0x346>
mov    0x2aea(%rip),%rax
mov    (%rax),%edi
mov    0x2b01(%rip),%rax
mov    (%rax),%rdx
lea    0xc02(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2ac1(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    1532 <main+0x362>
mov    -0x50(%rbp),%rdi
call   1090 <usage@plt>
jmp    1532 <main+0x362>
mov    -0x50(%rbp),%rdi
call   1090 <usage@plt>
jmp    126b <main+0x9b>
cmpq   $0x0,-0x68(%rbp)
je     1565 <main+0x395>
cmpq   $0x0,-0x60(%rbp)
je     1565 <main+0x395>
mov    -0x60(%rbp),%rdi
mov    -0x40(%rbp),%esi
mov    -0x68(%rbp),%rdx
mov    -0x44(%rbp),%ecx
call   10b0 <singlepmkout@plt>
jmp    15c7 <main+0x3f7>
cmpq   $0x0,-0x68(%rbp)
je     159d <main+0x3cd>
cmpq   $0x0,-0x18(%rbp)
je     159d <main+0x3cd>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x68(%rbp),%r8
mov    -0x44(%rbp),%r9d
call   10f0 <filepmkout@plt>
jmp    15c2 <main+0x3f2>
cmpq   $0x0,-0x38(%rbp)
je     15bd <main+0x3ed>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   10e0 <filecombiout@plt>
jmp    15c2 <main+0x3f2>
jmp    15c7 <main+0x3f7>
cmpq   $0x0,-0x38(%rbp)
je     15db <main+0x40b>
mov    -0x38(%rbp),%rdi
call   1030 <fclose@plt>
cmpq   $0x0,-0x18(%rbp)
je     15ef <main+0x41f>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
cmpq   $0x0,-0x20(%rbp)
je     1603 <main+0x433>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x29b6(%rip),%rax
mov    (%rax),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
call   1080 <strdupa@plt>
mov    %rax,%rdi
call   1070 <basename@plt>
mov    %rax,0x40(%rsp)
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %rax,0x20(%rsp)
xor    %esi,%esi
call   1050 <setbuf@plt>
lea    0xeaa(%rip),%r13
lea    0xde3(%rip),%r12
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x30(%rsp)
xor    %r15d,%r15d
movl   $0x0,0xc(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
xor    %r14d,%r14d
xor    %eax,%eax
mov    %rax,0x38(%rsp)
jmp    1279 <main+0xa9>
mov    0x2da1(%rip),%rax
mov    (%rax),%rdi
lea    0xea0(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rcx
mov    %rax,0x28(%rsp)
xchg   %ax,%ax
test   %rax,%rax
je     1444 <main+0x274>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r13,%rdx
call   10c0 <getopt@plt>
lea    -0x41(%rax),%ecx
cmp    $0x2f,%ecx
ja     1370 <main+0x1a0>
movslq (%r12,%rcx,4),%rax
add    %r12,%rax
jmp    *%rax
mov    0x2d56(%rip),%rax
mov    (%rax),%rdi
lea    0xe69(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rcx
mov    %rax,0x20(%rsp)
jmp    1270 <main+0xa0>
mov    0x2d36(%rip),%rax
mov    (%rax),%rdi
lea    0xe35(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rcx
mov    %rax,0x10(%rsp)
jmp    1270 <main+0xa0>
mov    0x2d16(%rip),%rax
mov    (%rax),%rdi
lea    0xe29(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rcx
mov    %rax,0x30(%rsp)
jmp    1270 <main+0xa0>
mov    0x2cf3(%rip),%rax
mov    (%rax),%rdi
lea    0xe08(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rcx
mov    %rax,0x18(%rsp)
jmp    1270 <main+0xa0>
mov    0x2cd0(%rip),%rax
mov    (%rax),%rdi
mov    %rdi,0x38(%rsp)
call   1040 <strlen@plt>
mov    %eax,0xc(%rsp)
add    $0xffffffdf,%eax
cmp    $0xffffffdf,%eax
ja     1279 <main+0xa9>
jmp    1467 <main+0x297>
mov    0x2ca7(%rip),%rax
mov    (%rax),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%r15d
add    $0xffffffc0,%eax
cmp    $0xffffffc0,%eax
ja     1279 <main+0xa9>
jmp    1479 <main+0x2a9>
cmp    $0xffffffff,%eax
je     1384 <main+0x1b4>
mov    0x40(%rsp),%rdi
call   1090 <usage@plt>
jmp    1279 <main+0xa9>
mov    0x38(%rsp),%r8
test   %r8,%r8
je     13b1 <main+0x1e1>
test   %r14,%r14
je     13b1 <main+0x1e1>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %r8,%rdx
mov    0xc(%rsp),%ecx
call   10b0 <singlepmkout@plt>
mov    0x30(%rsp),%r14
mov    0x28(%rsp),%rbp
jmp    13df <main+0x20f>
test   %r8,%r8
mov    0x30(%rsp),%r14
mov    0x28(%rsp),%rbp
je     13eb <main+0x21b>
test   %rbp,%rbp
je     13eb <main+0x21b>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    0x20(%rsp),%rdx
mov    0x18(%rsp),%rcx
mov    0xc(%rsp),%r9d
call   10f0 <filepmkout@plt>
mov    0x10(%rsp),%rbx
test   %rbx,%rbx
jne    140a <main+0x23a>
jmp    1412 <main+0x242>
mov    0x10(%rsp),%rbx
test   %rbx,%rbx
je     1412 <main+0x242>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    0x20(%rsp),%rdx
mov    0x18(%rsp),%rcx
call   10e0 <filecombiout@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
test   %rbp,%rbp
je     141f <main+0x24f>
mov    %rbp,%rdi
call   1030 <fclose@plt>
test   %r14,%r14
je     142c <main+0x25c>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    0x2b8d(%rip),%rax
mov    (%rax),%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b8d(%rip),%rax
mov    (%rax),%edi
mov    0x2ba4(%rip),%rax
mov    (%rax),%rdx
lea    0xca5(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1490 <main+0x2c0>
mov    0x2b6a(%rip),%rax
mov    (%rax),%edi
lea    0xc59(%rip),%rsi
jmp    1489 <main+0x2b9>
mov    0x2b58(%rip),%rax
mov    (%rax),%edi
lea    0xc5e(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2b39(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [16 x i8] c"p:e:i:I:a:A:c:h\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [23 x i8] c"error wrong essid len\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [26 x i8] c"error wrong password len\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [18 x i8] c"error opening %s\0A\00"
@.str.5 = [2 x i8] c"a\00"
@.str.6 = [2 x i8] c"w\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 i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32* null, i32** %7
store i32* null, i32** %8
store i32* null, i32** %9
store i32* null, i32** %10
store i32 0, i32* %12
store i32 0, i32* %13
store i8* null, i8** %14
store i8* null, i8** %15
store i8* null, i8** %16
store i8* null, i8** %17
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i8* @strdupa(i8* %20)
store i8* %21, i8** %15
%22 = load i8*, i8** %15
%23 = call i8* @basename(i8* %22)
store i8* %23, i8** %14
%24 = load i32, i32* @stdout
%25 = call i32 @setbuf(i32 %24, i32* null)
br label %26
26: ; preds = %124, %2
%27 = load i32, i32* %4
%28 = load i8**, i8*** %5
%29 = call i32 @getopt(i32 %27, i8** %28, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 %29, i32* %11
%30 = icmp ne i32 %29, -1
br i1 %30, label %31, label %125
31: ; preds = %26
%32 = load i32, i32* %11
switch i32 %32, label %121 [
i32 101, label %33
i32 112, label %48
i32 105, label %63
i32 73, label %74
i32 97, label %85
i32 65, label %96
i32 99, label %107
i32 104, label %118
]
33: ; preds = %31
%34 = load i8*, i8** @optarg
store i8* %34, i8** %17
%35 = load i8*, i8** %17
%36 = call i32 @strlen(i8* %35)
store i32 %36, i32* %13
%37 = load i32, i32* %13
%38 = icmp slt i32 %37, 1
br i1 %38, label %42, label %39
39: ; preds = %33
%40 = load i32, i32* %13
%41 = icmp sgt i32 %40, 32
br i1 %41, label %42, label %47
42: ; preds = %39, %33
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%45 = load i32, i32* @EXIT_FAILURE
%46 = call i32 @exit(i32 %45)
unreachable
47: ; preds = %39
br label %124
48: ; preds = %31
%49 = load i8*, i8** @optarg
store i8* %49, i8** %16
%50 = load i8*, i8** %16
%51 = call i32 @strlen(i8* %50)
store i32 %51, i32* %12
%52 = load i32, i32* %12
%53 = icmp slt i32 %52, 1
br i1 %53, label %57, label %54
54: ; preds = %48
%55 = load i32, i32* %12
%56 = icmp sgt i32 %55, 63
br i1 %56, label %57, label %62
57: ; preds = %54, %48
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%60 = load i32, i32* @EXIT_FAILURE
%61 = call i32 @exit(i32 %60)
unreachable
62: ; preds = %54
br label %124
63: ; preds = %31
%64 = load i8*, i8** @optarg
%65 = call i32* @fopen(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %65, i32** %6
%66 = icmp eq i32* %65, null
br i1 %66, label %67, label %73
67: ; preds = %63
%68 = load i32, i32* @stderr
%69 = load i8*, i8** @optarg
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %69)
%71 = load i32, i32* @EXIT_FAILURE
%72 = call i32 @exit(i32 %71)
unreachable
73: ; preds = %63
br label %124
74: ; preds = %31
%75 = load i8*, i8** @optarg
%76 = call i32* @fopen(i8* %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %76, i32** %10
%77 = icmp eq i32* %76, null
br i1 %77, label %78, label %84
78: ; preds = %74
%79 = load i32, i32* @stderr
%80 = load i8*, i8** @optarg
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %80)
%82 = load i32, i32* @EXIT_FAILURE
%83 = call i32 @exit(i32 %82)
unreachable
84: ; preds = %74
br label %124
85: ; preds = %31
%86 = load i8*, i8** @optarg
%87 = call i32* @fopen(i8* %86, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %87, i32** %7
%88 = icmp eq i32* %87, null
br i1 %88, label %89, label %95
89: ; preds = %85
%90 = load i32, i32* @stderr
%91 = load i8*, i8** @optarg
%92 = call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %91)
%93 = load i32, i32* @EXIT_FAILURE
%94 = call i32 @exit(i32 %93)
unreachable
95: ; preds = %85
br label %124
96: ; preds = %31
%97 = load i8*, i8** @optarg
%98 = call i32* @fopen(i8* %97, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %98, i32** %8
%99 = icmp eq i32* %98, null
br i1 %99, label %100, label %106
100: ; preds = %96
%101 = load i32, i32* @stderr
%102 = load i8*, i8** @optarg
%103 = call i32 (i32, i8*, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %102)
%104 = load i32, i32* @EXIT_FAILURE
%105 = call i32 @exit(i32 %104)
unreachable
106: ; preds = %96
br label %124
107: ; preds = %31
%108 = load i8*, i8** @optarg
%109 = call i32* @fopen(i8* %108, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %109, i32** %9
%110 = icmp eq i32* %109, null
br i1 %110, label %111, label %117
111: ; preds = %107
%112 = load i32, i32* @stderr
%113 = load i8*, i8** @optarg
%114 = call i32 (i32, i8*, ...) @fprintf(i32 %112, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %113)
%115 = load i32, i32* @EXIT_FAILURE
%116 = call i32 @exit(i32 %115)
unreachable
117: ; preds = %107
br label %124
118: ; preds = %31
%119 = load i8*, i8** %14
%120 = call i32 @usage(i8* %119)
br label %124
121: ; preds = %31
%122 = load i8*, i8** %14
%123 = call i32 @usage(i8* %122)
br label %124
124: ; preds = %121, %118, %117, %106, %95, %84, %73, %62, %47
br label %26
125: ; preds = %26
%126 = load i8*, i8** %17
%127 = icmp ne i8* %126, null
br i1 %127, label %128, label %137
128: ; preds = %125
%129 = load i8*, i8** %16
%130 = icmp ne i8* %129, null
br i1 %130, label %131, label %137
131: ; preds = %128
%132 = load i8*, i8** %16
%133 = load i32, i32* %12
%134 = load i8*, i8** %17
%135 = load i32, i32* %13
%136 = call i32 @singlepmkout(i8* %132, i32 %133, i8* %134, i32 %135)
br label %162
137: ; preds = %128, %125
%138 = load i8*, i8** %17
%139 = icmp ne i8* %138, null
br i1 %139, label %140, label %151
140: ; preds = %137
%141 = load i32*, i32** %6
%142 = icmp ne i32* %141, null
br i1 %142, label %143, label %151
143: ; preds = %140
%144 = load i32*, i32** %6
%145 = load i32*, i32** %7
%146 = load i32*, i32** %8
%147 = load i32*, i32** %9
%148 = load i8*, i8** %17
%149 = load i32, i32* %13
%150 = call i32 @filepmkout(i32* %144, i32* %145, i32* %146, i32* %147, i8* %148, i32 %149)
br label %161
151: ; preds = %140, %137
%152 = load i32*, i32** %10
%153 = icmp ne i32* %152, null
br i1 %153, label %154, label %160
154: ; preds = %151
%155 = load i32*, i32** %10
%156 = load i32*, i32** %7
%157 = load i32*, i32** %8
%158 = load i32*, i32** %9
%159 = call i32 @filecombiout(i32* %155, i32* %156, i32* %157, i32* %158)
br label %160
160: ; preds = %154, %151
br label %161
161: ; preds = %160, %143
br label %162
162: ; preds = %161, %131
%163 = load i32*, i32** %10
%164 = icmp ne i32* %163, null
br i1 %164, label %165, label %168
165: ; preds = %162
%166 = load i32*, i32** %10
%167 = call i32 @fclose(i32* %166)
br label %168
168: ; preds = %165, %162
%169 = load i32*, i32** %6
%170 = icmp ne i32* %169, null
br i1 %170, label %171, label %174
171: ; preds = %168
%172 = load i32*, i32** %6
%173 = call i32 @fclose(i32* %172)
br label %174
174: ; preds = %171, %168
%175 = load i32*, i32** %7
%176 = icmp ne i32* %175, null
br i1 %176, label %177, label %180
177: ; preds = %174
%178 = load i32*, i32** %7
%179 = call i32 @fclose(i32* %178)
br label %180
180: ; preds = %177, %174
%181 = load i32, i32* @EXIT_SUCCESS
ret i32 %181
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [16 x i8] c"p:e:i:I:a:A:c:h\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [23 x i8] c"error wrong essid len\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [26 x i8] c"error wrong password len\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [18 x i8] c"error opening %s\0A\00"
@.str.5 = [2 x i8] c"a\00"
@.str.6 = [2 x i8] c"w\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i8* @strdupa(i8* %3)
%5 = tail call i8* @basename(i8* %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @setbuf(i32 %6, i32* null)
br label %8
8: ; preds = %91, %2
%9 = phi i32* [ null, %2 ], [ %92, %91 ]
%10 = phi i32* [ null, %2 ], [ %93, %91 ]
%11 = phi i32* [ null, %2 ], [ %94, %91 ]
%12 = phi i32* [ null, %2 ], [ %95, %91 ]
%13 = phi i32 [ 0, %2 ], [ %96, %91 ]
%14 = phi i32 [ 0, %2 ], [ %97, %91 ]
%15 = phi i32* [ null, %2 ], [ %98, %91 ]
%16 = phi i8* [ null, %2 ], [ %99, %91 ]
%17 = phi i8* [ null, %2 ], [ %100, %91 ]
%18 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
switch i32 %18, label %89 [
i32 -1, label %101
i32 101, label %19
i32 112, label %29
i32 105, label %39
i32 73, label %49
i32 97, label %59
i32 65, label %69
i32 99, label %79
]
19: ; preds = %8
%20 = load i8*, i8** @optarg
%21 = tail call i32 @strlen(i8* %20)
%22 = add i32 %21, -33
%23 = icmp ult i32 %22, -32
br i1 %23, label %24, label %91
24: ; preds = %19
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%27 = load i32, i32* @EXIT_FAILURE
%28 = tail call i32 @exit(i32 %27)
unreachable
29: ; preds = %8
%30 = load i8*, i8** @optarg
%31 = tail call i32 @strlen(i8* %30)
%32 = add i32 %31, -64
%33 = icmp ult i32 %32, -63
br i1 %33, label %34, label %91
34: ; preds = %29
%35 = load i32, i32* @stderr
%36 = tail call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%37 = load i32, i32* @EXIT_FAILURE
%38 = tail call i32 @exit(i32 %37)
unreachable
39: ; preds = %8
%40 = load i8*, i8** @optarg
%41 = tail call i32* @fopen(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%42 = icmp eq i32* %41, null
br i1 %42, label %43, label %91
43: ; preds = %39
%44 = load i32, i32* @stderr
%45 = load i8*, i8** @optarg
%46 = tail call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %45)
%47 = load i32, i32* @EXIT_FAILURE
%48 = tail call i32 @exit(i32 %47)
unreachable
49: ; preds = %8
%50 = load i8*, i8** @optarg
%51 = tail call i32* @fopen(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%52 = icmp eq i32* %51, null
br i1 %52, label %53, label %91
53: ; preds = %49
%54 = load i32, i32* @stderr
%55 = load i8*, i8** @optarg
%56 = tail call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %55)
%57 = load i32, i32* @EXIT_FAILURE
%58 = tail call i32 @exit(i32 %57)
unreachable
59: ; preds = %8
%60 = load i8*, i8** @optarg
%61 = tail call i32* @fopen(i8* %60, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%62 = icmp eq i32* %61, null
br i1 %62, label %63, label %91
63: ; preds = %59
%64 = load i32, i32* @stderr
%65 = load i8*, i8** @optarg
%66 = tail call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %65)
%67 = load i32, i32* @EXIT_FAILURE
%68 = tail call i32 @exit(i32 %67)
unreachable
69: ; preds = %8
%70 = load i8*, i8** @optarg
%71 = tail call i32* @fopen(i8* %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%72 = icmp eq i32* %71, null
br i1 %72, label %73, label %91
73: ; preds = %69
%74 = load i32, i32* @stderr
%75 = load i8*, i8** @optarg
%76 = tail call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %75)
%77 = load i32, i32* @EXIT_FAILURE
%78 = tail call i32 @exit(i32 %77)
unreachable
79: ; preds = %8
%80 = load i8*, i8** @optarg
%81 = tail call i32* @fopen(i8* %80, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%82 = icmp eq i32* %81, null
br i1 %82, label %83, label %91
83: ; preds = %79
%84 = load i32, i32* @stderr
%85 = load i8*, i8** @optarg
%86 = tail call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %85)
%87 = load i32, i32* @EXIT_FAILURE
%88 = tail call i32 @exit(i32 %87)
unreachable
89: ; preds = %8
%90 = tail call i32 @usage(i8* %5)
br label %91
91: ; preds = %89, %79, %69, %59, %49, %39, %29, %19
%92 = phi i32* [ %9, %79 ], [ %71, %69 ], [ %9, %59 ], [ %9, %49 ], [ %9, %39 ], [ %9, %29 ], [ %9, %19 ], [ %9, %89 ]
%93 = phi i32* [ %81, %79 ], [ %10, %69 ], [ %10, %59 ], [ %10, %49 ], [ %10, %39 ], [ %10, %29 ], [ %10, %19 ], [ %10, %89 ]
%94 = phi i32* [ %11, %79 ], [ %11, %69 ], [ %11, %59 ], [ %51, %49 ], [ %11, %39 ], [ %11, %29 ], [ %11, %19 ], [ %11, %89 ]
%95 = phi i32* [ %12, %79 ], [ %12, %69 ], [ %61, %59 ], [ %12, %49 ], [ %12, %39 ], [ %12, %29 ], [ %12, %19 ], [ %12, %89 ]
%96 = phi i32 [ %13, %79 ], [ %13, %69 ], [ %13, %59 ], [ %13, %49 ], [ %13, %39 ], [ %31, %29 ], [ %13, %19 ], [ %13, %89 ]
%97 = phi i32 [ %14, %79 ], [ %14, %69 ], [ %14, %59 ], [ %14, %49 ], [ %14, %39 ], [ %14, %29 ], [ %21, %19 ], [ %14, %89 ]
%98 = phi i32* [ %15, %79 ], [ %15, %69 ], [ %15, %59 ], [ %15, %49 ], [ %41, %39 ], [ %15, %29 ], [ %15, %19 ], [ %15, %89 ]
%99 = phi i8* [ %16, %79 ], [ %16, %69 ], [ %16, %59 ], [ %16, %49 ], [ %16, %39 ], [ %30, %29 ], [ %16, %19 ], [ %16, %89 ]
%100 = phi i8* [ %17, %79 ], [ %17, %69 ], [ %17, %59 ], [ %17, %49 ], [ %17, %39 ], [ %17, %29 ], [ %20, %19 ], [ %17, %89 ]
br label %8
101: ; preds = %8
%102 = icmp ne i8* %17, null
%103 = icmp ne i8* %16, null
%104 = select i1 %102, i1 %103, i1 false
br i1 %104, label %105, label %107
105: ; preds = %101
%106 = tail call i32 @singlepmkout(i8* %16, i32 %13, i8* %17, i32 %14)
br label %116
107: ; preds = %101
%108 = icmp ne i32* %15, null
%109 = select i1 %102, i1 %108, i1 false
br i1 %109, label %110, label %112
110: ; preds = %107
%111 = tail call i32 @filepmkout(i32* %15, i32* %12, i32* %9, i32* %10, i8* %17, i32 %14)
br label %116
112: ; preds = %107
%113 = icmp eq i32* %11, null
br i1 %113, label %120, label %114
114: ; preds = %112
%115 = tail call i32 @filecombiout(i32* %11, i32* %12, i32* %9, i32* %10)
br label %118
116: ; preds = %110, %105
%117 = icmp eq i32* %11, null
br i1 %117, label %120, label %118
118: ; preds = %114, %116
%119 = tail call i32 @fclose(i32* %11)
br label %120
120: ; preds = %112, %118, %116
%121 = icmp eq i32* %15, null
br i1 %121, label %124, label %122
122: ; preds = %120
%123 = tail call i32 @fclose(i32* %15)
br label %124
124: ; preds = %122, %120
%125 = icmp eq i32* %12, null
br i1 %125, label %128, label %126
126: ; preds = %124
%127 = tail call i32 @fclose(i32* %12)
br label %128
128: ; preds = %126, %124
%129 = load i32, i32* @EXIT_SUCCESS
ret i32 %129
}