#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 d(int);
int /*<<< orphan*/ nicename(unsigned int, char *, char *);
int /*<<< orphan*/ niceprint(char *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ putchar(char);
void darkmantle(unsigned count) {
  int i;
  nicename(count, "darkmantle", "MM 46");
  for (i = 0; i < count; i++) {
    printf("%d: %d hp", i + 1, d(6) + d(6) + d(6) + d(6) + d(6) + 5);
    (void)putchar('\n');
  }
  (void)putchar('\n');
  niceprint("A creature in a boat or raft that tries and fails to detach a "
            "darkmantle from itself "
            "or another creature must succeed on a DC 10 Dexterity saving "
            "throw or fall out of the "
            "vessel and into the water.\n\n");
}


x86 assembly (clang, -O0):
<darkmantle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xe9b(%rip),%rsi
lea    0xe9f(%rip),%rdx
call   1060 <nicename@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    120f <darkmantle+0xbf>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x6,%edi
call   1040 <d@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x6,%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    $0x6,%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x6,%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x6,%edi
call   1040 <d@plt>
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%esi
add    %eax,%edx
add    $0x5,%edx
lea    0xe1f(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1178 <darkmantle+0x28>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdfb(%rip),%rdi
call   1070 <niceprint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<darkmantle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,%r14d
lea    0xe9b(%rip),%rsi
lea    0xe9f(%rip),%rdx
call   1060 <nicename@plt>
test   %r14d,%r14d
je     1207 <darkmantle+0xb7>
neg    %r14d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x6,%edi
call   1040 <d@plt>
mov    %eax,%r12d
mov    $0x6,%edi
call   1040 <d@plt>
mov    %eax,%ebp
mov    $0x6,%edi
call   1040 <d@plt>
mov    %eax,%r13d
mov    $0x6,%edi
call   1040 <d@plt>
mov    %eax,%r15d
mov    $0x6,%edi
call   1040 <d@plt>
add    %r12d,%ebp
add    %r13d,%ebp
add    %r15d,%ebp
lea    (%rax,%rbp,1),%edx
add    $0x5,%edx
lea    0xe2e(%rip),%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1190 <darkmantle+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe03(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <niceprint@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"darkmantle\00"
@.str.1 = [6 x i8] c"MM 46\00"
@.str.2 = [10 x i8] c"%d: %d hp\00"
@.str.3 = [200 x i8] c"A creature in a boat or raft that tries and fails to detach a darkmantle from itself or another creature must succeed on a DC 10 Dexterity saving throw or fall out of the vessel and into the water.\0A\0A\00"
define void @darkmantle(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @nicename(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %6
6: ; preds = %25, %1
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %28
10: ; preds = %6
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
%13 = call i32 @d(i32 6)
%14 = call i32 @d(i32 6)
%15 = add nsw i32 %13, %14
%16 = call i32 @d(i32 6)
%17 = add nsw i32 %15, %16
%18 = call i32 @d(i32 6)
%19 = add nsw i32 %17, %18
%20 = call i32 @d(i32 6)
%21 = add nsw i32 %19, %20
%22 = add nsw i32 %21, 5
%23 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %22)
%24 = call i32 @putchar(i8 signext 10)
br label %25
25: ; preds = %10
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %6
28: ; preds = %6
%29 = call i32 @putchar(i8 signext 10)
%30 = call i32 @niceprint(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"darkmantle\00"
@.str.1 = [6 x i8] c"MM 46\00"
@.str.2 = [10 x i8] c"%d: %d hp\00"
@.str.3 = [200 x i8] c"A creature in a boat or raft that tries and fails to detach a darkmantle from itself or another creature must succeed on a DC 10 Dexterity saving throw or fall out of the vessel and into the water.\0A\0A\00"
define void @darkmantle(i32 %0) {
%2 = tail call i32 @nicename(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %0, 0
br i1 %3, label %20, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw i32 %5, 1
%7 = tail call i32 @d(i32 6)
%8 = tail call i32 @d(i32 6)
%9 = tail call i32 @d(i32 6)
%10 = tail call i32 @d(i32 6)
%11 = tail call i32 @d(i32 6)
%12 = add i32 %7, 5
%13 = add i32 %12, %8
%14 = add i32 %13, %9
%15 = add i32 %14, %10
%16 = add i32 %15, %11
%17 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %16)
%18 = tail call i32 @putchar(i8 signext 10)
%19 = icmp eq i32 %6, %0
br i1 %19, label %20, label %4
20: ; preds = %4, %1
%21 = tail call i32 @putchar(i8 signext 10)
%22 = tail call i32 @niceprint(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str.3, i64 0, i64 0))
ret void
}