#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ aquatroll(int);
int /*<<< orphan*/ art250();
int d(int);
int /*<<< orphan*/ darkmantle(int);
int /*<<< orphan*/ duergar(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ greenhag(int);
int /*<<< orphan*/ grell(int);
int /*<<< orphan*/ ixitxachitl(int);
int /*<<< orphan*/ kuotoa(int);
int /*<<< orphan*/ magictableb();
int /*<<< orphan*/ merrow(int);
int /*<<< orphan*/ mummy(int);
int /*<<< orphan*/ niceprint(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ quipper(int);
int /*<<< orphan*/ stirge(unsigned int);
int /*<<< orphan*/ waterweird(int);
void creature_encounter(void) {
  unsigned d4 = d(4);
  unsigned d12 = d(12);
  unsigned d20 = d(20);
  unsigned i, j;
  switch (d12) {
  case 1:
    aquatroll(1);
    break;
  case 2:
    darkmantle(d(4) + d(4));
    break;
  case 3:
    duergar(d(4) + 2);
    niceprint("The duergar are traveling in a keelboat traversing the lake on "
              "business. The "
              "gray dwarves parley with the adventurers--or attack them if the "
              "opportunity looks "
              "ripe to capture them and sell them as slaves in Gracklstugh. If "
              "the duergar suprise "
              "all the characters, they turn invisible, making it appear that "
              "their boat is "
              "abandoned so as to lure the adventurers on board before they "
              "attack.\n\n");
    if (10 < d20 && d20 < 14)
      printf("The keelboat carries %d pounds of unrefined iron ore.\n\n",
             100 * d(20));
    else if (13 < d20 && d20 < 17)
      printf("The keelboat carries %d zurkhwood crates filled with mining "
             "tools.\n\n",
             d(4));
    else if (16 < d20 && d20 < 20)
      printf("The keelboat carries %d zurkhwood crates filled with harvested "
             "fungi.\n\n",
             d(4) + d(4));
    else if (d20 == 20) {
      printf("The keelboat carries a locked iron chest containing:\n\n");
      printf("\t%d gp\n", 100 * (d(6) + d(6) + d(6)));
      (void)putchar('\t');
      magictableb();
      (void)putchar('\n');
      printf("Chest: AC 19, %d hp\n", d(6) + d(6) + d(6));
      printf("Lock : AC 19, %d hp\n\n", d(4) + d(4));
    }
    break;
  case 4:
    niceprint("Nancy Plunk is a green hag who likes to taunt and lead "
              "travelers astray. She "
              "might instead bargain with the characters with her knowledge of "
              "the Darklake, "
              "especially if her life or freedom is at stake. If this "
              "encounter occurs again, "
              "it might be with one of her sisters, Maven Delve or Dame "
              "Spiderwort.\n\n");
    greenhag(1);
    break;
  case 5:
    grell(1);
    break;
  case 6:
  case 7:
    ixitxachitl(d(6) + 2);
    niceprint("They attack any party member in the water. Otherwise, they "
              "follow the party "
              "and wait for an opportunity to strike. If denied a meal for too "
              "long, they "
              "begin to gnaw on the hull of a boat or the underside of a raft, "
              "hoping to "
              "sink it (this tactic is ineffective against craft with a high "
              "damage threshold.\n\n");
    break;
  case 8:
    kuotoa(d(4));
    niceprint("The kuo-toa are traveling in a keelboat toward Sloopidoop (or "
              "away from the town "
              "if it has been attacked). If the characters have not been to "
              "Sloopidoop, the kuo-toa "
              "might try to capture them and bring them there.\n\n");
    if (15 < d20 && d20 < 18) {
      j = 0;
      for (i = 0; i < d4; i++)
        j += (d(2) == 1) ? 0 : (d(6) + d(6) + d(6));
      if (j == 0)
        printf("The keelboat carries %d empty nets\n\n", d4);
      else
        printf("The keelboat carries %d nets containing %d dead edible "
               "quippers\n\n",
               d4, j);
    } else if (17 < d20 && d20 < 20) {
      j = 0;
      for (i = 0; i < d4; i++)
        j += (d(2) == 1) ? 0 : (d(6) + d(6) + d(6));
      if (j == 0)
        printf("The keelboat carries %d empty nets\n\n", d4);
      else {
        printf("The keelboat carries %d nets containing %d living stirges\n\n",
               d4, j);
        stirge(j);
      }
    } else if (d20 == 20) {
      printf("The keelboat carries:\n\n");
      printf("\t%d pieces of broken, barnacle-encrusted statuary\n", d(4));
      printf("\teach worth 50 gp and weighing %d pounds\n", 5 * d(4));
      printf("\tand each depicting a weird alien creature, a long-forgotten\n");
      printf("\tgod, or fragment thereof.\n\n");
    }
    break;
  case 9:
    merrow(d(4));
    niceprint("These worshipers of Demogorgon have been driven into a frenxy "
              "by his arrival "
              "in the Underdark. They immediately attack, trying to capsize or "
              "wreck boats as "
              "they utter the war cry, \"Blood and salt for the Prince of the "
              "Demons!\" in "
              "the Abyssal language.\n\n");
    niceprint("A merrow can use its action to capsize a bot or raft within 5 "
              "feet of it. "
              "Anyone in the boat can thwart the merrow by using a reaction to "
              "make a Strength "
              "check contested by the merrow's Strength check (+4). If the "
              "merrow wins the "
              "contest, the vessel capsizes.\n\n");
    break;
  case 10:
    stirge(d(6) + d(6) + d(6));
    niceprint("If the party is aware of the stirges clinging to the ceiling "
              "like bats, the "
              "characters can make a DC 13 group Dexterity (Stealth) check to "
              "slip past the "
              "stirges without disturbing them. If the group check succeeds, "
              "the stirges "
              "ignore the party. Otherwise, the stirges descend and attack the "
              "nearest "
              "party members.\n\n");
    break;
  case 11:
    quipper(1);
    niceprint(
        "The swarm keeps pace with the characters attacking anyone in the "
        "water. "
        "If an hour passes and no meal has presented itself, the quippers stop "
        "following the party.\n\n");
    break;
  case 12:
    waterweird(1);
    niceprint("Bound to some long-lost site beneath the surface of the water, "
              "this neutral "
              "evil elemental rises to attack when characters pass by.\n\n");
    switch (d(3)) {
    case 1:
      niceprint("The water weird is guarding a sunken alter dedicated to a "
                "forgotten deity.\n");
      break;
    case 2:
      niceprint(
          "The water weird is guarding "
          "a sunken statue with 500 gp black pearls for eyes; a thief "
          "who removes one or both gems becomes the target of a contagion "
          "spell [PH 227].\n\n");
      niceprint("The character makes a DC 14 Constitution save three "
                "times--one per turn. "
                "If they fail all three, then they suffer for 7 days.  If the "
                "make all three, "
                "then the spell ends.  They are affected by the following "
                "natural disease:\n\n");
      switch (d(6)) {
      case 1:
        printf("Blinding sickness\n\n");
        break;
      case 2:
        printf("Filth fever\n\n");
        break;
      case 3:
        printf("Flesh rot\n\n");
        break;
      case 4:
        printf("Mindfire\n\n");
        break;
      case 5:
        printf("Seizure\n\n");
        break;
      case 6:
        printf("Slimy doom\n\n");
        break;
      default:
        printf("Impossible contagion condition\n");
        exit(EXIT_FAILURE);
      }
      break;
    case 3:
      niceprint("The water weird is guarding a sunken, sealed, sarcophagus "
                "containing "
                "the following art objects:\n\n");
      for (i = 0; i < d4; i++) {
        printf("%d: ", i + 1);
        art250();
      }
      (void)putchar('\n');
      mummy(1);
      break;
    default:
      printf("Impossible water weird guarding situation\n");
      exit(EXIT_FAILURE);
    }
    break;
  default:
    printf("Impossible creature encounter of %d\n", d12);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<creature_encounter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    $0x4,%edi
call   1050 <d@plt>
mov    %eax,-0x4(%rbp)
mov    $0xc,%edi
call   1050 <d@plt>
mov    %eax,-0x8(%rbp)
mov    $0x14,%edi
call   1050 <d@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xb,%eax
ja     196b <creature_encounter+0x73b>
mov    -0x20(%rbp),%rax
lea    0xd81(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1,%edi
call   1120 <aquatroll@plt>
jmp    198a <creature_encounter+0x75a>
mov    $0x4,%edi
call   1050 <d@plt>
mov    %eax,-0x24(%rbp)
mov    $0x4,%edi
call   1050 <d@plt>
mov    -0x24(%rbp),%edi
add    %eax,%edi
call   1040 <darkmantle@plt>
jmp    198a <creature_encounter+0x75a>
mov    $0x4,%edi
call   1050 <d@plt>
mov    %eax,%edi
add    $0x2,%edi
call   10a0 <duergar@plt>
lea    0xd70(%rip),%rdi
call   10f0 <niceprint@plt>
mov    $0xa,%eax
cmp    -0xc(%rbp),%eax
jae    1315 <creature_encounter+0xe5>
cmpl   $0xe,-0xc(%rbp)
jae    1315 <creature_encounter+0xe5>
mov    $0x14,%edi
call   1050 <d@plt>
imul   $0x64,%eax,%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1480 <creature_encounter+0x250>
mov    $0xd,%eax
cmp    -0xc(%rbp),%eax
jae    134c <creature_encounter+0x11c>
cmpl   $0x11,-0xc(%rbp)
jae    134c <creature_encounter+0x11c>
mov    $0x4,%edi
call   1050 <d@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    147b <creature_encounter+0x24b>
mov    $0x10,%eax
cmp    -0xc(%rbp),%eax
jae    1393 <creature_encounter+0x163>
cmpl   $0x14,-0xc(%rbp)
jae    1393 <creature_encounter+0x163>
mov    $0x4,%edi
call   1050 <d@plt>
mov    %eax,-0x28(%rbp)
mov    $0x4,%edi
call   1050 <d@plt>
mov    -0x28(%rbp),%esi
add    %eax,%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1476 <creature_encounter+0x246>
cmpl   $0x14,-0xc(%rbp)
jne    1471 <creature_encounter+0x241>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,-0x3c(%rbp)
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
add    %ecx,%eax
imul   $0x64,%eax,%esi
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1130 <magictableb@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,-0x34(%rbp)
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    $0x6,%edi
call   1050 <d@plt>
mov    -0x30(%rbp),%esi
add    %eax,%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x4,%edi
call   1050 <d@plt>
mov    %eax,-0x2c(%rbp)
mov    $0x4,%edi
call   1050 <d@plt>
mov    -0x2c(%rbp),%esi
add    %eax,%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1476 <creature_encounter+0x246>
jmp    147b <creature_encounter+0x24b>
jmp    1480 <creature_encounter+0x250>
jmp    198a <creature_encounter+0x75a>
lea    0xe72(%rip),%rdi
call   10f0 <niceprint@plt>
mov    $0x1,%edi
call   1060 <greenhag@plt>
jmp    198a <creature_encounter+0x75a>
mov    $0x1,%edi
call   1070 <grell@plt>
jmp    198a <creature_encounter+0x75a>
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,%edi
add    $0x2,%edi
call   10e0 <ixitxachitl@plt>
lea    0xf65(%rip),%rdi
call   10f0 <niceprint@plt>
jmp    198a <creature_encounter+0x75a>
mov    $0x4,%edi
call   1050 <d@plt>
mov    %eax,%edi
call   1140 <kuotoa@plt>
lea    0x1076(%rip),%rdi
call   10f0 <niceprint@plt>
mov    $0xf,%eax
cmp    -0xc(%rbp),%eax
jae    15c5 <creature_encounter+0x395>
cmpl   $0x12,-0xc(%rbp)
jae    15c5 <creature_encounter+0x395>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    158c <creature_encounter+0x35c>
mov    $0x2,%edi
call   1050 <d@plt>
cmp    $0x1,%eax
jne    1540 <creature_encounter+0x310>
xor    %eax,%eax
mov    %eax,-0x40(%rbp)
jmp    1575 <creature_encounter+0x345>
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,-0x48(%rbp)
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1517 <creature_encounter+0x2e7>
cmpl   $0x0,-0x14(%rbp)
jne    15ac <creature_encounter+0x37c>
mov    -0x4(%rbp),%esi
lea    0x109a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    15c0 <creature_encounter+0x390>
mov    -0x4(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0x10a6(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1714 <creature_encounter+0x4e4>
mov    $0x11,%eax
cmp    -0xc(%rbp),%eax
jae    16a1 <creature_encounter+0x471>
cmpl   $0x14,-0xc(%rbp)
jae    16a1 <creature_encounter+0x471>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1660 <creature_encounter+0x430>
mov    $0x2,%edi
call   1050 <d@plt>
cmp    $0x1,%eax
jne    1614 <creature_encounter+0x3e4>
xor    %eax,%eax
mov    %eax,-0x4c(%rbp)
jmp    1649 <creature_encounter+0x419>
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,-0x54(%rbp)
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x50(%rbp)
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    15eb <creature_encounter+0x3bb>
cmpl   $0x0,-0x14(%rbp)
jne    1680 <creature_encounter+0x450>
mov    -0x4(%rbp),%esi
lea    0xfc6(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    169c <creature_encounter+0x46c>
mov    -0x4(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0x1014(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x14(%rbp),%edi
call   1110 <stirge@plt>
jmp    170f <creature_encounter+0x4df>
cmpl   $0x14,-0xc(%rbp)
jne    170a <creature_encounter+0x4da>
lea    0x102b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x4,%edi
call   1050 <d@plt>
mov    %eax,%esi
lea    0x1029(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x4,%edi
call   1050 <d@plt>
imul   $0x5,%eax,%esi
lea    0x1041(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0x105d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0x108d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    170f <creature_encounter+0x4df>
jmp    1714 <creature_encounter+0x4e4>
jmp    198a <creature_encounter+0x75a>
mov    $0x4,%edi
call   1050 <d@plt>
mov    %eax,%edi
call   10c0 <merrow@plt>
lea    0x107c(%rip),%rdi
call   10f0 <niceprint@plt>
lea    0x116e(%rip),%rdi
call   10f0 <niceprint@plt>
jmp    198a <creature_encounter+0x75a>
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,-0x5c(%rbp)
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x58(%rbp)
mov    $0x6,%edi
call   1050 <d@plt>
mov    -0x58(%rbp),%edi
add    %eax,%edi
call   1110 <stirge@plt>
lea    0x122e(%rip),%rdi
call   10f0 <niceprint@plt>
jmp    198a <creature_encounter+0x75a>
mov    $0x1,%edi
call   10d0 <quipper@plt>
lea    0x134f(%rip),%rdi
call   10f0 <niceprint@plt>
jmp    198a <creature_encounter+0x75a>
mov    $0x1,%edi
call   10b0 <waterweird@plt>
lea    0x13d9(%rip),%rdi
call   10f0 <niceprint@plt>
mov    $0x3,%edi
call   1050 <d@plt>
mov    %eax,%ecx
mov    %ecx,-0x60(%rbp)
sub    $0x1,%eax
je     17fd <creature_encounter+0x5cd>
jmp    17db <creature_encounter+0x5ab>
mov    -0x60(%rbp),%eax
sub    $0x2,%eax
je     180e <creature_encounter+0x5de>
jmp    17ec <creature_encounter+0x5bc>
mov    -0x60(%rbp),%eax
sub    $0x3,%eax
je     18e9 <creature_encounter+0x6b9>
jmp    194a <creature_encounter+0x71a>
lea    0x1414(%rip),%rdi
call   10f0 <niceprint@plt>
jmp    1966 <creature_encounter+0x736>
lea    0x144f(%rip),%rdi
call   10f0 <niceprint@plt>
lea    0x14eb(%rip),%rdi
call   10f0 <niceprint@plt>
mov    $0x6,%edi
call   1050 <d@plt>
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x68(%rbp)
sub    $0x5,%eax
ja     18c8 <creature_encounter+0x698>
mov    -0x68(%rbp),%rax
lea    0x7e3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1591(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    18e4 <creature_encounter+0x6b4>
lea    0x1592(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    18e4 <creature_encounter+0x6b4>
lea    0x158d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    18e4 <creature_encounter+0x6b4>
lea    0x1586(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    18e4 <creature_encounter+0x6b4>
lea    0x157e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    18e4 <creature_encounter+0x6b4>
lea    0x1575(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    18e4 <creature_encounter+0x6b4>
lea    0x156f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x3703(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
jmp    1966 <creature_encounter+0x736>
lea    0x156e(%rip),%rdi
call   10f0 <niceprint@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1931 <creature_encounter+0x701>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
lea    0x15ab(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   1150 <art250@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    18fc <creature_encounter+0x6cc>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1090 <mummy@plt>
jmp    1966 <creature_encounter+0x736>
lea    0x1574(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x3681(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
jmp    198a <creature_encounter+0x75a>
mov    -0x8(%rbp),%esi
lea    0x157b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    0x365d(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creature_encounter>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x4,%edi
call   1060 <d@plt>
mov    %eax,%r14d
mov    $0xc,%edi
call   1060 <d@plt>
mov    %eax,%ebx
mov    $0x14,%edi
call   1060 <d@plt>
mov    %eax,%r15d
lea    -0x1(%rbx),%eax
cmp    $0xb,%eax
ja     17da <creature_encounter+0x59a>
lea    0xd7f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x6,%edi
call   1060 <d@plt>
lea    0x2(%rax),%edi
call   10f0 <ixitxachitl@plt>
lea    0x1155(%rip),%rdi
jmp    14a4 <creature_encounter+0x264>
mov    $0x4,%edi
call   1060 <d@plt>
lea    0x2(%rax),%edi
call   10b0 <duergar@plt>
lea    0xd87(%rip),%rdi
call   1100 <niceprint@plt>
lea    -0xb(%r15),%eax
cmp    $0x2,%eax
ja     14b1 <creature_encounter+0x271>
mov    $0x14,%edi
call   1060 <d@plt>
imul   $0x64,%eax,%esi
lea    0xee8(%rip),%rdi
jmp    178a <creature_encounter+0x54a>
lea    0xfd4(%rip),%rdi
call   1100 <niceprint@plt>
mov    $0x1,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <greenhag@plt>
mov    $0x1,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <grell@plt>
mov    $0x6,%edi
call   1060 <d@plt>
mov    %eax,%ebx
mov    $0x6,%edi
call   1060 <d@plt>
add    %eax,%ebx
mov    $0x6,%edi
call   1060 <d@plt>
add    %eax,%ebx
mov    %ebx,%edi
call   1120 <stirge@plt>
lea    0x15b9(%rip),%rdi
jmp    14a4 <creature_encounter+0x264>
mov    $0x1,%edi
call   10c0 <waterweird@plt>
lea    0x1784(%rip),%rdi
call   1100 <niceprint@plt>
mov    $0x3,%edi
call   1060 <d@plt>
cmp    $0x3,%eax
je     15a0 <creature_encounter+0x360>
cmp    $0x2,%eax
je     1602 <creature_encounter+0x3c2>
cmp    $0x1,%eax
jne    17ec <creature_encounter+0x5ac>
lea    0x17d9(%rip),%rdi
jmp    14a4 <creature_encounter+0x264>
mov    $0x1,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1130 <aquatroll@plt>
mov    $0x4,%edi
call   1060 <d@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1060 <d@plt>
add    %eax,%ebx
mov    %ebx,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <darkmantle@plt>
mov    $0x4,%edi
call   1060 <d@plt>
mov    %eax,%edi
call   1150 <kuotoa@plt>
lea    0x1140(%rip),%rdi
call   1100 <niceprint@plt>
mov    %r15d,%eax
and    $0xfffffffe,%eax
cmp    $0x10,%eax
je     14d6 <creature_encounter+0x296>
cmp    $0x12,%eax
jne    153d <creature_encounter+0x2fd>
test   %r14d,%r14d
je     16be <creature_encounter+0x47e>
xor    %ebx,%ebx
mov    %r14d,%ebp
jmp    142b <creature_encounter+0x1eb>
nopl   0x0(%rax,%rax,1)
add    %eax,%ebx
add    $0xffffffff,%ebp
je     1679 <creature_encounter+0x439>
mov    $0x2,%edi
call   1060 <d@plt>
mov    %eax,%ecx
mov    $0x0,%eax
cmp    $0x1,%ecx
je     1420 <creature_encounter+0x1e0>
mov    $0x6,%edi
call   1060 <d@plt>
mov    %eax,%r15d
mov    $0x6,%edi
call   1060 <d@plt>
mov    %eax,%r12d
add    %r15d,%r12d
mov    $0x6,%edi
call   1060 <d@plt>
add    %r12d,%eax
jmp    1420 <creature_encounter+0x1e0>
mov    $0x4,%edi
call   1060 <d@plt>
mov    %eax,%edi
call   10d0 <merrow@plt>
lea    0x127e(%rip),%rdi
call   1100 <niceprint@plt>
lea    0x1370(%rip),%rdi
jmp    14a4 <creature_encounter+0x264>
mov    $0x1,%edi
call   10e0 <quipper@plt>
lea    0x159f(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1100 <niceprint@plt>
lea    -0xe(%r15),%eax
cmp    $0x2,%eax
ja     164c <creature_encounter+0x40c>
mov    $0x4,%edi
call   1060 <d@plt>
lea    0xd38(%rip),%rdi
mov    %eax,%esi
jmp    178a <creature_encounter+0x54a>
test   %r14d,%r14d
je     16be <creature_encounter+0x47e>
xor    %ebx,%ebx
mov    %r14d,%ebp
jmp    14fb <creature_encounter+0x2bb>
cs nopw 0x0(%rax,%rax,1)
add    %eax,%ebx
add    $0xffffffff,%ebp
je     169f <creature_encounter+0x45f>
mov    $0x2,%edi
call   1060 <d@plt>
mov    %eax,%ecx
mov    $0x0,%eax
cmp    $0x1,%ecx
je     14f0 <creature_encounter+0x2b0>
mov    $0x6,%edi
call   1060 <d@plt>
mov    %eax,%r15d
mov    $0x6,%edi
call   1060 <d@plt>
mov    %eax,%r12d
add    %r15d,%r12d
mov    $0x6,%edi
call   1060 <d@plt>
add    %r12d,%eax
jmp    14f0 <creature_encounter+0x2b0>
cmp    $0x14,%r15d
jne    1799 <creature_encounter+0x559>
lea    0x1915(%rip),%rdi
call   1050 <puts@plt>
mov    $0x4,%edi
call   1060 <d@plt>
lea    0x1142(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x4,%edi
call   1060 <d@plt>
lea    (%rax,%rax,4),%esi
lea    0x1158(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x18eb(%rip),%rdi
call   1050 <puts@plt>
lea    0x191c(%rip),%rdi
jmp    17cd <creature_encounter+0x58d>
lea    0x179d(%rip),%rdi
call   1100 <niceprint@plt>
test   %r14d,%r14d
je     15e6 <creature_encounter+0x3a6>
neg    %r14d
mov    $0x1,%ebx
lea    0x17e6(%rip),%r15
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1090 <printf@plt>
xor    %eax,%eax
call   1160 <art250@plt>
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    15c0 <creature_encounter+0x380>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    10a0 <mummy@plt>
lea    0x15b1(%rip),%rdi
call   1100 <niceprint@plt>
lea    0x164d(%rip),%rdi
call   1100 <niceprint@plt>
mov    $0x6,%edi
call   1060 <d@plt>
add    $0xffffffff,%eax
cmp    $0x5,%eax
ja     1806 <creature_encounter+0x5c6>
lea    0x9f9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x17c0(%rip),%rdi
jmp    17cd <creature_encounter+0x58d>
lea    -0x11(%r15),%eax
cmp    $0x2,%eax
ja     16cd <creature_encounter+0x48d>
mov    $0x4,%edi
call   1060 <d@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1060 <d@plt>
add    %eax,%ebx
lea    0xbd8(%rip),%rdi
jmp    1788 <creature_encounter+0x548>
test   %ebx,%ebx
je     16be <creature_encounter+0x47e>
lea    0xfe6(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1090 <printf@plt>
mov    %ebx,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1120 <stirge@plt>
test   %ebx,%ebx
je     16be <creature_encounter+0x47e>
lea    0xf7e(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1090 <printf@plt>
lea    0xf3e(%rip),%rdi
mov    %r14d,%esi
jmp    178a <creature_encounter+0x54a>
cmp    $0x14,%r15d
jne    1799 <creature_encounter+0x559>
lea    0x17f5(%rip),%rdi
call   1050 <puts@plt>
mov    $0x6,%edi
call   1060 <d@plt>
mov    %eax,%ebx
mov    $0x6,%edi
call   1060 <d@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x6,%edi
call   1060 <d@plt>
add    %ebp,%eax
imul   $0x64,%eax,%esi
lea    0xb81(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1140 <magictableb@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x6,%edi
call   1060 <d@plt>
mov    %eax,%ebx
mov    $0x6,%edi
call   1060 <d@plt>
add    %eax,%ebx
mov    $0x6,%edi
call   1060 <d@plt>
add    %eax,%ebx
lea    0xb3c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x4,%edi
call   1060 <d@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1060 <d@plt>
add    %eax,%ebx
lea    0xb29(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1090 <printf@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x1651(%rip),%rdi
jmp    17cd <creature_encounter+0x58d>
lea    0x163d(%rip),%rdi
jmp    17cd <creature_encounter+0x58d>
lea    0x162a(%rip),%rdi
jmp    17cd <creature_encounter+0x58d>
lea    0x1618(%rip),%rdi
jmp    17cd <creature_encounter+0x58d>
lea    0x1603(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <puts@plt>
lea    0x15ca(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    17f8 <creature_encounter+0x5b8>
lea    0x1646(%rip),%rdi
call   1050 <puts@plt>
mov    0x37e1(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
lea    0x160d(%rip),%rdi
jmp    17f3 <creature_encounter+0x5b3>

LLVM IR (-O0):
@.str = [391 x i8] c"The duergar are traveling in a keelboat traversing the lake on business. The gray dwarves parley with the adventurers--or attack them if the opportunity looks ripe to capture them and sell them as slaves in Gracklstugh. If the duergar suprise all the characters, they turn invisible, making it appear that their boat is abandoned so as to lure the adventurers on board before they attack.\0A\0A\00"
@.str.1 = [56 x i8] c"The keelboat carries %d pounds of unrefined iron ore.\0A\0A\00"
@.str.2 = [69 x i8] c"The keelboat carries %d zurkhwood crates filled with mining tools.\0A\0A\00"
@.str.3 = [72 x i8] c"The keelboat carries %d zurkhwood crates filled with harvested fungi.\0A\0A\00"
@.str.4 = [55 x i8] c"The keelboat carries a locked iron chest containing:\0A\0A\00"
@.str.5 = [8 x i8] c"\09%d gp\0A\00"
@.str.6 = [21 x i8] c"Chest: AC 19, %d hp\0A\00"
@.str.7 = [22 x i8] c"Lock : AC 19, %d hp\0A\0A\00"
@.str.8 = [305 x i8] c"Nancy Plunk is a green hag who likes to taunt and lead travelers astray. She might instead bargain with the characters with her knowledge of the Darklake, especially if her life or freedom is at stake. If this encounter occurs again, it might be with one of her sisters, Maven Delve or Dame Spiderwort.\0A\0A\00"
@.str.9 = [307 x i8] c"They attack any party member in the water. Otherwise, they follow the party and wait for an opportunity to strike. If denied a meal for too long, they begin to gnaw on the hull of a boat or the underside of a raft, hoping to sink it (this tactic is ineffective against craft with a high damage threshold.\0A\0A\00"
@.str.10 = [216 x i8] c"The kuo-toa are traveling in a keelboat toward Sloopidoop (or away from the town if it has been attacked). If the characters have not been to Sloopidoop, the kuo-toa might try to capture them and bring them there.\0A\0A\00"
@.str.11 = [37 x i8] c"The keelboat carries %d empty nets\0A\0A\00"
@.str.12 = [66 x i8] c"The keelboat carries %d nets containing %d dead edible quippers\0A\0A\00"
@.str.13 = [60 x i8] c"The keelboat carries %d nets containing %d living stirges\0A\0A\00"
@.str.14 = [24 x i8] c"The keelboat carries:\0A\0A\00"
@.str.15 = [51 x i8] c"\09%d pieces of broken, barnacle-encrusted statuary\0A\00"
@.str.16 = [42 x i8] c"\09each worth 50 gp and weighing %d pounds\0A\00"
@.str.17 = [62 x i8] c"\09and each depicting a weird alien creature, a long-forgotten\0A\00"
@.str.18 = [29 x i8] c"\09god, or fragment thereof.\0A\0A\00"
@.str.19 = [254 x i8] c"These worshipers of Demogorgon have been driven into a frenxy by his arrival in the Underdark. They immediately attack, trying to capsize or wreck boats as they utter the war cry, \22Blood and salt for the Prince of the Demons!\22 in the Abyssal language.\0A\0A\00"
@.str.20 = [262 x i8] c"A merrow can use its action to capsize a bot or raft within 5 feet of it. Anyone in the boat can thwart the merrow by using a reaction to make a Strength check contested by the merrow's Strength check (+4). If the merrow wins the contest, the vessel capsizes.\0A\0A\00"
@.str.21 = [316 x i8] c"If the party is aware of the stirges clinging to the ceiling like bats, the characters can make a DC 13 group Dexterity (Stealth) check to slip past the stirges without disturbing them. If the group check succeeds, the stirges ignore the party. Otherwise, the stirges descend and attack the nearest party members.\0A\0A\00"
@.str.22 = [165 x i8] c"The swarm keeps pace with the characters attacking anyone in the water. If an hour passes and no meal has presented itself, the quippers stop following the party.\0A\0A\00"
@.str.23 = [134 x i8] c"Bound to some long-lost site beneath the surface of the water, this neutral evil elemental rises to attack when characters pass by.\0A\0A\00"
@.str.24 = [76 x i8] c"The water weird is guarding a sunken alter dedicated to a forgotten deity.\0A\00"
@.str.25 = [168 x i8] c"The water weird is guarding a sunken statue with 500 gp black pearls for eyes; a thief who removes one or both gems becomes the target of a contagion spell [PH 227].\0A\0A\00"
@.str.26 = [226 x i8] c"The character makes a DC 14 Constitution save three times--one per turn. If they fail all three, then they suffer for 7 days. If the make all three, then the spell ends. They are affected by the following natural disease:\0A\0A\00"
@.str.27 = [20 x i8] c"Blinding sickness\0A\0A\00"
@.str.28 = [14 x i8] c"Filth fever\0A\0A\00"
@.str.29 = [12 x i8] c"Flesh rot\0A\0A\00"
@.str.30 = [11 x i8] c"Mindfire\0A\0A\00"
@.str.31 = [10 x i8] c"Seizure\0A\0A\00"
@.str.32 = [13 x i8] c"Slimy doom\0A\0A\00"
@.str.33 = [32 x i8] c"Impossible contagion condition\0A\00"
@EXIT_FAILURE = global i32 0
@.str.34 = [98 x i8] c"The water weird is guarding a sunken, sealed, sarcophagus containing the following art objects:\0A\0A\00"
@.str.35 = [5 x i8] c"%d: \00"
@.str.36 = [43 x i8] c"Impossible water weird guarding situation\0A\00"
@.str.37 = [37 x i8] c"Impossible creature encounter of %d\0A\00"
define void @creature_encounter() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32 @d(i32 4)
store i32 %6, i32* %1
%7 = call i32 @d(i32 12)
store i32 %7, i32* %2
%8 = call i32 @d(i32 20)
store i32 %8, i32* %3
%9 = load i32, i32* %2
switch i32 %9, label %253 [
i32 1, label %10
i32 2, label %12
i32 3, label %17
i32 4, label %80
i32 5, label %83
i32 6, label %85
i32 7, label %85
i32 8, label %90
i32 9, label %188
i32 10, label %193
i32 11, label %201
i32 12, label %204
]
10: ; preds = %0
%11 = call i32 @aquatroll(i32 1)
br label %258
12: ; preds = %0
%13 = call i32 @d(i32 4)
%14 = call i32 @d(i32 4)
%15 = add nsw i32 %13, %14
%16 = call i32 @darkmantle(i32 %15)
br label %258
17: ; preds = %0
%18 = call i32 @d(i32 4)
%19 = add nsw i32 %18, 2
%20 = call i32 @duergar(i32 %19)
%21 = call i32 @niceprint(i8* getelementptr inbounds ([391 x i8], [391 x i8]* @.str, i64 0, i64 0))
%22 = load i32, i32* %3
%23 = icmp ult i32 10, %22
br i1 %23, label %24, label %31
24: ; preds = %17
%25 = load i32, i32* %3
%26 = icmp ult i32 %25, 14
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = call i32 @d(i32 20)
%29 = mul nsw i32 100, %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i32 %29)
br label %79
31: ; preds = %24, %17
%32 = load i32, i32* %3
%33 = icmp ult i32 13, %32
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = load i32, i32* %3
%36 = icmp ult i32 %35, 17
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = call i32 @d(i32 4)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0), i32 %38)
br label %78
40: ; preds = %34, %31
%41 = load i32, i32* %3
%42 = icmp ult i32 16, %41
br i1 %42, label %43, label %51
43: ; preds = %40
%44 = load i32, i32* %3
%45 = icmp ult i32 %44, 20
br i1 %45, label %46, label %51
46: ; preds = %43
%47 = call i32 @d(i32 4)
%48 = call i32 @d(i32 4)
%49 = add nsw i32 %47, %48
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.3, i64 0, i64 0), i32 %49)
br label %77
51: ; preds = %43, %40
%52 = load i32, i32* %3
%53 = icmp eq i32 %52, 20
br i1 %53, label %54, label %76
54: ; preds = %51
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%56 = call i32 @d(i32 6)
%57 = call i32 @d(i32 6)
%58 = add nsw i32 %56, %57
%59 = call i32 @d(i32 6)
%60 = add nsw i32 %58, %59
%61 = mul nsw i32 100, %60
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 %61)
%63 = call i32 @putchar(i8 signext 9)
%64 = call i32 (...) @magictableb()
%65 = call i32 @putchar(i8 signext 10)
%66 = call i32 @d(i32 6)
%67 = call i32 @d(i32 6)
%68 = add nsw i32 %66, %67
%69 = call i32 @d(i32 6)
%70 = add nsw i32 %68, %69
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %70)
%72 = call i32 @d(i32 4)
%73 = call i32 @d(i32 4)
%74 = add nsw i32 %72, %73
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %74)
br label %76
76: ; preds = %54, %51
br label %77
77: ; preds = %76, %46
br label %78
78: ; preds = %77, %37
br label %79
79: ; preds = %78, %27
br label %258
80: ; preds = %0
%81 = call i32 @niceprint(i8* getelementptr inbounds ([305 x i8], [305 x i8]* @.str.8, i64 0, i64 0))
%82 = call i32 @greenhag(i32 1)
br label %258
83: ; preds = %0
%84 = call i32 @grell(i32 1)
br label %258
85: ; preds = %0, %0
%86 = call i32 @d(i32 6)
%87 = add nsw i32 %86, 2
%88 = call i32 @ixitxachitl(i32 %87)
%89 = call i32 @niceprint(i8* getelementptr inbounds ([307 x i8], [307 x i8]* @.str.9, i64 0, i64 0))
br label %258
90: ; preds = %0
%91 = call i32 @d(i32 4)
%92 = call i32 @kuotoa(i32 %91)
%93 = call i32 @niceprint(i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.10, i64 0, i64 0))
%94 = load i32, i32* %3
%95 = icmp ult i32 15, %94
br i1 %95, label %96, label %132
96: ; preds = %90
%97 = load i32, i32* %3
%98 = icmp ult i32 %97, 18
br i1 %98, label %99, label %132
99: ; preds = %96
store i32 0, i32* %5
store i32 0, i32* %4
br label %100
100: ; preds = %118, %99
%101 = load i32, i32* %4
%102 = load i32, i32* %1
%103 = icmp ult i32 %101, %102
br i1 %103, label %104, label %121
104: ; preds = %100
%105 = call i32 @d(i32 2)
%106 = icmp eq i32 %105, 1
br i1 %106, label %107, label %108
107: ; preds = %104
br label %114
108: ; preds = %104
%109 = call i32 @d(i32 6)
%110 = call i32 @d(i32 6)
%111 = add nsw i32 %109, %110
%112 = call i32 @d(i32 6)
%113 = add nsw i32 %111, %112
br label %114
114: ; preds = %108, %107
%115 = phi i32 [ 0, %107 ], [ %113, %108 ]
%116 = load i32, i32* %5
%117 = add i32 %116, %115
store i32 %117, i32* %5
br label %118
118: ; preds = %114
%119 = load i32, i32* %4
%120 = add i32 %119, 1
store i32 %120, i32* %4
br label %100
121: ; preds = %100
%122 = load i32, i32* %5
%123 = icmp eq i32 %122, 0
br i1 %123, label %124, label %127
124: ; preds = %121
%125 = load i32, i32* %1
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i32 %125)
br label %131
127: ; preds = %121
%128 = load i32, i32* %1
%129 = load i32, i32* %5
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.12, i64 0, i64 0), i32 %128, i32 %129)
br label %131
131: ; preds = %127, %124
br label %187
132: ; preds = %96, %90
%133 = load i32, i32* %3
%134 = icmp ult i32 17, %133
br i1 %134, label %135, label %173
135: ; preds = %132
%136 = load i32, i32* %3
%137 = icmp ult i32 %136, 20
br i1 %137, label %138, label %173
138: ; preds = %135
store i32 0, i32* %5
store i32 0, i32* %4
br label %139
139: ; preds = %157, %138
%140 = load i32, i32* %4
%141 = load i32, i32* %1
%142 = icmp ult i32 %140, %141
br i1 %142, label %143, label %160
143: ; preds = %139
%144 = call i32 @d(i32 2)
%145 = icmp eq i32 %144, 1
br i1 %145, label %146, label %147
146: ; preds = %143
br label %153
147: ; preds = %143
%148 = call i32 @d(i32 6)
%149 = call i32 @d(i32 6)
%150 = add nsw i32 %148, %149
%151 = call i32 @d(i32 6)
%152 = add nsw i32 %150, %151
br label %153
153: ; preds = %147, %146
%154 = phi i32 [ 0, %146 ], [ %152, %147 ]
%155 = load i32, i32* %5
%156 = add i32 %155, %154
store i32 %156, i32* %5
br label %157
157: ; preds = %153
%158 = load i32, i32* %4
%159 = add i32 %158, 1
store i32 %159, i32* %4
br label %139
160: ; preds = %139
%161 = load i32, i32* %5
%162 = icmp eq i32 %161, 0
br i1 %162, label %163, label %166
163: ; preds = %160
%164 = load i32, i32* %1
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i32 %164)
br label %172
166: ; preds = %160
%167 = load i32, i32* %1
%168 = load i32, i32* %5
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.13, i64 0, i64 0), i32 %167, i32 %168)
%170 = load i32, i32* %5
%171 = call i32 @stirge(i32 %170)
br label %172
172: ; preds = %166, %163
br label %186
173: ; preds = %135, %132
%174 = load i32, i32* %3
%175 = icmp eq i32 %174, 20
br i1 %175, label %176, label %185
176: ; preds = %173
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0))
%178 = call i32 @d(i32 4)
%179 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.15, i64 0, i64 0), i32 %178)
%180 = call i32 @d(i32 4)
%181 = mul nsw i32 5, %180
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.16, i64 0, i64 0), i32 %181)
%183 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.17, i64 0, i64 0))
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.18, i64 0, i64 0))
br label %185
185: ; preds = %176, %173
br label %186
186: ; preds = %185, %172
br label %187
187: ; preds = %186, %131
br label %258
188: ; preds = %0
%189 = call i32 @d(i32 4)
%190 = call i32 @merrow(i32 %189)
%191 = call i32 @niceprint(i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str.19, i64 0, i64 0))
%192 = call i32 @niceprint(i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str.20, i64 0, i64 0))
br label %258
193: ; preds = %0
%194 = call i32 @d(i32 6)
%195 = call i32 @d(i32 6)
%196 = add nsw i32 %194, %195
%197 = call i32 @d(i32 6)
%198 = add nsw i32 %196, %197
%199 = call i32 @stirge(i32 %198)
%200 = call i32 @niceprint(i8* getelementptr inbounds ([316 x i8], [316 x i8]* @.str.21, i64 0, i64 0))
br label %258
201: ; preds = %0
%202 = call i32 @quipper(i32 1)
%203 = call i32 @niceprint(i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str.22, i64 0, i64 0))
br label %258
204: ; preds = %0
%205 = call i32 @waterweird(i32 1)
%206 = call i32 @niceprint(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.23, i64 0, i64 0))
%207 = call i32 @d(i32 3)
switch i32 %207, label %248 [
i32 1, label %208
i32 2, label %210
i32 3, label %231
]
208: ; preds = %204
%209 = call i32 @niceprint(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.24, i64 0, i64 0))
br label %252
210: ; preds = %204
%211 = call i32 @niceprint(i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str.25, i64 0, i64 0))
%212 = call i32 @niceprint(i8* getelementptr inbounds ([226 x i8], [226 x i8]* @.str.26, i64 0, i64 0))
%213 = call i32 @d(i32 6)
switch i32 %213, label %226 [
i32 1, label %214
i32 2, label %216
i32 3, label %218
i32 4, label %220
i32 5, label %222
i32 6, label %224
]
214: ; preds = %210
%215 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.27, i64 0, i64 0))
br label %230
216: ; preds = %210
%217 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i64 0, i64 0))
br label %230
218: ; preds = %210
%219 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.29, i64 0, i64 0))
br label %230
220: ; preds = %210
%221 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.30, i64 0, i64 0))
br label %230
222: ; preds = %210
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.31, i64 0, i64 0))
br label %230
224: ; preds = %210
%225 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.32, i64 0, i64 0))
br label %230
226: ; preds = %210
%227 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.33, i64 0, i64 0))
%228 = load i32, i32* @EXIT_FAILURE
%229 = call i32 @exit(i32 %228)
unreachable
230: ; preds = %224, %222, %220, %218, %216, %214
br label %252
231: ; preds = %204
%232 = call i32 @niceprint(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.34, i64 0, i64 0))
store i32 0, i32* %4
br label %233
233: ; preds = %242, %231
%234 = load i32, i32* %4
%235 = load i32, i32* %1
%236 = icmp ult i32 %234, %235
br i1 %236, label %237, label %245
237: ; preds = %233
%238 = load i32, i32* %4
%239 = add i32 %238, 1
%240 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.35, i64 0, i64 0), i32 %239)
%241 = call i32 (...) @art250()
br label %242
242: ; preds = %237
%243 = load i32, i32* %4
%244 = add i32 %243, 1
store i32 %244, i32* %4
br label %233
245: ; preds = %233
%246 = call i32 @putchar(i8 signext 10)
%247 = call i32 @mummy(i32 1)
br label %252
248: ; preds = %204
%249 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.36, i64 0, i64 0))
%250 = load i32, i32* @EXIT_FAILURE
%251 = call i32 @exit(i32 %250)
unreachable
252: ; preds = %245, %230, %208
br label %258
253: ; preds = %0
%254 = load i32, i32* %2
%255 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.37, i64 0, i64 0), i32 %254)
%256 = load i32, i32* @EXIT_FAILURE
%257 = call i32 @exit(i32 %256)
unreachable
258: ; preds = %252, %201, %193, %188, %187, %85, %83, %80, %79, %12, %10
ret void
}

