#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*/ d(int);
int /*<<< orphan*/ drow(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ myconid(int /*<<< orphan*/);
int /*<<< orphan*/ niceprint(char *);
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ shielddwarf(int /*<<< orphan*/);
void scouts(unsigned d6) {
  switch (d6) {
  case 1:
  case 2:
    niceprint(
        "A drow scount spots the party.  He will attempt to avoid "
        "notice and take away information regarding the group's location.\n\n");
    drow(1);
    break;
  case 3:
  case 4:
    niceprint(
        "The party encounters adult myconid scouts. They are indifferent "
        "towards the party and unwilling to discuss their mission or their "
        "traels with the adventurers.\n\n");
    myconid(d(4));
    break;
  case 5:
  case 6:
    niceprint(
        "The party encounters shield dwarfs who are friendly. They are willing "
        "to give the party a day or two's worth of food and water "
        "rations.\n\n");
    shielddwarf(d(6));
    break;
  default:
    printf("Impossible scouts encounter of %d\n", d6);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<scouts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     11ba <scouts+0x4a>
jmp    1192 <scouts+0x22>
mov    -0x8(%rbp),%eax
add    $0xfffffffd,%eax
sub    $0x2,%eax
jb     11d5 <scouts+0x65>
jmp    11a6 <scouts+0x36>
mov    -0x8(%rbp),%eax
add    $0xfffffffb,%eax
sub    $0x2,%eax
jb     11f7 <scouts+0x87>
jmp    1219 <scouts+0xa9>
lea    0xe3f(%rip),%rdi
call   1070 <niceprint@plt>
mov    $0x1,%edi
call   1040 <drow@plt>
jmp    1236 <scouts+0xc6>
lea    0xea0(%rip),%rdi
call   1070 <niceprint@plt>
mov    $0x4,%edi
call   1030 <d@plt>
mov    %eax,%edi
call   1060 <myconid@plt>
jmp    1236 <scouts+0xc6>
lea    0xf1f(%rip),%rdi
call   1070 <niceprint@plt>
mov    $0x6,%edi
call   1030 <d@plt>
mov    %eax,%edi
call   1090 <shielddwarf@plt>
jmp    1236 <scouts+0xc6>
mov    -0x4(%rbp),%esi
lea    0xf84(%rip),%rdi
call   1050 <printf@plt>
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scouts>:
push   %rax
mov    %edi,%esi
cmp    $0x6,%edi
ja     11e9 <scouts+0x79>
mov    $0x6,%eax
bt     %esi,%eax
jb     11b4 <scouts+0x44>
mov    $0x18,%eax
bt     %esi,%eax
jb     11cb <scouts+0x5b>
mov    $0x60,%eax
bt     %esi,%eax
jae    11e9 <scouts+0x79>
lea    0xf80(%rip),%rdi
call   1070 <niceprint@plt>
mov    $0x6,%edi
call   1030 <d@plt>
mov    %eax,%edi
pop    %rax
jmp    1090 <shielddwarf@plt>
lea    0xe45(%rip),%rdi
call   1070 <niceprint@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <drow@plt>
lea    0xeaa(%rip),%rdi
call   1070 <niceprint@plt>
mov    $0x4,%edi
call   1030 <d@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <myconid@plt>
lea    0xfb7(%rip),%rdi
call   1050 <printf@plt>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [124 x i8] c"A drow scount spots the party. He will attempt to avoid notice and take away information regarding the group's location.\0A\0A\00"
@.str.1 = [161 x i8] c"The party encounters adult myconid scouts. They are indifferent towards the party and unwilling to discuss their mission or their traels with the adventurers.\0A\0A\00"
@.str.2 = [138 x i8] c"The party encounters shield dwarfs who are friendly. They are willing to give the party a day or two's worth of food and water rations.\0A\0A\00"
@.str.3 = [35 x i8] c"Impossible scouts encounter of %d\0A\00"
@EXIT_FAILURE = global i32 0
define void @scouts(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %15 [
i32 1, label %4
i32 2, label %4
i32 3, label %7
i32 4, label %7
i32 5, label %11
i32 6, label %11
]
4: ; preds = %1, %1
%5 = call i32 @niceprint(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @drow(i32 1)
br label %20
7: ; preds = %1, %1
%8 = call i32 @niceprint(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @d(i32 4)
%10 = call i32 @myconid(i32 %9)
br label %20
11: ; preds = %1, %1
%12 = call i32 @niceprint(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @d(i32 6)
%14 = call i32 @shielddwarf(i32 %13)
br label %20
15: ; preds = %1
%16 = load i32, i32* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %11, %7, %4
ret void
}

LLVM IR (-O2):
@.str = [124 x i8] c"A drow scount spots the party. He will attempt to avoid notice and take away information regarding the group's location.\0A\0A\00"
@.str.1 = [161 x i8] c"The party encounters adult myconid scouts. They are indifferent towards the party and unwilling to discuss their mission or their traels with the adventurers.\0A\0A\00"
@.str.2 = [138 x i8] c"The party encounters shield dwarfs who are friendly. They are willing to give the party a day or two's worth of food and water rations.\0A\0A\00"
@.str.3 = [35 x i8] c"Impossible scouts encounter of %d\0A\00"
@EXIT_FAILURE = global i32 0
define void @scouts(i32 %0) {
switch i32 %0, label %13 [
i32 1, label %2
i32 2, label %2
i32 3, label %5
i32 4, label %5
i32 5, label %9
i32 6, label %9
]
2: ; preds = %1, %1
%3 = tail call i32 @niceprint(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @drow(i32 1)
br label %17
5: ; preds = %1, %1
%6 = tail call i32 @niceprint(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @d(i32 4)
%8 = tail call i32 @myconid(i32 %7)
br label %17
9: ; preds = %1, %1
%10 = tail call i32 @niceprint(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.2, i64 0, i64 0))
%11 = tail call i32 @d(i32 6)
%12 = tail call i32 @shielddwarf(i32 %11)
br label %17
13: ; preds = %1
%14 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %0)
%15 = load i32, i32* @EXIT_FAILURE
%16 = tail call i32 @exit(i32 %15)
unreachable
17: ; preds = %9, %5, %2
ret void
}