#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*/ nicename(unsigned int, char *, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void brownmold(unsigned count) {
  int i;
  nicename(count, "brown mold", "DMG 105");
  for (i = 0; i < count; i++) {
    printf("%d: n/a hp (destroyed by cold, immune to fire)", i + 1);
    (void)putchar('\n');
  }
  (void)putchar('\n');
}


x86 assembly (clang, -O0):
<brownmold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xebb(%rip),%rsi
lea    0xebf(%rip),%rdx
call   1050 <nicename@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    118e <brownmold+0x5e>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1158 <brownmold+0x28>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brownmold>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%r15d
lea    0xec1(%rip),%rsi
lea    0xec5(%rip),%rdx
call   1050 <nicename@plt>
test   %r15d,%r15d
je     1187 <brownmold+0x57>
neg    %r15d
mov    $0x1,%ebx
lea    0xeb4(%rip),%r14
nop
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1160 <brownmold+0x30>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"brown mold\00"
@.str.1 = [8 x i8] c"DMG 105\00"
@.str.2 = [47 x i8] c"%d: n/a hp (destroyed by cold, immune to fire)\00"
define void @brownmold(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 ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %6
6: ; preds = %15, %1
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
%13 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = call i32 @putchar(i8 signext 10)
br label %15
15: ; preds = %10
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %6
18: ; preds = %6
%19 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"brown mold\00"
@.str.1 = [8 x i8] c"DMG 105\00"
@.str.2 = [47 x i8] c"%d: n/a hp (destroyed by cold, immune to fire)\00"
define void @brownmold(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 ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = tail call i32 @putchar(i8 signext 10)
%9 = icmp eq i32 %6, %0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = tail call i32 @putchar(i8 signext 10)
ret void
}