#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 */
unsigned int d(int);
int /*<<< orphan*/ niceprint(char *);
void indefinitemadness(void) {
  unsigned d100;
  d100 = d(100);
  niceprint(
      "The creature is afflicted by the following indeffinite madness:\n\n");
  if (d100 < 16)
    niceprint("\"Being drunk keeps me sane.\"\n\n");
  else if (d100 < 26)
    niceprint("\"I keep whatever I find.\"\n\n");
  else if (d100 < 31)
    niceprint("\"I try to become more like someone else I know--adopting his "
              "or her style of dress, mannerisms, and name.\"\n\n");
  else if (d100 < 36)
    niceprint("\"I must bend the truth, exaggerate, or outright lie to be "
              "interesting to other people.\"\n\n");
  else if (d100 < 46)
    niceprint("\"Achieving my goal is the only thing of interest to me, and "
              "I'll ignore everything else to pursue it.\"\n\n");
  else if (d100 < 51)
    niceprint("\"I find it hard to care about anything that goes on around "
              "me.\"\n\n");
  else if (d100 < 56)
    niceprint("\"I don't like the way people judge me all the time.\"\n\n");
  else if (d100 < 71)
    niceprint("\"I am the smartest, wisest, strongest, fastest, and most "
              "beautiful person I know.\"\n\n");
  else if (d100 < 81)
    niceprint("\"I am convinced that powerful enemies are hunting me, and "
              "their agents are everywhere I go. I am sure they're watching me "
              "all the time.\"\n\n");
  else if (d100 < 86)
    niceprint("\"There's only one person I can trust. And only I can see this "
              "special friend.\"\n\n");
  else if (d100 < 96)
    niceprint("\"I can't take anything seriously. The more serious the "
              "situation, the funnier I find it.\"\n\n");
  else
    niceprint("\"I've discoverd that I really like killing people.\"\n\n");
}


