#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 aquatroll(unsigned count) {
  int i;
  nicename(count, "aquatic troll", "MM 291");
  niceprint("Aquatic trolls have the same abilities as normal trolls, but can "
            "also breath water and "
            "has a swimming speed of 30 feet.\n\n");
  for (i = 0; i < count; i++) {
    printf("%d: %d hp", i + 1,
           d(10) + d(10) + d(10) + d(10) + d(10) + d(10) + d(10) + d(10) +
               d(10) + d(10) + 40);
    (void)putchar('\n');
  }
  (void)putchar('\n');
}


x86 assembly (clang, -O0):
<aquatroll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xe9b(%rip),%rsi
lea    0xea2(%rip),%rdx
call   1060 <nicename@plt>
lea    0xe9d(%rip),%rdi
call   1070 <niceprint@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    127f <aquatroll+0x12f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,-0x30(%rbp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%esi
add    %eax,%edx
add    $0x28,%edx
lea    0xe2d(%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    1184 <aquatroll+0x34>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aquatroll>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0xe99(%rip),%rsi
lea    0xea0(%rip),%rdx
call   1060 <nicename@plt>
lea    0xe9b(%rip),%rdi
call   1070 <niceprint@plt>
mov    %rbx,(%rsp)
test   %ebx,%ebx
je     1277 <aquatroll+0x127>
mov    (%rsp),%rax
neg    %eax
mov    %rax,(%rsp)
mov    $0x1,%r12d
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,0x14(%rsp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,0x10(%rsp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,0xc(%rsp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,0x8(%rsp)
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%r13d
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%ebp
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%r15d
mov    $0xa,%edi
call   1040 <d@plt>
mov    %eax,%r14d
mov    $0xa,%edi
call   1040 <d@plt>
add    0x14(%rsp),%ebx
add    0x10(%rsp),%ebx
add    0xc(%rsp),%ebx
add    0x8(%rsp),%ebx
add    %r13d,%ebx
add    %ebp,%ebx
add    %r15d,%ebx
add    %r14d,%ebx
lea    (%rax,%rbx,1),%edx
add    $0x28,%edx
lea    0xe46(%rip),%rdi
mov    %r12d,%esi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rsp),%rax
add    %r12d,%eax
add    $0x1,%eax
mov    %r12d,%ecx
add    $0x1,%ecx
mov    %ecx,%r12d
cmp    $0x1,%eax
jne    11a0 <aquatroll+0x50>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"aquatic troll\00"
@.str.1 = [7 x i8] c"MM 291\00"
@.str.2 = [122 x i8] c"Aquatic trolls have the same abilities as normal trolls, but can also breath water and has a swimming speed of 30 feet.\0A\0A\00"
@.str.3 = [10 x i8] c"%d: %d hp\00"
define void @aquatroll(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 ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @niceprint(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %7
7: ; preds = %36, %1
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp ult i32 %8, %9
br i1 %10, label %11, label %39
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
%14 = call i32 @d(i32 10)
%15 = call i32 @d(i32 10)
%16 = add nsw i32 %14, %15
%17 = call i32 @d(i32 10)
%18 = add nsw i32 %16, %17
%19 = call i32 @d(i32 10)
%20 = add nsw i32 %18, %19
%21 = call i32 @d(i32 10)
%22 = add nsw i32 %20, %21
%23 = call i32 @d(i32 10)
%24 = add nsw i32 %22, %23
%25 = call i32 @d(i32 10)
%26 = add nsw i32 %24, %25
%27 = call i32 @d(i32 10)
%28 = add nsw i32 %26, %27
%29 = call i32 @d(i32 10)
%30 = add nsw i32 %28, %29
%31 = call i32 @d(i32 10)
%32 = add nsw i32 %30, %31
%33 = add nsw i32 %32, 40
%34 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %13, i32 %33)
%35 = call i32 @putchar(i8 signext 10)
br label %36
36: ; preds = %11
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %7
39: ; preds = %7
%40 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"aquatic troll\00"
@.str.1 = [7 x i8] c"MM 291\00"
@.str.2 = [122 x i8] c"Aquatic trolls have the same abilities as normal trolls, but can also breath water and has a swimming speed of 30 feet.\0A\0A\00"
@.str.3 = [10 x i8] c"%d: %d hp\00"
define void @aquatroll(i32 %0) {
%2 = tail call i32 @nicename(i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @niceprint(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.2, i64 0, i64 0))
%4 = icmp eq i32 %0, 0
br i1 %4, label %31, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %7, %5 ], [ 0, %1 ]
%7 = add nuw i32 %6, 1
%8 = tail call i32 @d(i32 10)
%9 = tail call i32 @d(i32 10)
%10 = tail call i32 @d(i32 10)
%11 = tail call i32 @d(i32 10)
%12 = tail call i32 @d(i32 10)
%13 = tail call i32 @d(i32 10)
%14 = tail call i32 @d(i32 10)
%15 = tail call i32 @d(i32 10)
%16 = tail call i32 @d(i32 10)
%17 = tail call i32 @d(i32 10)
%18 = add i32 %8, 40
%19 = add i32 %18, %9
%20 = add i32 %19, %10
%21 = add i32 %20, %11
%22 = add i32 %21, %12
%23 = add i32 %22, %13
%24 = add i32 %23, %14
%25 = add i32 %24, %15
%26 = add i32 %25, %16
%27 = add i32 %26, %17
%28 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %7, i32 %27)
%29 = tail call i32 @putchar(i8 signext 10)
%30 = icmp eq i32 %7, %0
br i1 %30, label %31, label %5
31: ; preds = %5, %1
%32 = tail call i32 @putchar(i8 signext 10)
ret void
}