#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 */
char EOF;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char getopt(int, char **, char *);
char *optarg;
scalar_t__ optind;
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  char *player_name = "default_player_name";
  char *character_name = "default_PC_name";
  char *str = "0";
  char *dex = "0";
  char *constit = "0";
  char *intel = "0";
  char *wis = "0";
  char *charis = "0";
  int lawful = 0;
  int chaotic = 0;
  int good = 0;
  int evil = 0;
  char ch;
  while ((ch = getopt(argc, argv, "p:n:s:d:o:i:w:h:lcge")) != EOF)
    switch (ch) {
    case 'p':
      player_name = optarg;
      break;
    case 'n':
      character_name = optarg;
      break;
    case 's':
      str = optarg;
      break;
    case 'd':
      dex = optarg;
      break;
    case 'o':
      constit = optarg;
      break;
    case 'i':
      intel = optarg;
      break;
    case 'w':
      wis = optarg;
      break;
    case 'h':
      charis = optarg;
      break;
    case 'l':
      if (chaotic) {
        fprintf(stderr, "You can't be both lawful and chaotic.");
        return 1;
      }
      lawful = 1;
      break;
    case 'c':
      if (lawful) {
        fprintf(stderr, "You can't be both lawful and chaotic.");
        return 1;
      }
      chaotic = 1;
      break;
    case 'g':
      if (evil) {
        fprintf(stderr, "You can't be both good and evil.");
        return 1;
      }
      good = 1;
      break;
    case 'e':
      if (good) {
        fprintf(stderr, "You can't be both good and evil.");
        return 1;
      }
      evil = 1;
      break;
    default:
      fprintf(stderr, "unknown option: '%s'\n", optarg);
      return 1;
    }
  argc -= optind;
  argv += optind;
  char *orientation1 = "neutral";
  if (lawful) {
    orientation1 = "lawful";
  } else if (chaotic) {
    orientation1 = "chaotic";
  }
  char *orientation2 = "neutral";
  if (good) {
    orientation2 = "good";
  } else if (evil) {
    orientation2 = "evil";
  }
  printf("Player Name: %s\n", player_name);
  printf("Character Name: %s\n", character_name);
  printf("Orientation: %s %s\n", orientation1, orientation2);
  puts("Stats:");
  printf("  Strength: %s\n", str);
  printf("  Dexterity: %s\n", dex);
  printf("  Constitution: %s\n", constit);
  printf("  Intelligence: %s\n", intel);
  printf("  Wisdom: %s\n", wis);
  printf("  Charisma: %s\n", charis);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xef4(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xefd(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xf02(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xef7(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeec(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xee1(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xed6(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe9f(%rip),%rdx
call   1060 <getopt@plt>
mov    %al,-0x61(%rbp)
movsbl %al,%eax
mov    0x2df3(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     13d0 <main+0x290>
movsbl -0x61(%rbp),%eax
add    $0xffffff9d,%eax
mov    %eax,%ecx
mov    %rcx,-0x80(%rbp)
sub    $0x14,%eax
ja     139e <main+0x25e>
mov    -0x80(%rbp),%rax
lea    0xde7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2dcf(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    13cb <main+0x28b>
mov    0x2dbc(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    13cb <main+0x28b>
mov    0x2da9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    13cb <main+0x28b>
mov    0x2d96(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    13cb <main+0x28b>
mov    0x2d83(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    13cb <main+0x28b>
mov    0x2d70(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
jmp    13cb <main+0x28b>
mov    0x2d5d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    13cb <main+0x28b>
mov    0x2d4a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x50(%rbp)
jmp    13cb <main+0x28b>
cmpl   $0x0,-0x58(%rbp)
je     12e7 <main+0x1a7>
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
lea    0xdbb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1531 <main+0x3f1>
movl   $0x1,-0x54(%rbp)
jmp    13cb <main+0x28b>
cmpl   $0x0,-0x54(%rbp)
je     1320 <main+0x1e0>
mov    0x2cc4(%rip),%rax
mov    (%rax),%edi
lea    0xd82(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1531 <main+0x3f1>
movl   $0x1,-0x58(%rbp)
jmp    13cb <main+0x28b>
cmpl   $0x0,-0x60(%rbp)
je     1359 <main+0x219>
mov    0x2c8b(%rip),%rax
mov    (%rax),%edi
lea    0xd6f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1531 <main+0x3f1>
movl   $0x1,-0x5c(%rbp)
jmp    13cb <main+0x28b>
cmpl   $0x0,-0x5c(%rbp)
je     1392 <main+0x252>
mov    0x2c52(%rip),%rax
mov    (%rax),%edi
lea    0xd36(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1531 <main+0x3f1>
movl   $0x1,-0x60(%rbp)
jmp    13cb <main+0x28b>
mov    0x2c23(%rip),%rax
mov    (%rax),%edi
mov    0x2c4a(%rip),%rax
mov    (%rax),%rdx
lea    0xd1e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1531 <main+0x3f1>
jmp    11cd <main+0x8d>
mov    0x2c01(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2bed(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xceb(%rip),%rax
mov    %rax,-0x70(%rbp)
cmpl   $0x0,-0x54(%rbp)
je     141f <main+0x2df>
lea    0xcde(%rip),%rax
mov    %rax,-0x70(%rbp)
jmp    1439 <main+0x2f9>
cmpl   $0x0,-0x58(%rbp)
je     1434 <main+0x2f4>
lea    0xccb(%rip),%rax
mov    %rax,-0x70(%rbp)
jmp    1439 <main+0x2f9>
lea    0xcac(%rip),%rax
mov    %rax,-0x78(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     145e <main+0x31e>
lea    0xcae(%rip),%rax
mov    %rax,-0x78(%rbp)
jmp    1478 <main+0x338>
cmpl   $0x0,-0x60(%rbp)
je     1473 <main+0x333>
lea    0xc99(%rip),%rax
mov    %rax,-0x78(%rbp)
jmp    1478 <main+0x338>
mov    -0x18(%rbp),%rsi
lea    0xc8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xc89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x70(%rbp),%rsi
mov    -0x78(%rbp),%rdx
lea    0xc87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc8d(%rip),%rdi
call   1030 <puts@plt>
mov    -0x28(%rbp),%rsi
lea    0xc84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xc82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xc81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rsi
lea    0xc83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%rsi
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rsi
lea    0xc81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%r12
mov    %edi,%ebp
lea    0xf20(%rip),%rdx
call   1060 <getopt@plt>
mov    0x2e7a(%rip),%rbx
cmp    (%rbx),%al
jne    11ae <main+0x6e>
xor    %edx,%edx
lea    0xf05(%rip),%r15
lea    0xeee(%rip),%rax
mov    %rax,0x38(%rsp)
lea    0xece(%rip),%rax
mov    %rax,0x30(%rsp)
lea    0xf5a(%rip),%rbp
mov    %r15,0x40(%rsp)
mov    %r15,0x50(%rsp)
mov    %r15,%r13
mov    %r15,%r12
mov    %r15,0x48(%rsp)
xor    %eax,%eax
jmp    136c <main+0x22c>
lea    0xe9f(%rip),%rcx
mov    %rcx,0x30(%rsp)
lea    0xea7(%rip),%rcx
mov    %rcx,0x38(%rsp)
lea    0xeab(%rip),%rcx
movl   $0x0,0x8(%rsp)
lea    0xe24(%rip),%r13
lea    0xe97(%rip),%r14
mov    0x2e0e(%rip),%r15
movl   $0x0,0xc(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x14(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rcx,0x18(%rsp)
mov    %rcx,0x50(%rsp)
mov    %rcx,0x40(%rsp)
mov    %rcx,0x28(%rsp)
mov    %rcx,0x48(%rsp)
jmp    1245 <main+0x105>
mov    (%r15),%rax
mov    %rax,0x30(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r12,%rsi
mov    %r14,%rdx
call   1060 <getopt@plt>
cmp    (%rbx),%al
je     1330 <main+0x1f0>
movsbl %al,%eax
add    $0xffffff9d,%eax
cmp    $0x14,%eax
ja     1485 <main+0x345>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
cmpl   $0x0,0x14(%rsp)
jne    1466 <main+0x326>
movl   $0x1,0x10(%rsp)
movl   $0x0,0x14(%rsp)
jmp    1230 <main+0xf0>
mov    (%r15),%rax
mov    %rax,0x40(%rsp)
jmp    1230 <main+0xf0>
cmpl   $0x0,0xc(%rsp)
jne    1454 <main+0x314>
movl   $0x1,0x8(%rsp)
movl   $0x0,0xc(%rsp)
jmp    1230 <main+0xf0>
cmpl   $0x0,0x8(%rsp)
jne    1454 <main+0x314>
movl   $0x0,0x8(%rsp)
movl   $0x1,0xc(%rsp)
jmp    1230 <main+0xf0>
mov    (%r15),%rax
mov    %rax,0x28(%rsp)
jmp    1230 <main+0xf0>
mov    (%r15),%rax
mov    %rax,0x18(%rsp)
jmp    1230 <main+0xf0>
cmpl   $0x0,0x10(%rsp)
jne    1466 <main+0x326>
movl   $0x0,0x10(%rsp)
movl   $0x1,0x14(%rsp)
jmp    1230 <main+0xf0>
mov    (%r15),%rax
mov    %rax,0x38(%rsp)
jmp    1230 <main+0xf0>
mov    (%r15),%rax
mov    %rax,0x50(%rsp)
jmp    1230 <main+0xf0>
mov    (%r15),%rax
mov    %rax,0x48(%rsp)
jmp    1230 <main+0xf0>
mov    (%r15),%rax
mov    %rax,0x20(%rsp)
jmp    1230 <main+0xf0>
cmpl   $0x0,0x10(%rsp)
lea    0xdb0(%rip),%rax
lea    0xdb8(%rip),%rbp
cmove  %rax,%rbp
cmpl   $0x0,0x14(%rsp)
je     1355 <main+0x215>
lea    0xd9f(%rip),%rbp
mov    0x28(%rsp),%r15
mov    0x20(%rsp),%r12
mov    0x18(%rsp),%r13
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%eax
test   %eax,%eax
lea    0xd77(%rip),%rax
lea    0xd8c(%rip),%rcx
cmove  %rax,%rcx
test   %edx,%edx
lea    0xd7a(%rip),%rbx
cmove  %rcx,%rbx
lea    0xd79(%rip),%rdi
xor    %r14d,%r14d
mov    0x30(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd74(%rip),%rdi
mov    0x38(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd75(%rip),%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd75(%rip),%rdi
call   1030 <puts@plt>
lea    0xd70(%rip),%rdi
mov    0x48(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd6d(%rip),%rdi
mov    0x40(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd6b(%rip),%rdi
mov    0x50(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd6c(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd6f(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd6c(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14d,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b75(%rip),%rax
mov    (%rax),%edi
lea    0xc51(%rip),%rsi
jmp    1476 <main+0x336>
mov    0x2b63(%rip),%rax
mov    (%rax),%edi
lea    0xc19(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%r14d
jmp    1442 <main+0x302>
mov    0x2b44(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xc3e(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%r14d
jmp    1442 <main+0x302>

LLVM IR (-O0):
@.str = [20 x i8] c"default_player_name\00"
@.str.1 = [16 x i8] c"default_PC_name\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [21 x i8] c"p:n:s:d:o:i:w:h:lcge\00"
@EOF = global i8 0
@optarg = global i8* null
@stderr = global i32 0
@.str.4 = [38 x i8] c"You can't be both lawful and chaotic.\00"
@.str.5 = [33 x i8] c"You can't be both good and evil.\00"
@.str.6 = [22 x i8] c"unknown option: '%s'\0A\00"
@optind = global i64 0
@.str.7 = [8 x i8] c"neutral\00"
@.str.8 = [7 x i8] c"lawful\00"
@.str.9 = [8 x i8] c"chaotic\00"
@.str.10 = [5 x i8] c"good\00"
@.str.11 = [5 x i8] c"evil\00"
@.str.12 = [17 x i8] c"Player Name: %s\0A\00"
@.str.13 = [20 x i8] c"Character Name: %s\0A\00"
@.str.14 = [20 x i8] c"Orientation: %s %s\0A\00"
@.str.15 = [7 x i8] c"Stats:\00"
@.str.16 = [16 x i8] c" Strength: %s\0A\00"
@.str.17 = [17 x i8] c" Dexterity: %s\0A\00"
@.str.18 = [20 x i8] c" Constitution: %s\0A\00"
@.str.19 = [20 x i8] c" Intelligence: %s\0A\00"
@.str.20 = [14 x i8] c" Wisdom: %s\0A\00"
@.str.21 = [16 x i8] c" Charisma: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i8
%19 = alloca i8*
%20 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %9
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %10
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %11
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %12
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %13
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
br label %21
21: ; preds = %80, %2
%22 = load i32, i32* %4
%23 = load i8**, i8*** %5
%24 = call signext i8 @getopt(i32 %22, i8** %23, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
store i8 %24, i8* %18
%25 = sext i8 %24 to i32
%26 = load i8, i8* @EOF
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %25, %27
br i1 %28, label %29, label %81
29: ; preds = %21
%30 = load i8, i8* %18
%31 = sext i8 %30 to i32
switch i32 %31, label %76 [
i32 112, label %32
i32 110, label %34
i32 115, label %36
i32 100, label %38
i32 111, label %40
i32 105, label %42
i32 119, label %44
i32 104, label %46
i32 108, label %48
i32 99, label %55
i32 103, label %62
i32 101, label %69
]
32: ; preds = %29
%33 = load i8*, i8** @optarg
store i8* %33, i8** %6
br label %80
34: ; preds = %29
%35 = load i8*, i8** @optarg
store i8* %35, i8** %7
br label %80
36: ; preds = %29
%37 = load i8*, i8** @optarg
store i8* %37, i8** %8
br label %80
38: ; preds = %29
%39 = load i8*, i8** @optarg
store i8* %39, i8** %9
br label %80
40: ; preds = %29
%41 = load i8*, i8** @optarg
store i8* %41, i8** %10
br label %80
42: ; preds = %29
%43 = load i8*, i8** @optarg
store i8* %43, i8** %11
br label %80
44: ; preds = %29
%45 = load i8*, i8** @optarg
store i8* %45, i8** %12
br label %80
46: ; preds = %29
%47 = load i8*, i8** @optarg
store i8* %47, i8** %13
br label %80
48: ; preds = %29
%49 = load i32, i32* %15
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = load i32, i32* @stderr
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %128
54: ; preds = %48
store i32 1, i32* %14
br label %80
55: ; preds = %29
%56 = load i32, i32* %14
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i32, i32* @stderr
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %128
61: ; preds = %55
store i32 1, i32* %15
br label %80
62: ; preds = %29
%63 = load i32, i32* %17
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = load i32, i32* @stderr
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %128
68: ; preds = %62
store i32 1, i32* %16
br label %80
69: ; preds = %29
%70 = load i32, i32* %16
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = load i32, i32* @stderr
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %128
75: ; preds = %69
store i32 1, i32* %17
br label %80
76: ; preds = %29
%77 = load i32, i32* @stderr
%78 = load i8*, i8** @optarg
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %78)
store i32 1, i32* %3
br label %128
80: ; preds = %75, %68, %61, %54, %46, %44, %42, %40, %38, %36, %34, %32
br label %21
81: ; preds = %21
%82 = load i64, i64* @optind
%83 = load i32, i32* %4
%84 = sext i32 %83 to i64
%85 = sub nsw i64 %84, %82
%86 = trunc i64 %85 to i32
store i32 %86, i32* %4
%87 = load i64, i64* @optind
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 %87
store i8** %89, i8*** %5
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8** %19
%90 = load i32, i32* %14
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %93
92: ; preds = %81
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %19
br label %98
93: ; preds = %81
%94 = load i32, i32* %15
%95 = icmp ne i32 %94, 0
br i1 %95, label %96, label %97
96: ; preds = %93
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8** %19
br label %97
97: ; preds = %96, %93
br label %98
98: ; preds = %97, %92
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8** %20
%99 = load i32, i32* %16
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %102
101: ; preds = %98
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8** %20
br label %107
102: ; preds = %98
%103 = load i32, i32* %17
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %106
105: ; preds = %102
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8** %20
br label %106
106: ; preds = %105, %102
br label %107
107: ; preds = %106, %101
%108 = load i8*, i8** %6
%109 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i8* %108)
%110 = load i8*, i8** %7
%111 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i8* %110)
%112 = load i8*, i8** %19
%113 = load i8*, i8** %20
%114 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i8* %112, i8* %113)
%115 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%116 = load i8*, i8** %8
%117 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i8* %116)
%118 = load i8*, i8** %9
%119 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.17, i64 0, i64 0), i8* %118)
%120 = load i8*, i8** %10
%121 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0), i8* %120)
%122 = load i8*, i8** %11
%123 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.19, i64 0, i64 0), i8* %122)
%124 = load i8*, i8** %12
%125 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.20, i64 0, i64 0), i8* %124)
%126 = load i8*, i8** %13
%127 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.21, i64 0, i64 0), i8* %126)
store i32 0, i32* %3
br label %128
128: ; preds = %107, %76, %72, %65, %58, %51
%129 = load i32, i32* %3
ret i32 %129
}

LLVM IR (-O2):
@.str = [20 x i8] c"default_player_name\00"
@.str.1 = [16 x i8] c"default_PC_name\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [21 x i8] c"p:n:s:d:o:i:w:h:lcge\00"
@EOF = global i8 0
@optarg = global i8* null
@stderr = global i32 0
@.str.4 = [38 x i8] c"You can't be both lawful and chaotic.\00"
@.str.5 = [33 x i8] c"You can't be both good and evil.\00"
@.str.6 = [22 x i8] c"unknown option: '%s'\0A\00"
@optind = global i64 0
@.str.7 = [8 x i8] c"neutral\00"
@.str.8 = [7 x i8] c"lawful\00"
@.str.9 = [8 x i8] c"chaotic\00"
@.str.10 = [5 x i8] c"good\00"
@.str.11 = [5 x i8] c"evil\00"
@.str.12 = [17 x i8] c"Player Name: %s\0A\00"
@.str.13 = [20 x i8] c"Character Name: %s\0A\00"
@.str.14 = [20 x i8] c"Orientation: %s %s\0A\00"
@.str.15 = [7 x i8] c"Stats:\00"
@.str.16 = [16 x i8] c" Strength: %s\0A\00"
@.str.17 = [17 x i8] c" Dexterity: %s\0A\00"
@.str.18 = [20 x i8] c" Constitution: %s\0A\00"
@.str.19 = [20 x i8] c" Intelligence: %s\0A\00"
@.str.20 = [14 x i8] c" Wisdom: %s\0A\00"
@.str.21 = [16 x i8] c" Charisma: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %81, label %6
6: ; preds = %2, %61
%7 = phi i8 [ %74, %61 ], [ %3, %2 ]
%8 = phi i32 [ %73, %61 ], [ 0, %2 ]
%9 = phi i32 [ %72, %61 ], [ 0, %2 ]
%10 = phi i32 [ %71, %61 ], [ 0, %2 ]
%11 = phi i32 [ %70, %61 ], [ 0, %2 ]
%12 = phi i8* [ %69, %61 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ]
%13 = phi i8* [ %68, %61 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ]
%14 = phi i8* [ %67, %61 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ]
%15 = phi i8* [ %66, %61 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ]
%16 = phi i8* [ %65, %61 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ]
%17 = phi i8* [ %64, %61 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ]
%18 = phi i8* [ %63, %61 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), %2 ]
%19 = phi i8* [ %62, %61 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %2 ]
%20 = sext i8 %7 to i32
switch i32 %20, label %57 [
i32 112, label %21
i32 110, label %23
i32 115, label %25
i32 100, label %27
i32 111, label %29
i32 105, label %31
i32 119, label %33
i32 104, label %35
i32 108, label %37
i32 99, label %42
i32 103, label %47
i32 101, label %52
]
21: ; preds = %6
%22 = load i8*, i8** @optarg
br label %61
23: ; preds = %6
%24 = load i8*, i8** @optarg
br label %61
25: ; preds = %6
%26 = load i8*, i8** @optarg
br label %61
27: ; preds = %6
%28 = load i8*, i8** @optarg
br label %61
29: ; preds = %6
%30 = load i8*, i8** @optarg
br label %61
31: ; preds = %6
%32 = load i8*, i8** @optarg
br label %61
33: ; preds = %6
%34 = load i8*, i8** @optarg
br label %61
35: ; preds = %6
%36 = load i8*, i8** @optarg
br label %61
37: ; preds = %6
%38 = icmp eq i32 %10, 0
br i1 %38, label %61, label %39
39: ; preds = %37
%40 = load i32, i32* @stderr
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
br label %119
42: ; preds = %6
%43 = icmp eq i32 %11, 0
br i1 %43, label %61, label %44
44: ; preds = %42
%45 = load i32, i32* @stderr
%46 = tail call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
br label %119
47: ; preds = %6
%48 = icmp eq i32 %8, 0
br i1 %48, label %61, label %49
49: ; preds = %47
%50 = load i32, i32* @stderr
%51 = tail call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
br label %119
52: ; preds = %6
%53 = icmp eq i32 %9, 0
br i1 %53, label %61, label %54
54: ; preds = %52
%55 = load i32, i32* @stderr
%56 = tail call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
br label %119
57: ; preds = %6
%58 = load i32, i32* @stderr
%59 = load i8*, i8** @optarg
%60 = tail call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %59)
br label %119
61: ; preds = %52, %47, %42, %37, %35, %33, %31, %29, %27, %25, %23, %21
%62 = phi i8* [ %19, %35 ], [ %19, %33 ], [ %19, %31 ], [ %19, %29 ], [ %19, %27 ], [ %19, %25 ], [ %19, %23 ], [ %22, %21 ], [ %19, %37 ], [ %19, %42 ], [ %19, %47 ], [ %19, %52 ]
%63 = phi i8* [ %18, %35 ], [ %18, %33 ], [ %18, %31 ], [ %18, %29 ], [ %18, %27 ], [ %18, %25 ], [ %24, %23 ], [ %18, %21 ], [ %18, %37 ], [ %18, %42 ], [ %18, %47 ], [ %18, %52 ]
%64 = phi i8* [ %17, %35 ], [ %17, %33 ], [ %17, %31 ], [ %17, %29 ], [ %17, %27 ], [ %26, %25 ], [ %17, %23 ], [ %17, %21 ], [ %17, %37 ], [ %17, %42 ], [ %17, %47 ], [ %17, %52 ]
%65 = phi i8* [ %16, %35 ], [ %16, %33 ], [ %16, %31 ], [ %16, %29 ], [ %28, %27 ], [ %16, %25 ], [ %16, %23 ], [ %16, %21 ], [ %16, %37 ], [ %16, %42 ], [ %16, %47 ], [ %16, %52 ]
%66 = phi i8* [ %15, %35 ], [ %15, %33 ], [ %15, %31 ], [ %30, %29 ], [ %15, %27 ], [ %15, %25 ], [ %15, %23 ], [ %15, %21 ], [ %15, %37 ], [ %15, %42 ], [ %15, %47 ], [ %15, %52 ]
%67 = phi i8* [ %14, %35 ], [ %14, %33 ], [ %32, %31 ], [ %14, %29 ], [ %14, %27 ], [ %14, %25 ], [ %14, %23 ], [ %14, %21 ], [ %14, %37 ], [ %14, %42 ], [ %14, %47 ], [ %14, %52 ]
%68 = phi i8* [ %13, %35 ], [ %34, %33 ], [ %13, %31 ], [ %13, %29 ], [ %13, %27 ], [ %13, %25 ], [ %13, %23 ], [ %13, %21 ], [ %13, %37 ], [ %13, %42 ], [ %13, %47 ], [ %13, %52 ]
%69 = phi i8* [ %36, %35 ], [ %12, %33 ], [ %12, %31 ], [ %12, %29 ], [ %12, %27 ], [ %12, %25 ], [ %12, %23 ], [ %12, %21 ], [ %12, %37 ], [ %12, %42 ], [ %12, %47 ], [ %12, %52 ]
%70 = phi i32 [ %11, %35 ], [ %11, %33 ], [ %11, %31 ], [ %11, %29 ], [ %11, %27 ], [ %11, %25 ], [ %11, %23 ], [ %11, %21 ], [ 1, %37 ], [ 0, %42 ], [ %11, %47 ], [ %11, %52 ]
%71 = phi i32 [ %10, %35 ], [ %10, %33 ], [ %10, %31 ], [ %10, %29 ], [ %10, %27 ], [ %10, %25 ], [ %10, %23 ], [ %10, %21 ], [ 0, %37 ], [ 1, %42 ], [ %10, %47 ], [ %10, %52 ]
%72 = phi i32 [ %9, %35 ], [ %9, %33 ], [ %9, %31 ], [ %9, %29 ], [ %9, %27 ], [ %9, %25 ], [ %9, %23 ], [ %9, %21 ], [ %9, %37 ], [ %9, %42 ], [ 1, %47 ], [ 0, %52 ]
%73 = phi i32 [ %8, %35 ], [ %8, %33 ], [ %8, %31 ], [ %8, %29 ], [ %8, %27 ], [ %8, %25 ], [ %8, %23 ], [ %8, %21 ], [ %8, %37 ], [ %8, %42 ], [ 0, %47 ], [ 1, %52 ]
%74 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%75 = load i8, i8* @EOF
%76 = icmp eq i8 %74, %75
br i1 %76, label %77, label %6
77: ; preds = %61
%78 = icmp eq i32 %70, 0
%79 = icmp eq i32 %71, 0
%80 = select i1 %79, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0)
br i1 %78, label %81, label %93
81: ; preds = %77, %2
%82 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), %2 ], [ %80, %77 ]
%83 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %2 ], [ %62, %77 ]
%84 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %63, %77 ]
%85 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ], [ %64, %77 ]
%86 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ], [ %65, %77 ]
%87 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ], [ %66, %77 ]
%88 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ], [ %67, %77 ]
%89 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ], [ %68, %77 ]
%90 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ], [ %69, %77 ]
%91 = phi i32 [ 0, %2 ], [ %72, %77 ]
%92 = phi i32 [ 0, %2 ], [ %73, %77 ]
br label %93
93: ; preds = %77, %81
%94 = phi i8* [ %83, %81 ], [ %62, %77 ]
%95 = phi i8* [ %84, %81 ], [ %63, %77 ]
%96 = phi i8* [ %85, %81 ], [ %64, %77 ]
%97 = phi i8* [ %86, %81 ], [ %65, %77 ]
%98 = phi i8* [ %87, %81 ], [ %66, %77 ]
%99 = phi i8* [ %88, %81 ], [ %67, %77 ]
%100 = phi i8* [ %89, %81 ], [ %68, %77 ]
%101 = phi i8* [ %90, %81 ], [ %69, %77 ]
%102 = phi i32 [ %91, %81 ], [ %72, %77 ]
%103 = phi i32 [ %92, %81 ], [ %73, %77 ]
%104 = phi i8* [ %82, %81 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), %77 ]
%105 = icmp eq i32 %102, 0
%106 = icmp eq i32 %103, 0
%107 = select i1 %106, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0)
%108 = select i1 %105, i8* %107, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0)
%109 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i8* %94)
%110 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i8* %95)
%111 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i8* %104, i8* %108)
%112 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%113 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i8* %96)
%114 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.17, i64 0, i64 0), i8* %97)
%115 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0), i8* %98)
%116 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.19, i64 0, i64 0), i8* %99)
%117 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.20, i64 0, i64 0), i8* %100)
%118 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.21, i64 0, i64 0), i8* %101)
br label %119
119: ; preds = %93, %57, %54, %49, %44, %39
%120 = phi i32 [ 1, %57 ], [ 1, %54 ], [ 1, %49 ], [ 1, %44 ], [ 1, %39 ], [ 0, %93 ]
ret i32 %120
}