LLVM IR (-O2):
@.str = [391 x i8] c"The duergar are traveling in a keelboat traversing the lake on business. The gray dwarves parley with the adventurers--or attack them if the opportunity looks ripe to capture them and sell them as slaves in Gracklstugh. If the duergar suprise all the characters, they turn invisible, making it appear that their boat is abandoned so as to lure the adventurers on board before they attack.\0A\0A\00"
@.str.1 = [56 x i8] c"The keelboat carries %d pounds of unrefined iron ore.\0A\0A\00"
@.str.2 = [69 x i8] c"The keelboat carries %d zurkhwood crates filled with mining tools.\0A\0A\00"
@.str.3 = [72 x i8] c"The keelboat carries %d zurkhwood crates filled with harvested fungi.\0A\0A\00"
@.str.5 = [8 x i8] c"\09%d gp\0A\00"
@.str.6 = [21 x i8] c"Chest: AC 19, %d hp\0A\00"
@.str.7 = [22 x i8] c"Lock : AC 19, %d hp\0A\0A\00"
@.str.8 = [305 x i8] c"Nancy Plunk is a green hag who likes to taunt and lead travelers astray. She might instead bargain with the characters with her knowledge of the Darklake, especially if her life or freedom is at stake. If this encounter occurs again, it might be with one of her sisters, Maven Delve or Dame Spiderwort.\0A\0A\00"
@.str.9 = [307 x i8] c"They attack any party member in the water. Otherwise, they follow the party and wait for an opportunity to strike. If denied a meal for too long, they begin to gnaw on the hull of a boat or the underside of a raft, hoping to sink it (this tactic is ineffective against craft with a high damage threshold.\0A\0A\00"
@.str.10 = [216 x i8] c"The kuo-toa are traveling in a keelboat toward Sloopidoop (or away from the town if it has been attacked). If the characters have not been to Sloopidoop, the kuo-toa might try to capture them and bring them there.\0A\0A\00"
@.str.11 = [37 x i8] c"The keelboat carries %d empty nets\0A\0A\00"
@.str.12 = [66 x i8] c"The keelboat carries %d nets containing %d dead edible quippers\0A\0A\00"
@.str.13 = [60 x i8] c"The keelboat carries %d nets containing %d living stirges\0A\0A\00"
@.str.15 = [51 x i8] c"\09%d pieces of broken, barnacle-encrusted statuary\0A\00"
@.str.16 = [42 x i8] c"\09each worth 50 gp and weighing %d pounds\0A\00"
@.str.19 = [254 x i8] c"These worshipers of Demogorgon have been driven into a frenxy by his arrival in the Underdark. They immediately attack, trying to capsize or wreck boats as they utter the war cry, \22Blood and salt for the Prince of the Demons!\22 in the Abyssal language.\0A\0A\00"
@.str.20 = [262 x i8] c"A merrow can use its action to capsize a bot or raft within 5 feet of it. Anyone in the boat can thwart the merrow by using a reaction to make a Strength check contested by the merrow's Strength check (+4). If the merrow wins the contest, the vessel capsizes.\0A\0A\00"
@.str.21 = [316 x i8] c"If the party is aware of the stirges clinging to the ceiling like bats, the characters can make a DC 13 group Dexterity (Stealth) check to slip past the stirges without disturbing them. If the group check succeeds, the stirges ignore the party. Otherwise, the stirges descend and attack the nearest party members.\0A\0A\00"
@.str.22 = [165 x i8] c"The swarm keeps pace with the characters attacking anyone in the water. If an hour passes and no meal has presented itself, the quippers stop following the party.\0A\0A\00"
@.str.23 = [134 x i8] c"Bound to some long-lost site beneath the surface of the water, this neutral evil elemental rises to attack when characters pass by.\0A\0A\00"
@.str.24 = [76 x i8] c"The water weird is guarding a sunken alter dedicated to a forgotten deity.\0A\00"
@.str.25 = [168 x i8] c"The water weird is guarding a sunken statue with 500 gp black pearls for eyes; a thief who removes one or both gems becomes the target of a contagion spell [PH 227].\0A\0A\00"
@.str.26 = [226 x i8] c"The character makes a DC 14 Constitution save three times--one per turn. If they fail all three, then they suffer for 7 days. If the make all three, then the spell ends. They are affected by the following natural disease:\0A\0A\00"
@EXIT_FAILURE = global i32 0
@.str.34 = [98 x i8] c"The water weird is guarding a sunken, sealed, sarcophagus containing the following art objects:\0A\0A\00"
@.str.35 = [5 x i8] c"%d: \00"
@.str.37 = [37 x i8] c"Impossible creature encounter of %d\0A\00"
@str = [12 x i8] c"Slimy doom\0A\00"
@str.38 = [9 x i8] c"Seizure\0A\00"
@str.39 = [10 x i8] c"Mindfire\0A\00"
@str.40 = [11 x i8] c"Flesh rot\0A\00"
@str.41 = [13 x i8] c"Filth fever\0A\00"
@str.42 = [19 x i8] c"Blinding sickness\0A\00"
@str.43 = [31 x i8] c"Impossible contagion condition\00"
@str.44 = [42 x i8] c"Impossible water weird guarding situation\00"
@str.45 = [23 x i8] c"The keelboat carries:\0A\00"
@str.46 = [61 x i8] c"\09and each depicting a weird alien creature, a long-forgotten\00"
@str.47 = [28 x i8] c"\09god, or fragment thereof.\0A\00"
@str.48 = [54 x i8] c"The keelboat carries a locked iron chest containing:\0A\00"
define void @creature_encounter() {
%1 = tail call i32 @d(i32 4)
%2 = tail call i32 @d(i32 12)
%3 = tail call i32 @d(i32 20)
switch i32 %2, label %193 [
i32 1, label %4
i32 2, label %6
i32 3, label %11
i32 4, label %60
i32 5, label %63
i32 6, label %65
i32 7, label %65
i32 8, label %70
i32 9, label %135
i32 10, label %140
i32 11, label %148
i32 12, label %151
]
4: ; preds = %0
%5 = tail call i32 @aquatroll(i32 1)
br label %197
6: ; preds = %0
%7 = tail call i32 @d(i32 4)
%8 = tail call i32 @d(i32 4)
%9 = add nsw i32 %8, %7
%10 = tail call i32 @darkmantle(i32 %9)
br label %197
11: ; preds = %0
%12 = tail call i32 @d(i32 4)
%13 = add nsw i32 %12, 2
%14 = tail call i32 @duergar(i32 %13)
%15 = tail call i32 @niceprint(i8* getelementptr inbounds ([391 x i8], [391 x i8]* @.str, i64 0, i64 0))
%16 = add i32 %3, -11
%17 = icmp ult i32 %16, 3
br i1 %17, label %18, label %22
18: ; preds = %11
%19 = tail call i32 @d(i32 20)
%20 = mul nsw i32 %19, 100
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %197
22: ; preds = %11
%23 = add i32 %3, -14
%24 = icmp ult i32 %23, 3
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = tail call i32 @d(i32 4)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0), i32 %26)
br label %197
28: ; preds = %22
%29 = add i32 %3, -17
%30 = icmp ult i32 %29, 3
br i1 %30, label %31, label %36
31: ; preds = %28
%32 = tail call i32 @d(i32 4)
%33 = tail call i32 @d(i32 4)
%34 = add nsw i32 %33, %32
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str.3, i64 0, i64 0), i32 %34)
br label %197
36: ; preds = %28
%37 = icmp eq i32 %3, 20
br i1 %37, label %38, label %197
38: ; preds = %36
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.48, i64 0, i64 0))
%40 = tail call i32 @d(i32 6)
%41 = tail call i32 @d(i32 6)
%42 = add nsw i32 %41, %40
%43 = tail call i32 @d(i32 6)
%44 = add nsw i32 %42, %43
%45 = mul nsw i32 %44, 100
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 %45)
%47 = tail call i32 @putchar(i8 signext 9)
%48 = tail call i32 (...) @magictableb()
%49 = tail call i32 @putchar(i8 signext 10)
%50 = tail call i32 @d(i32 6)
%51 = tail call i32 @d(i32 6)
%52 = add nsw i32 %51, %50
%53 = tail call i32 @d(i32 6)
%54 = add nsw i32 %52, %53
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %54)
%56 = tail call i32 @d(i32 4)
%57 = tail call i32 @d(i32 4)
%58 = add nsw i32 %57, %56
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %58)
br label %197
60: ; preds = %0
%61 = tail call i32 @niceprint(i8* getelementptr inbounds ([305 x i8], [305 x i8]* @.str.8, i64 0, i64 0))
%62 = tail call i32 @greenhag(i32 1)
br label %197
63: ; preds = %0
%64 = tail call i32 @grell(i32 1)
br label %197
65: ; preds = %0, %0
%66 = tail call i32 @d(i32 6)
%67 = add nsw i32 %66, 2
%68 = tail call i32 @ixitxachitl(i32 %67)
%69 = tail call i32 @niceprint(i8* getelementptr inbounds ([307 x i8], [307 x i8]* @.str.9, i64 0, i64 0))
br label %197
70: ; preds = %0
%71 = tail call i32 @d(i32 4)
%72 = tail call i32 @kuotoa(i32 %71)
%73 = tail call i32 @niceprint(i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.10, i64 0, i64 0))
%74 = and i32 %3, -2
switch i32 %74, label %124 [
i32 16, label %77
i32 18, label %75
]
75: ; preds = %70
%76 = icmp eq i32 %1, 0
br i1 %76, label %119, label %101
77: ; preds = %70
%78 = icmp eq i32 %1, 0
br i1 %78, label %97, label %79
79: ; preds = %77, %90
%80 = phi i32 [ %92, %90 ], [ 0, %77 ]
%81 = phi i32 [ %93, %90 ], [ 0, %77 ]
%82 = tail call i32 @d(i32 2)
%83 = icmp eq i32 %82, 1
br i1 %83, label %90, label %84
84: ; preds = %79
%85 = tail call i32 @d(i32 6)
%86 = tail call i32 @d(i32 6)
%87 = add nsw i32 %86, %85
%88 = tail call i32 @d(i32 6)
%89 = add nsw i32 %87, %88
br label %90
90: ; preds = %79, %84
%91 = phi i32 [ %89, %84 ], [ 0, %79 ]
%92 = add i32 %91, %80
%93 = add nuw i32 %81, 1
%94 = icmp eq i32 %93, %1
br i1 %94, label %95, label %79
95: ; preds = %90
%96 = icmp eq i32 %92, 0
br i1 %96, label %97, label %99
97: ; preds = %77, %95
%98 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i32 %1)
br label %197
99: ; preds = %95
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.12, i64 0, i64 0), i32 %1, i32 %92)
br label %197
101: ; preds = %75, %112
%102 = phi i32 [ %114, %112 ], [ 0, %75 ]
%103 = phi i32 [ %115, %112 ], [ 0, %75 ]
%104 = tail call i32 @d(i32 2)
%105 = icmp eq i32 %104, 1
br i1 %105, label %112, label %106
106: ; preds = %101
%107 = tail call i32 @d(i32 6)
%108 = tail call i32 @d(i32 6)
%109 = add nsw i32 %108, %107
%110 = tail call i32 @d(i32 6)
%111 = add nsw i32 %109, %110
br label %112
112: ; preds = %101, %106
%113 = phi i32 [ %111, %106 ], [ 0, %101 ]
%114 = add i32 %113, %102
%115 = add nuw i32 %103, 1
%116 = icmp eq i32 %115, %1
br i1 %116, label %117, label %101
117: ; preds = %112
%118 = icmp eq i32 %114, 0
br i1 %118, label %119, label %121
119: ; preds = %75, %117
%120 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i32 %1)
br label %197
121: ; preds = %117
%122 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.13, i64 0, i64 0), i32 %1, i32 %114)
%123 = tail call i32 @stirge(i32 %114)
br label %197
124: ; preds = %70
%125 = icmp eq i32 %3, 20
br i1 %125, label %126, label %197
126: ; preds = %124
%127 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.45, i64 0, i64 0))
%128 = tail call i32 @d(i32 4)
%129 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.15, i64 0, i64 0), i32 %128)
%130 = tail call i32 @d(i32 4)
%131 = mul nsw i32 %130, 5
%132 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.16, i64 0, i64 0), i32 %131)
%133 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.46, i64 0, i64 0))
%134 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.47, i64 0, i64 0))
br label %197
135: ; preds = %0
%136 = tail call i32 @d(i32 4)
%137 = tail call i32 @merrow(i32 %136)
%138 = tail call i32 @niceprint(i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str.19, i64 0, i64 0))
%139 = tail call i32 @niceprint(i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str.20, i64 0, i64 0))
br label %197
140: ; preds = %0
%141 = tail call i32 @d(i32 6)
%142 = tail call i32 @d(i32 6)
%143 = add nsw i32 %142, %141
%144 = tail call i32 @d(i32 6)
%145 = add nsw i32 %143, %144
%146 = tail call i32 @stirge(i32 %145)
%147 = tail call i32 @niceprint(i8* getelementptr inbounds ([316 x i8], [316 x i8]* @.str.21, i64 0, i64 0))
br label %197
148: ; preds = %0
%149 = tail call i32 @quipper(i32 1)
%150 = tail call i32 @niceprint(i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str.22, i64 0, i64 0))
br label %197
151: ; preds = %0
%152 = tail call i32 @waterweird(i32 1)
%153 = tail call i32 @niceprint(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.23, i64 0, i64 0))
%154 = tail call i32 @d(i32 3)
switch i32 %154, label %189 [
i32 1, label %155
i32 2, label %157
i32 3, label %177
]
155: ; preds = %151
%156 = tail call i32 @niceprint(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.24, i64 0, i64 0))
br label %197
157: ; preds = %151
%158 = tail call i32 @niceprint(i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str.25, i64 0, i64 0))
%159 = tail call i32 @niceprint(i8* getelementptr inbounds ([226 x i8], [226 x i8]* @.str.26, i64 0, i64 0))
%160 = tail call i32 @d(i32 6)
switch i32 %160, label %173 [
i32 1, label %161
i32 2, label %163
i32 3, label %165
i32 4, label %167
i32 5, label %169
i32 6, label %171
]
161: ; preds = %157
%162 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.42, i64 0, i64 0))
br label %197
163: ; preds = %157
%164 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.41, i64 0, i64 0))
br label %197
165: ; preds = %157
%166 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.40, i64 0, i64 0))
br label %197
167: ; preds = %157
%168 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.39, i64 0, i64 0))
br label %197
169: ; preds = %157
%170 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.38, i64 0, i64 0))
br label %197
171: ; preds = %157
%172 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %197
173: ; preds = %157
%174 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.43, i64 0, i64 0))
%175 = load i32, i32* @EXIT_FAILURE
%176 = tail call i32 @exit(i32 %175)
unreachable
177: ; preds = %151
%178 = tail call i32 @niceprint(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.34, i64 0, i64 0))
%179 = icmp eq i32 %1, 0
br i1 %179, label %186, label %180
180: ; preds = %177, %180
%181 = phi i32 [ %182, %180 ], [ 0, %177 ]
%182 = add nuw i32 %181, 1
%183 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.35, i64 0, i64 0), i32 %182)
%184 = tail call i32 (...) @art250()
%185 = icmp eq i32 %182, %1
br i1 %185, label %186, label %180
186: ; preds = %180, %177
%187 = tail call i32 @putchar(i8 signext 10)
%188 = tail call i32 @mummy(i32 1)
br label %197
189: ; preds = %151
%190 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.44, i64 0, i64 0))
%191 = load i32, i32* @EXIT_FAILURE
%192 = tail call i32 @exit(i32 %191)
unreachable
193: ; preds = %0
%194 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.37, i64 0, i64 0), i32 %2)
%195 = load i32, i32* @EXIT_FAILURE
%196 = tail call i32 @exit(i32 %195)
unreachable
197: ; preds = %155, %186, %171, %169, %167, %165, %163, %161, %99, %97, %124, %126, %119, %121, %18, %31, %38, %36, %25, %148, %140, %135, %65, %63, %60, %6, %4
ret void
}