#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 */
struct option {
  char *member_0;
  int member_1;
  char member_3;
  int /*<<< orphan*/ member_2;
};

/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int);
int getopt_long(int, char **, char *, struct option *, int *);
char *malloc(int);
char *optarg;
int optind;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ prowl_send(char *, char *, char *, char *, char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  static struct option long_options[] = {
      {"help", 0, 0, 'h'}, {"apikey", 1, 0, 'k'}, {"priority", 1, 0, 'p'},
      {"pkey", 1, 0, 'P'}, {"app", 1, 0, 'a'},    {"event", 1, 0, 'e'},
      {0, 0, 0, 0}};
  int i;
  int idx = 0;
  char *key = malloc(41);
  char *pkey = malloc(41);
  char *app = malloc(257);
  char *event = malloc(1025);
  char *priority = malloc(3);
  char *message = malloc(10001);
  while ((i = getopt_long(argc, argv, "hk:P:a:e:p:", long_options, &idx)) !=
         EOF) {
    switch (i) {
    case 'k':
      strcpy(key, optarg);
      break;
    case 'P':
      strcpy(pkey, optarg);
      break;
    case 'p':
      if (strcmp(optarg, "-2") == 0 || strcmp(optarg, "vlow") == 0 ||
          strcmp(optarg, "debug") == 0)
        strcpy(priority, "-2");
      if (strcmp(optarg, "-1") == 0 || strcmp(optarg, "moderate") == 0 ||
          strcmp(optarg, "info") == 0)
        strcpy(priority, "-1");
      if (strcmp(optarg, "0") == 0 || strcmp(optarg, "normal") == 0 ||
          strcmp(optarg, "warn") == 0)
        strcpy(priority, "0");
      if (strcmp(optarg, "1") == 0 || strcmp(optarg, "high") == 0 ||
          strcmp(optarg, "error") == 0)
        strcpy(priority, "1");
      if (strcmp(optarg, "2") == 0 || strcmp(optarg, "emergency") == 0 ||
          strcmp(optarg, "fatal") == 0)
        strcpy(priority, "2");
      break;
    case 'a':
      strcpy(app, optarg);
      break;
    case 'e':
      strcpy(event, optarg);
      break;
    case '?':
    default:
      break;
    }
  }
  if (optind < argc) {
    while (optind < argc) {
      strcat(message, argv[optind++]);
      strcat(message, " ");
    }
  }
  if (strcmp(key, "") == 0) {
    printf("API Key is required.\n");
    exit(1);
  }
  if (strcmp(priority, "") == 0)
    strcpy(priority, "0");
  if (strcmp(app, "") == 0)
    strcpy(app, "libProwl");
  if (strcmp(message, "") == 0) {
    printf("ERROR: No message supplied.\n");
    exit(1);
  }
  prowl_send(key, pkey, priority, app, event, message);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x29,%edi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x29,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x101,%edi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    $0x401,%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    $0x3,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    $0x2711,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xeed(%rip),%rdx
lea    0x2e6a(%rip),%rcx
lea    -0x18(%rbp),%r8
call   1040 <getopt_long@plt>
mov    %eax,-0x14(%rbp)
mov    0x2dc7(%rip),%rcx
cmp    (%rcx),%eax
je     14ee <main+0x36e>
mov    -0x14(%rbp),%eax
add    $0xffffffc1,%eax
mov    %eax,%ecx
mov    %rcx,-0x50(%rbp)
sub    $0x31,%eax
ja     14e4 <main+0x364>
mov    -0x50(%rbp),%rax
lea    0xdbf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x20(%rbp),%rdi
mov    0x2da3(%rip),%rax
mov    (%rax),%rsi
call   1030 <strcpy@plt>
jmp    14e9 <main+0x369>
mov    -0x28(%rbp),%rdi
mov    0x2d8b(%rip),%rax
mov    (%rax),%rsi
call   1030 <strcpy@plt>
jmp    14e9 <main+0x369>
mov    0x2d77(%rip),%rax
mov    (%rax),%rdi
lea    0xe6d(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12da <main+0x15a>
mov    0x2d57(%rip),%rax
mov    (%rax),%rdi
lea    0xe50(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12da <main+0x15a>
mov    0x2d37(%rip),%rax
mov    (%rax),%rdi
lea    0xe35(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12ea <main+0x16a>
mov    -0x40(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x2d07(%rip),%rax
mov    (%rax),%rdi
lea    0xe0b(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     134a <main+0x1ca>
mov    0x2ce7(%rip),%rax
mov    (%rax),%rdi
lea    0xdee(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     134a <main+0x1ca>
mov    0x2cc7(%rip),%rax
mov    (%rax),%rdi
lea    0xdd7(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    135a <main+0x1da>
mov    -0x40(%rbp),%rdi
lea    0xdb1(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x2c97(%rip),%rax
mov    (%rax),%rdi
lea    0xdac(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     13ba <main+0x23a>
mov    0x2c77(%rip),%rax
mov    (%rax),%rdi
lea    0xd8e(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     13ba <main+0x23a>
mov    0x2c57(%rip),%rax
mov    (%rax),%rdi
lea    0xd75(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13ca <main+0x24a>
mov    -0x40(%rbp),%rdi
lea    0xd52(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x2c27(%rip),%rax
mov    (%rax),%rdi
lea    0xd2c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     142a <main+0x2aa>
mov    0x2c07(%rip),%rax
mov    (%rax),%rdi
lea    0xd2a(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     142a <main+0x2aa>
mov    0x2be7(%rip),%rax
mov    (%rax),%rdi
lea    0xd0f(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    143a <main+0x2ba>
mov    -0x40(%rbp),%rdi
lea    0xcd2(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x2bb7(%rip),%rax
mov    (%rax),%rdi
lea    0xcae(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     149a <main+0x31a>
mov    0x2b97(%rip),%rax
mov    (%rax),%rdi
lea    0xcc5(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     149a <main+0x31a>
mov    0x2b77(%rip),%rax
mov    (%rax),%rdi
lea    0xcaf(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    14aa <main+0x32a>
mov    -0x40(%rbp),%rdi
lea    0xc54(%rip),%rsi
call   1030 <strcpy@plt>
jmp    14e9 <main+0x369>
mov    -0x30(%rbp),%rdi
mov    0x2b3e(%rip),%rax
mov    (%rax),%rsi
call   1030 <strcpy@plt>
jmp    14e9 <main+0x369>
mov    -0x38(%rbp),%rdi
mov    0x2b26(%rip),%rax
mov    (%rax),%rsi
call   1030 <strcpy@plt>
jmp    14e9 <main+0x369>
jmp    14e4 <main+0x364>
jmp    14e9 <main+0x369>
jmp    11f1 <main+0x71>
mov    0x2ae3(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    155c <main+0x3dc>
jmp    1505 <main+0x385>
mov    0x2acc(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jge    1557 <main+0x3d7>
mov    -0x48(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x2ab2(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    0x2aa4(%rip),%rdx
mov    %esi,(%rdx)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
call   1090 <strcat@plt>
mov    -0x48(%rbp),%rdi
lea    0xbf3(%rip),%rsi
call   1090 <strcat@plt>
jmp    1505 <main+0x385>
jmp    155c <main+0x3dc>
mov    -0x20(%rbp),%rdi
lea    0xc16(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    158c <main+0x40c>
lea    0xbc5(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x40(%rbp),%rdi
lea    0xbe6(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    15b6 <main+0x436>
mov    -0x40(%rbp),%rdi
lea    0xb66(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x30(%rbp),%rdi
lea    0xbbc(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    15e0 <main+0x460>
mov    -0x30(%rbp),%rdi
lea    0xb7d(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x48(%rbp),%rdi
lea    0xb92(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1610 <main+0x490>
lea    0xb60(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    -0x48(%rbp),%r9
call   1060 <prowl_send@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %edi,%r15d
movl   $0x0,0x14(%rsp)
mov    $0x29,%edi
call   1080 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    $0x29,%edi
call   1080 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    $0x101,%edi
call   1080 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    $0x401,%edi
call   1080 <malloc@plt>
mov    %rax,0x28(%rsp)
mov    $0x3,%edi
call   1080 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    $0x2711,%edi
call   1080 <malloc@plt>
mov    %rax,%r12
lea    0xead(%rip),%rdx
lea    0x2e6e(%rip),%rcx
lea    0x14(%rsp),%r8
mov    %r15d,%edi
mov    %r14,%rsi
call   1050 <getopt_long@plt>
mov    0x2dc7(%rip),%rcx
cmp    (%rcx),%eax
jne    128d <main+0x10d>
mov    0x2db4(%rip),%rbp
mov    0x0(%rbp),%eax
cmp    %r15d,%eax
jge    1267 <main+0xe7>
lea    0xec9(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rax),%ecx
mov    %ecx,0x0(%rbp)
cltq
mov    (%r14,%rax,8),%rsi
mov    %r12,%rdi
call   1090 <strcat@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1090 <strcat@plt>
mov    0x0(%rbp),%eax
cmp    %r15d,%eax
jl     1240 <main+0xc0>
lea    0xe8f(%rip),%rsi
mov    0x20(%rsp),%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    14a2 <main+0x322>
lea    0xe9b(%rip),%rdi
jmp    150b <main+0x38b>
lea    0x14(%rsp),%rbx
lea    0xd67(%rip),%rbp
mov    0x2d58(%rip),%r13
jmp    12db <main+0x15b>
mov    0x0(%r13),%rsi
mov    0x28(%rsp),%rdi
call   1030 <strcpy@plt>
mov    %r15d,%edi
mov    %r14,%rsi
lea    0xdeb(%rip),%rdx
lea    0x2dac(%rip),%rcx
mov    %rbx,%r8
call   1050 <getopt_long@plt>
mov    0x2d0d(%rip),%rcx
cmp    (%rcx),%eax
je     121d <main+0x9d>
add    $0xffffffb0,%eax
cmp    $0x20,%eax
ja     12b0 <main+0x130>
movslq 0x0(%rbp,%rax,4),%rax
add    %rbp,%rax
jmp    *%rax
mov    0x0(%r13),%rsi
mov    0x30(%rsp),%rdi
jmp    12ab <main+0x12b>
mov    0x0(%r13),%rsi
mov    0x18(%rsp),%rdi
jmp    12ab <main+0x12b>
mov    0x0(%r13),%rsi
mov    0x20(%rsp),%rdi
jmp    12ab <main+0x12b>
mov    0x0(%r13),%rdi
lea    0xd9b(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     134d <main+0x1cd>
mov    0x0(%r13),%rdi
lea    0xd89(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     134d <main+0x1cd>
mov    0x0(%r13),%rdi
lea    0xd79(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    135e <main+0x1de>
mov    0x8(%rsp),%rdi
lea    0xd5b(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x0(%r13),%rdi
lea    0xd59(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     139d <main+0x21d>
mov    0x0(%r13),%rdi
lea    0xd47(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     139d <main+0x21d>
mov    0x0(%r13),%rdi
lea    0xd3b(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    13ae <main+0x22e>
mov    0x8(%rsp),%rdi
lea    0xd19(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x0(%r13),%rdi
lea    0xd1a(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     13ed <main+0x26d>
mov    0x0(%r13),%rdi
lea    0xd07(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     13ed <main+0x26d>
mov    0x0(%r13),%rdi
lea    0xcf9(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    13fe <main+0x27e>
mov    0x8(%rsp),%rdi
lea    0xcda(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x0(%r13),%rdi
lea    0xcba(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     143d <main+0x2bd>
mov    0x0(%r13),%rdi
lea    0xcc3(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     143d <main+0x2bd>
mov    0x0(%r13),%rdi
lea    0xcb3(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    144e <main+0x2ce>
mov    0x8(%rsp),%rdi
lea    0xc7a(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x0(%r13),%rdi
lea    0xc5c(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1491 <main+0x311>
mov    0x0(%r13),%rdi
lea    0xc7e(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1491 <main+0x311>
mov    0x0(%r13),%rdi
lea    0xc73(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    12b0 <main+0x130>
mov    0x8(%rsp),%rdi
lea    0xc18(%rip),%rsi
jmp    12ab <main+0x12b>
lea    0xc54(%rip),%rsi
mov    0x8(%rsp),%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    14c9 <main+0x349>
lea    0xc14(%rip),%rsi
mov    0x8(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0xc2d(%rip),%rsi
mov    0x18(%rsp),%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    14f0 <main+0x370>
lea    0xc18(%rip),%rsi
mov    0x18(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0xc06(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    151a <main+0x39a>
lea    0xbfc(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    0x20(%rsp),%rdi
mov    0x30(%rsp),%rsi
mov    0x8(%rsp),%rdx
mov    0x18(%rsp),%rcx
mov    0x28(%rsp),%r8
mov    %r12,%r9
call   1060 <prowl_send@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
%struct.option = type { i8*, i32, i8, i32 }
@main.long_options = internal global [7 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i32 0, i8 0, i32 104 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i32 1, i8 0, i32 107 }, %struct.option { i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i32 1, i8 0, i32 112 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i32 1, i8 0, i32 80 }, %struct.option { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i32 1, i8 0, i32 97 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i32 1, i8 0, i32 101 }, %struct.option zeroinitializer]
@.str = [5 x i8] c"help\00"
@.str.1 = [7 x i8] c"apikey\00"
@.str.2 = [9 x i8] c"priority\00"
@.str.3 = [5 x i8] c"pkey\00"
@.str.4 = [4 x i8] c"app\00"
@.str.5 = [6 x i8] c"event\00"
@.str.6 = [12 x i8] c"hk:P:a:e:p:\00"
@EOF = global i32 0
@optarg = global i8* null
@.str.7 = [3 x i8] c"-2\00"
@.str.8 = [5 x i8] c"vlow\00"
@.str.9 = [6 x i8] c"debug\00"
@.str.10 = [3 x i8] c"-1\00"
@.str.11 = [9 x i8] c"moderate\00"
@.str.12 = [5 x i8] c"info\00"
@.str.13 = [2 x i8] c"0\00"
@.str.14 = [7 x i8] c"normal\00"
@.str.15 = [5 x i8] c"warn\00"
@.str.16 = [2 x i8] c"1\00"
@.str.17 = [5 x i8] c"high\00"
@.str.18 = [6 x i8] c"error\00"
@.str.19 = [2 x i8] c"2\00"
@.str.20 = [10 x i8] c"emergency\00"
@.str.21 = [6 x i8] c"fatal\00"
@optind = global i32 0
@.str.22 = [2 x i8] c" \00"
@.str.23 = [1 x i8] zeroinitializer
@.str.24 = [22 x i8] c"API Key is required.\0A\00"
@.str.25 = [9 x i8] c"libProwl\00"
@.str.26 = [29 x i8] c"ERROR: No message supplied.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%14 = call i8* @malloc(i32 41)
store i8* %14, i8** %8
%15 = call i8* @malloc(i32 41)
store i8* %15, i8** %9
%16 = call i8* @malloc(i32 257)
store i8* %16, i8** %10
%17 = call i8* @malloc(i32 1025)
store i8* %17, i8** %11
%18 = call i8* @malloc(i32 3)
store i8* %18, i8** %12
%19 = call i8* @malloc(i32 10001)
store i8* %19, i8** %13
br label %20
20: ; preds = %122, %2
%21 = load i32, i32* %4
%22 = load i8**, i8*** %5
%23 = call i32 @getopt_long(i32 %21, i8** %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), %struct.option* getelementptr inbounds ([7 x %struct.option], [7 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %7)
store i32 %23, i32* %6
%24 = load i32, i32* @EOF
%25 = icmp ne i32 %23, %24
br i1 %25, label %26, label %123
26: ; preds = %20
%27 = load i32, i32* %6
switch i32 %27, label %121 [
i32 107, label %28
i32 80, label %32
i32 112, label %36
i32 97, label %112
i32 101, label %116
i32 63, label %120
]
28: ; preds = %26
%29 = load i8*, i8** %8
%30 = load i8*, i8** @optarg
%31 = call i32 @strcpy(i8* %29, i8* %30)
br label %122
32: ; preds = %26
%33 = load i8*, i8** %9
%34 = load i8*, i8** @optarg
%35 = call i32 @strcpy(i8* %33, i8* %34)
br label %122
36: ; preds = %26
%37 = load i8*, i8** @optarg
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %48, label %40
40: ; preds = %36
%41 = load i8*, i8** @optarg
%42 = call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %48, label %44
44: ; preds = %40
%45 = load i8*, i8** @optarg
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %44, %40, %36
%49 = load i8*, i8** %12
%50 = call i32 @strcpy(i8* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %51
51: ; preds = %48, %44
%52 = load i8*, i8** @optarg
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %63, label %55
55: ; preds = %51
%56 = load i8*, i8** @optarg
%57 = call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %63, label %59
59: ; preds = %55
%60 = load i8*, i8** @optarg
%61 = call i64 @strcmp(i8* %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %59, %55, %51
%64 = load i8*, i8** %12
%65 = call i32 @strcpy(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %66
66: ; preds = %63, %59
%67 = load i8*, i8** @optarg
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %78, label %70
70: ; preds = %66
%71 = load i8*, i8** @optarg
%72 = call i64 @strcmp(i8* %71, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%73 = icmp eq i64 %72, 0
br i1 %73, label %78, label %74
74: ; preds = %70
%75 = load i8*, i8** @optarg
%76 = call i64 @strcmp(i8* %75, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %81
78: ; preds = %74, %70, %66
%79 = load i8*, i8** %12
%80 = call i32 @strcpy(i8* %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %81
81: ; preds = %78, %74
%82 = load i8*, i8** @optarg
%83 = call i64 @strcmp(i8* %82, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%84 = icmp eq i64 %83, 0
br i1 %84, label %93, label %85
85: ; preds = %81
%86 = load i8*, i8** @optarg
%87 = call i64 @strcmp(i8* %86, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
%88 = icmp eq i64 %87, 0
br i1 %88, label %93, label %89
89: ; preds = %85
%90 = load i8*, i8** @optarg
%91 = call i64 @strcmp(i8* %90, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%92 = icmp eq i64 %91, 0
br i1 %92, label %93, label %96
93: ; preds = %89, %85, %81
%94 = load i8*, i8** %12
%95 = call i32 @strcpy(i8* %94, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
br label %96
96: ; preds = %93, %89
%97 = load i8*, i8** @optarg
%98 = call i64 @strcmp(i8* %97, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%99 = icmp eq i64 %98, 0
br i1 %99, label %108, label %100
100: ; preds = %96
%101 = load i8*, i8** @optarg
%102 = call i64 @strcmp(i8* %101, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
%103 = icmp eq i64 %102, 0
br i1 %103, label %108, label %104
104: ; preds = %100
%105 = load i8*, i8** @optarg
%106 = call i64 @strcmp(i8* %105, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %111
108: ; preds = %104, %100, %96
%109 = load i8*, i8** %12
%110 = call i32 @strcpy(i8* %109, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
br label %111
111: ; preds = %108, %104
br label %122
112: ; preds = %26
%113 = load i8*, i8** %10
%114 = load i8*, i8** @optarg
%115 = call i32 @strcpy(i8* %113, i8* %114)
br label %122
116: ; preds = %26
%117 = load i8*, i8** %11
%118 = load i8*, i8** @optarg
%119 = call i32 @strcpy(i8* %117, i8* %118)
br label %122
120: ; preds = %26
br label %121
121: ; preds = %26, %120
br label %122
122: ; preds = %121, %116, %112, %111, %32, %28
br label %20
123: ; preds = %20
%124 = load i32, i32* @optind
%125 = load i32, i32* %4
%126 = icmp slt i32 %124, %125
br i1 %126, label %127, label %144
127: ; preds = %123
br label %128
128: ; preds = %132, %127
%129 = load i32, i32* @optind
%130 = load i32, i32* %4
%131 = icmp slt i32 %129, %130
br i1 %131, label %132, label %143
132: ; preds = %128
%133 = load i8*, i8** %13
%134 = load i8**, i8*** %5
%135 = load i32, i32* @optind
%136 = add nsw i32 %135, 1
store i32 %136, i32* @optind
%137 = sext i32 %135 to i64
%138 = getelementptr inbounds i8*, i8** %134, i64 %137
%139 = load i8*, i8** %138
%140 = call i32 @strcat(i8* %133, i8* %139)
%141 = load i8*, i8** %13
%142 = call i32 @strcat(i8* %141, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0))
br label %128
143: ; preds = %128
br label %144
144: ; preds = %143, %123
%145 = load i8*, i8** %8
%146 = call i64 @strcmp(i8* %145, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.23, i64 0, i64 0))
%147 = icmp eq i64 %146, 0
br i1 %147, label %148, label %151
148: ; preds = %144
%149 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.24, i64 0, i64 0))
%150 = call i32 @exit(i32 1)
unreachable
151: ; preds = %144
%152 = load i8*, i8** %12
%153 = call i64 @strcmp(i8* %152, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.23, i64 0, i64 0))
%154 = icmp eq i64 %153, 0
br i1 %154, label %155, label %158
155: ; preds = %151
%156 = load i8*, i8** %12
%157 = call i32 @strcpy(i8* %156, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %158
158: ; preds = %155, %151
%159 = load i8*, i8** %10
%160 = call i64 @strcmp(i8* %159, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.23, i64 0, i64 0))
%161 = icmp eq i64 %160, 0
br i1 %161, label %162, label %165
162: ; preds = %158
%163 = load i8*, i8** %10
%164 = call i32 @strcpy(i8* %163, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.25, i64 0, i64 0))
br label %165
165: ; preds = %162, %158
%166 = load i8*, i8** %13
%167 = call i64 @strcmp(i8* %166, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.23, i64 0, i64 0))
%168 = icmp eq i64 %167, 0
br i1 %168, label %169, label %172
169: ; preds = %165
%170 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.26, i64 0, i64 0))
%171 = call i32 @exit(i32 1)
unreachable
172: ; preds = %165
%173 = load i8*, i8** %8
%174 = load i8*, i8** %9
%175 = load i8*, i8** %12
%176 = load i8*, i8** %10
%177 = load i8*, i8** %11
%178 = load i8*, i8** %13
%179 = call i32 @prowl_send(i8* %173, i8* %174, i8* %175, i8* %176, i8* %177, i8* %178)
%180 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.option = type { i8*, i32, i8, i32 }
@main.long_options = internal global [7 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i32 0, i8 0, i32 104 }, %struct.option { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i32 1, i8 0, i32 107 }, %struct.option { i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i32 1, i8 0, i32 112 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i32 1, i8 0, i32 80 }, %struct.option { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i32 1, i8 0, i32 97 }, %struct.option { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i32 1, i8 0, i32 101 }, %struct.option zeroinitializer]
@.str = [5 x i8] c"help\00"
@.str.1 = [7 x i8] c"apikey\00"
@.str.2 = [9 x i8] c"priority\00"
@.str.3 = [5 x i8] c"pkey\00"
@.str.4 = [4 x i8] c"app\00"
@.str.5 = [6 x i8] c"event\00"
@.str.6 = [12 x i8] c"hk:P:a:e:p:\00"
@EOF = global i32 0
@optarg = global i8* null
@.str.7 = [3 x i8] c"-2\00"
@.str.8 = [5 x i8] c"vlow\00"
@.str.9 = [6 x i8] c"debug\00"
@.str.10 = [3 x i8] c"-1\00"
@.str.11 = [9 x i8] c"moderate\00"
@.str.12 = [5 x i8] c"info\00"
@.str.13 = [2 x i8] c"0\00"
@.str.14 = [7 x i8] c"normal\00"
@.str.15 = [5 x i8] c"warn\00"
@.str.16 = [2 x i8] c"1\00"
@.str.17 = [5 x i8] c"high\00"
@.str.18 = [6 x i8] c"error\00"
@.str.19 = [2 x i8] c"2\00"
@.str.20 = [10 x i8] c"emergency\00"
@.str.21 = [6 x i8] c"fatal\00"
@optind = global i32 0
@.str.22 = [2 x i8] c" \00"
@.str.23 = [1 x i8] zeroinitializer
@.str.25 = [9 x i8] c"libProwl\00"
@str = [28 x i8] c"ERROR: No message supplied.\00"
@str.27 = [21 x i8] c"API Key is required.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call dereferenceable_or_null(41) i8* @malloc(i32 41)
%6 = tail call dereferenceable_or_null(41) i8* @malloc(i32 41)
%7 = tail call dereferenceable_or_null(257) i8* @malloc(i32 257)
%8 = tail call dereferenceable_or_null(1025) i8* @malloc(i32 1025)
%9 = tail call dereferenceable_or_null(3) i8* @malloc(i32 3)
%10 = tail call dereferenceable_or_null(10001) i8* @malloc(i32 10001)
%11 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), %struct.option* getelementptr inbounds ([7 x %struct.option], [7 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %3)
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %102, label %14
14: ; preds = %2, %98
%15 = phi i32 [ %99, %98 ], [ %11, %2 ]
switch i32 %15, label %98 [
i32 107, label %16
i32 80, label %19
i32 112, label %22
i32 97, label %92
i32 101, label %95
]
16: ; preds = %14
%17 = load i8*, i8** @optarg
%18 = call i32 @strcpy(i8* %5, i8* %17)
br label %98
19: ; preds = %14
%20 = load i8*, i8** @optarg
%21 = call i32 @strcpy(i8* %6, i8* %20)
br label %98
22: ; preds = %14
%23 = load i8*, i8** @optarg
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %34, label %26
26: ; preds = %22
%27 = load i8*, i8** @optarg
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %34, label %30
30: ; preds = %26
%31 = load i8*, i8** @optarg
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %30, %26, %22
%35 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %36
36: ; preds = %34, %30
%37 = load i8*, i8** @optarg
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %48, label %40
40: ; preds = %36
%41 = load i8*, i8** @optarg
%42 = call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %48, label %44
44: ; preds = %40
%45 = load i8*, i8** @optarg
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %44, %40, %36
%49 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %50
50: ; preds = %48, %44
%51 = load i8*, i8** @optarg
%52 = call i64 @strcmp(i8* %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %62, label %54
54: ; preds = %50
%55 = load i8*, i8** @optarg
%56 = call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %62, label %58
58: ; preds = %54
%59 = load i8*, i8** @optarg
%60 = call i64 @strcmp(i8* %59, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %58, %54, %50
%63 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %64
64: ; preds = %62, %58
%65 = load i8*, i8** @optarg
%66 = call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %76, label %68
68: ; preds = %64
%69 = load i8*, i8** @optarg
%70 = call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %76, label %72
72: ; preds = %68
%73 = load i8*, i8** @optarg
%74 = call i64 @strcmp(i8* %73, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %78
76: ; preds = %72, %68, %64
%77 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
br label %78
78: ; preds = %76, %72
%79 = load i8*, i8** @optarg
%80 = call i64 @strcmp(i8* %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %90, label %82
82: ; preds = %78
%83 = load i8*, i8** @optarg
%84 = call i64 @strcmp(i8* %83, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
%85 = icmp eq i64 %84, 0
br i1 %85, label %90, label %86
86: ; preds = %82
%87 = load i8*, i8** @optarg
%88 = call i64 @strcmp(i8* %87, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0))
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %98
90: ; preds = %86, %82, %78
%91 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
br label %98
92: ; preds = %14
%93 = load i8*, i8** @optarg
%94 = call i32 @strcpy(i8* %7, i8* %93)
br label %98
95: ; preds = %14
%96 = load i8*, i8** @optarg
%97 = call i32 @strcpy(i8* %8, i8* %96)
br label %98
98: ; preds = %14, %86, %90, %95, %92, %19, %16
%99 = call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), %struct.option* getelementptr inbounds ([7 x %struct.option], [7 x %struct.option]* @main.long_options, i64 0, i64 0), i32* %3)
%100 = load i32, i32* @EOF
%101 = icmp eq i32 %99, %100
br i1 %101, label %102, label %14
102: ; preds = %98, %2
%103 = load i32, i32* @optind
%104 = icmp slt i32 %103, %0
br i1 %104, label %105, label %115
105: ; preds = %102, %105
%106 = phi i32 [ %113, %105 ], [ %103, %102 ]
%107 = add nsw i32 %106, 1
store i32 %107, i32* @optind
%108 = sext i32 %106 to i64
%109 = getelementptr inbounds i8*, i8** %1, i64 %108
%110 = load i8*, i8** %109
%111 = call i32 @strcat(i8* %10, i8* %110)
%112 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0))
%113 = load i32, i32* @optind
%114 = icmp slt i32 %113, %0
br i1 %114, label %105, label %115
115: ; preds = %105, %102
%116 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.23, i64 0, i64 0))
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %121
118: ; preds = %115
%119 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.27, i64 0, i64 0))
%120 = call i32 @exit(i32 1)
unreachable
121: ; preds = %115
%122 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.23, i64 0, i64 0))
%123 = icmp eq i64 %122, 0
br i1 %123, label %124, label %126
124: ; preds = %121
%125 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %126
126: ; preds = %124, %121
%127 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.23, i64 0, i64 0))
%128 = icmp eq i64 %127, 0
br i1 %128, label %129, label %131
129: ; preds = %126
%130 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.25, i64 0, i64 0))
br label %131
131: ; preds = %129, %126
%132 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.23, i64 0, i64 0))
%133 = icmp eq i64 %132, 0
br i1 %133, label %134, label %137
134: ; preds = %131
%135 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%136 = call i32 @exit(i32 1)
unreachable
137: ; preds = %131
%138 = call i32 @prowl_send(i8* %5, i8* %6, i8* %9, i8* %7, i8* %8, i8* %10)
%139 = call i32 @exit(i32 0)
unreachable
}