x86 assembly (clang, -O0):
<indefinitemadness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1030 <d@plt>
mov    %eax,-0x4(%rbp)
lea    0xec4(%rip),%rdi
call   1040 <niceprint@plt>
cmpl   $0x10,-0x4(%rbp)
jae    115c <indefinitemadness+0x3c>
lea    0xef0(%rip),%rdi
call   1040 <niceprint@plt>
jmp    12a8 <indefinitemadness+0x188>
cmpl   $0x1a,-0x4(%rbp)
jae    1177 <indefinitemadness+0x57>
lea    0xef4(%rip),%rdi
call   1040 <niceprint@plt>
jmp    12a3 <indefinitemadness+0x183>
cmpl   $0x1f,-0x4(%rbp)
jae    1192 <indefinitemadness+0x72>
lea    0xef5(%rip),%rdi
call   1040 <niceprint@plt>
jmp    129e <indefinitemadness+0x17e>
cmpl   $0x24,-0x4(%rbp)
jae    11ad <indefinitemadness+0x8d>
lea    0xf47(%rip),%rdi
call   1040 <niceprint@plt>
jmp    1299 <indefinitemadness+0x179>
cmpl   $0x2e,-0x4(%rbp)
jae    11c8 <indefinitemadness+0xa8>
lea    0xf86(%rip),%rdi
call   1040 <niceprint@plt>
jmp    1294 <indefinitemadness+0x174>
cmpl   $0x33,-0x4(%rbp)
jae    11e3 <indefinitemadness+0xc3>
lea    0xfd4(%rip),%rdi
call   1040 <niceprint@plt>
jmp    128f <indefinitemadness+0x16f>
cmpl   $0x38,-0x4(%rbp)
jae    11fe <indefinitemadness+0xde>
lea    0xffb(%rip),%rdi
call   1040 <niceprint@plt>
jmp    128a <indefinitemadness+0x16a>
cmpl   $0x47,-0x4(%rbp)
jae    1219 <indefinitemadness+0xf9>
lea    0x1017(%rip),%rdi
call   1040 <niceprint@plt>
jmp    1285 <indefinitemadness+0x165>
cmpl   $0x51,-0x4(%rbp)
jae    1234 <indefinitemadness+0x114>
lea    0x1051(%rip),%rdi
call   1040 <niceprint@plt>
jmp    1280 <indefinitemadness+0x160>
cmpl   $0x56,-0x4(%rbp)
jae    124f <indefinitemadness+0x12f>
lea    0x10c1(%rip),%rdi
call   1040 <niceprint@plt>
jmp    127b <indefinitemadness+0x15b>
cmpl   $0x60,-0x4(%rbp)
jae    126a <indefinitemadness+0x14a>
lea    0x10f7(%rip),%rdi
call   1040 <niceprint@plt>
jmp    1276 <indefinitemadness+0x156>
lea    0x1142(%rip),%rdi
call   1040 <niceprint@plt>
jmp    127b <indefinitemadness+0x15b>
jmp    1280 <indefinitemadness+0x160>
jmp    1285 <indefinitemadness+0x165>
jmp    128a <indefinitemadness+0x16a>
jmp    128f <indefinitemadness+0x16f>
jmp    1294 <indefinitemadness+0x174>
jmp    1299 <indefinitemadness+0x179>
jmp    129e <indefinitemadness+0x17e>
jmp    12a3 <indefinitemadness+0x183>
jmp    12a8 <indefinitemadness+0x188>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indefinitemadness>:
push   %rbx
mov    $0x64,%edi
call   1030 <d@plt>
mov    %eax,%ebx
lea    0xecc(%rip),%rdi
call   1040 <niceprint@plt>
cmp    $0x10,%ebx
jae    114b <indefinitemadness+0x2b>
lea    0xefd(%rip),%rdi
pop    %rbx
jmp    1040 <niceprint@plt>
cmp    $0x1a,%ebx
jae    115d <indefinitemadness+0x3d>
lea    0xf0a(%rip),%rdi
pop    %rbx
jmp    1040 <niceprint@plt>
cmp    $0x1f,%ebx
jae    116f <indefinitemadness+0x4f>
lea    0xf14(%rip),%rdi
pop    %rbx
jmp    1040 <niceprint@plt>
cmp    $0x24,%ebx
jae    1181 <indefinitemadness+0x61>
lea    0xf6f(%rip),%rdi
pop    %rbx
jmp    1040 <niceprint@plt>
cmp    $0x2e,%ebx
jae    1193 <indefinitemadness+0x73>
lea    0xfb7(%rip),%rdi
pop    %rbx
jmp    1040 <niceprint@plt>
cmp    $0x33,%ebx
jae    11a5 <indefinitemadness+0x85>
lea    0x100e(%rip),%rdi
pop    %rbx
jmp    1040 <niceprint@plt>
cmp    $0x38,%ebx
jae    11b7 <indefinitemadness+0x97>
lea    0x103e(%rip),%rdi
pop    %rbx
jmp    1040 <niceprint@plt>
cmp    $0x47,%ebx
jae    11c9 <indefinitemadness+0xa9>
lea    0x1063(%rip),%rdi
pop    %rbx
jmp    1040 <niceprint@plt>
cmp    $0x51,%ebx
jae    11db <indefinitemadness+0xbb>
lea    0x10a6(%rip),%rdi
pop    %rbx
jmp    1040 <niceprint@plt>
cmp    $0x56,%ebx
jae    11ed <indefinitemadness+0xcd>
lea    0x111f(%rip),%rdi
pop    %rbx
jmp    1040 <niceprint@plt>
cmp    $0x60,%ebx
lea    0x1160(%rip),%rax
lea    0x11b5(%rip),%rdi
cmovb  %rax,%rdi
pop    %rbx
jmp    1040 <niceprint@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"The creature is afflicted by the following indeffinite madness:\0A\0A\00"
@.str.1 = [31 x i8] c"\22Being drunk keeps me sane.\22\0A\0A\00"
@.str.2 = [28 x i8] c"\22I keep whatever I find.\22\0A\0A\00"
@.str.3 = [109 x i8] c"\22I try to become more like someone else I know--adopting his or her style of dress, mannerisms, and name.\22\0A\0A\00"
@.str.4 = [90 x i8] c"\22I must bend the truth, exaggerate, or outright lie to be interesting to other people.\22\0A\0A\00"
@.str.5 = [105 x i8] c"\22Achieving my goal is the only thing of interest to me, and I'll ignore everything else to pursue it.\22\0A\0A\00"
@.str.6 = [66 x i8] c"\22I find it hard to care about anything that goes on around me.\22\0A\0A\00"
@.str.7 = [55 x i8] c"\22I don't like the way people judge me all the time.\22\0A\0A\00"
@.str.8 = [85 x i8] c"\22I am the smartest, wisest, strongest, fastest, and most beautiful person I know.\22\0A\0A\00"
@.str.9 = [139 x i8] c"\22I am convinced that powerful enemies are hunting me, and their agents are everywhere I go. I am sure they're watching me all the time.\22\0A\0A\00"
@.str.10 = [81 x i8] c"\22There's only one person I can trust. And only I can see this special friend.\22\0A\0A\00"
@.str.11 = [92 x i8] c"\22I can't take anything seriously. The more serious the situation, the funnier I find it.\22\0A\0A\00"
@.str.12 = [54 x i8] c"\22I've discoverd that I really like killing people.\22\0A\0A\00"
define void @indefinitemadness() {
%1 = alloca i32
%2 = call i32 @d(i32 100)
store i32 %2, i32* %1
%3 = call i32 @niceprint(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
%5 = icmp ult i32 %4, 16
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @niceprint(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %70
8: ; preds = %0
%9 = load i32, i32* %1
%10 = icmp ult i32 %9, 26
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @niceprint(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %69
13: ; preds = %8
%14 = load i32, i32* %1
%15 = icmp ult i32 %14, 31
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @niceprint(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str.3, i64 0, i64 0))
br label %68
18: ; preds = %13
%19 = load i32, i32* %1
%20 = icmp ult i32 %19, 36
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @niceprint(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.4, i64 0, i64 0))
br label %67
23: ; preds = %18
%24 = load i32, i32* %1
%25 = icmp ult i32 %24, 46
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @niceprint(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str.5, i64 0, i64 0))
br label %66
28: ; preds = %23
%29 = load i32, i32* %1
%30 = icmp ult i32 %29, 51
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @niceprint(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.6, i64 0, i64 0))
br label %65
33: ; preds = %28
%34 = load i32, i32* %1
%35 = icmp ult i32 %34, 56
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @niceprint(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
br label %64
38: ; preds = %33
%39 = load i32, i32* %1
%40 = icmp ult i32 %39, 71
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 @niceprint(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.8, i64 0, i64 0))
br label %63
43: ; preds = %38
%44 = load i32, i32* %1
%45 = icmp ult i32 %44, 81
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = call i32 @niceprint(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.9, i64 0, i64 0))
br label %62
48: ; preds = %43
%49 = load i32, i32* %1
%50 = icmp ult i32 %49, 86
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 @niceprint(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.10, i64 0, i64 0))
br label %61
53: ; preds = %48
%54 = load i32, i32* %1
%55 = icmp ult i32 %54, 96
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 @niceprint(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.11, i64 0, i64 0))
br label %60
58: ; preds = %53
%59 = call i32 @niceprint(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0))
br label %60
60: ; preds = %58, %56
br label %61
61: ; preds = %60, %51
br label %62
62: ; preds = %61, %46
br label %63
63: ; preds = %62, %41
br label %64
64: ; preds = %63, %36
br label %65
65: ; preds = %64, %31
br label %66
66: ; preds = %65, %26
br label %67
67: ; preds = %66, %21
br label %68
68: ; preds = %67, %16
br label %69
69: ; preds = %68, %11
br label %70
70: ; preds = %69, %6
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"The creature is afflicted by the following indeffinite madness:\0A\0A\00"
@.str.1 = [31 x i8] c"\22Being drunk keeps me sane.\22\0A\0A\00"
@.str.2 = [28 x i8] c"\22I keep whatever I find.\22\0A\0A\00"
@.str.3 = [109 x i8] c"\22I try to become more like someone else I know--adopting his or her style of dress, mannerisms, and name.\22\0A\0A\00"
@.str.4 = [90 x i8] c"\22I must bend the truth, exaggerate, or outright lie to be interesting to other people.\22\0A\0A\00"
@.str.5 = [105 x i8] c"\22Achieving my goal is the only thing of interest to me, and I'll ignore everything else to pursue it.\22\0A\0A\00"
@.str.6 = [66 x i8] c"\22I find it hard to care about anything that goes on around me.\22\0A\0A\00"
@.str.7 = [55 x i8] c"\22I don't like the way people judge me all the time.\22\0A\0A\00"
@.str.8 = [85 x i8] c"\22I am the smartest, wisest, strongest, fastest, and most beautiful person I know.\22\0A\0A\00"
@.str.9 = [139 x i8] c"\22I am convinced that powerful enemies are hunting me, and their agents are everywhere I go. I am sure they're watching me all the time.\22\0A\0A\00"
@.str.10 = [81 x i8] c"\22There's only one person I can trust. And only I can see this special friend.\22\0A\0A\00"
@.str.11 = [92 x i8] c"\22I can't take anything seriously. The more serious the situation, the funnier I find it.\22\0A\0A\00"
@.str.12 = [54 x i8] c"\22I've discoverd that I really like killing people.\22\0A\0A\00"
define void @indefinitemadness() {
%1 = tail call i32 @d(i32 100)
%2 = tail call i32 @niceprint(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%3 = icmp ult i32 %1, 16
br i1 %3, label %25, label %4
4: ; preds = %0
%5 = icmp ult i32 %1, 26
br i1 %5, label %25, label %6
6: ; preds = %4
%7 = icmp ult i32 %1, 31
br i1 %7, label %25, label %8
8: ; preds = %6
%9 = icmp ult i32 %1, 36
br i1 %9, label %25, label %10
10: ; preds = %8
%11 = icmp ult i32 %1, 46
br i1 %11, label %25, label %12
12: ; preds = %10
%13 = icmp ult i32 %1, 51
br i1 %13, label %25, label %14
14: ; preds = %12
%15 = icmp ult i32 %1, 56
br i1 %15, label %25, label %16
16: ; preds = %14
%17 = icmp ult i32 %1, 71
br i1 %17, label %25, label %18
18: ; preds = %16
%19 = icmp ult i32 %1, 81
br i1 %19, label %25, label %20
20: ; preds = %18
%21 = icmp ult i32 %1, 86
br i1 %21, label %25, label %22
22: ; preds = %20
%23 = icmp ult i32 %1, 96
%24 = select i1 %23, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.12, i64 0, i64 0)
br label %25
25: ; preds = %22, %20, %18, %16, %14, %12, %10, %8, %6, %4, %0
%26 = phi i8* [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), %0 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([109 x i8], [109 x i8]* @.str.3, i64 0, i64 0), %6 ], [ getelementptr inbounds ([90 x i8], [90 x i8]* @.str.4, i64 0, i64 0), %8 ], [ getelementptr inbounds ([105 x i8], [105 x i8]* @.str.5, i64 0, i64 0), %10 ], [ getelementptr inbounds ([66 x i8], [66 x i8]* @.str.6, i64 0, i64 0), %12 ], [ getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0), %14 ], [ getelementptr inbounds ([85 x i8], [85 x i8]* @.str.8, i64 0, i64 0), %16 ], [ getelementptr inbounds ([139 x i8], [139 x i8]* @.str.9, i64 0, i64 0), %18 ], [ getelementptr inbounds ([81 x i8], [81 x i8]* @.str.10, i64 0, i64 0), %20 ], [ %24, %22 ]
%27 = tail call i32 @niceprint(i8* %26)
ret void
}