#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 */
scalar_t__ isalnum(char);
void collection_normalize_name(char collection_name[], int length) {
  int y;
  for (y = 0; y < length; y++) {
    if (isalnum(collection_name[y])) {
    } else if (collection_name[y] == 32) {
    } else if (collection_name[y] == 95) {
    } else if (collection_name[y] == 45) {
    } else if (y != 0 && collection_name[y] == '.') {
    } else {

      ;
      collection_name[y] = 'X';
    }
  }
}


x86 assembly (clang, -O0):
<collection_normalize_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f7 <collection_normalize_name+0xe7>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
je     1152 <collection_normalize_name+0x42>
jmp    11e4 <collection_normalize_name+0xd4>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    116c <collection_normalize_name+0x5c>
jmp    11df <collection_normalize_name+0xcf>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5f,%eax
jne    1186 <collection_normalize_name+0x76>
jmp    11da <collection_normalize_name+0xca>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
jne    11a0 <collection_normalize_name+0x90>
jmp    11d5 <collection_normalize_name+0xc5>
cmpl   $0x0,-0x10(%rbp)
je     11c4 <collection_normalize_name+0xb4>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    11c4 <collection_normalize_name+0xb4>
jmp    11d0 <collection_normalize_name+0xc0>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x58,(%rax,%rcx,1)
jmp    11d5 <collection_normalize_name+0xc5>
jmp    11da <collection_normalize_name+0xca>
jmp    11df <collection_normalize_name+0xcf>
jmp    11e4 <collection_normalize_name+0xd4>
jmp    11e9 <collection_normalize_name+0xd9>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <collection_normalize_name+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<collection_normalize_name>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1179 <collection_normalize_name+0x69>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
movabs $0x8000000000002001,%r12
jmp    1149 <collection_normalize_name+0x39>
movb   $0x58,(%r15,%rbx,1)
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
cmp    %rbx,%r14
je     1179 <collection_normalize_name+0x69>
movsbl (%r15,%rbx,1),%edi
call   1030 <isalnum@plt>
test   %rax,%rax
jne    1140 <collection_normalize_name+0x30>
movzbl (%r15,%rbx,1),%eax
lea    -0x20(%rax),%ecx
cmp    $0x3f,%cl
ja     116e <collection_normalize_name+0x5e>
movzbl %cl,%ecx
bt     %rcx,%r12
jb     1140 <collection_normalize_name+0x30>
test   %rbx,%rbx
je     1130 <collection_normalize_name+0x20>
cmp    $0x2e,%al
je     1140 <collection_normalize_name+0x30>
jmp    1130 <collection_normalize_name+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @collection_normalize_name(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %68, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %71
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i64 @isalnum(i8 signext %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %10
br label %67
19: ; preds = %10
%20 = load i8*, i8** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 32
br i1 %26, label %27, label %28
27: ; preds = %19
br label %66
28: ; preds = %19
%29 = load i8*, i8** %3
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 95
br i1 %35, label %36, label %37
36: ; preds = %28
br label %65
37: ; preds = %28
%38 = load i8*, i8** %3
%39 = load i32, i32* %5
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %38, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 45
br i1 %44, label %45, label %46
45: ; preds = %37
br label %64
46: ; preds = %37
%47 = load i32, i32* %5
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %58
49: ; preds = %46
%50 = load i8*, i8** %3
%51 = load i32, i32* %5
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %50, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 46
br i1 %56, label %57, label %58
57: ; preds = %49
br label %63
58: ; preds = %49, %46
%59 = load i8*, i8** %3
%60 = load i32, i32* %5
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8, i8* %59, i64 %61
store i8 88, i8* %62
br label %63
63: ; preds = %58, %57
br label %64
64: ; preds = %63, %45
br label %65
65: ; preds = %64, %36
br label %66
66: ; preds = %65, %27
br label %67
67: ; preds = %66, %18
br label %68
68: ; preds = %67
%69 = load i32, i32* %5
%70 = add nsw i32 %69, 1
store i32 %70, i32* %5
br label %6
71: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @collection_normalize_name(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %22
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %19
%7 = phi i64 [ 0, %4 ], [ %20, %19 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i64 @isalnum(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %6
%13 = load i8, i8* %8
switch i8 %13, label %14 [
i8 32, label %19
i8 95, label %19
i8 45, label %19
]
14: ; preds = %12
%15 = icmp ne i64 %7, 0
%16 = icmp eq i8 %13, 46
%17 = select i1 %15, i1 %16, i1 false
br i1 %17, label %19, label %18
18: ; preds = %14
store i8 88, i8* %8
br label %19
19: ; preds = %14, %12, %12, %12, %6, %18
%20 = add nuw nsw i64 %7, 1
%21 = icmp eq i64 %20, %5
br i1 %21, label %22, label %6
22: ; preds = %19, %2
ret void
}