#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 */
char tolower(char const);
void canonicalizeNumeral(char *s1, const char *s2) {
  for (; *s2 != '\000'; s2 += 1) {
    if (*s2 != '_') {
      *s1 = tolower(*s2);
      s1 += 1;
    }
  }
  s1[0] = '\000';
}


x86 assembly (clang, -O0):
<canonicalizeNumeral>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1176 <canonicalizeNumeral+0x66>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     1160 <canonicalizeNumeral+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <canonicalizeNumeral+0x55>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <canonicalizeNumeral+0x10>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canonicalizeNumeral>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
jmp    1124 <canonicalizeNumeral+0x14>
nopl   0x0(%rax)
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x5f,%al
je     1120 <canonicalizeNumeral+0x10>
test   %al,%al
je     1140 <canonicalizeNumeral+0x30>
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,(%r14)
add    $0x1,%r14
jmp    1120 <canonicalizeNumeral+0x10>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @canonicalizeNumeral(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %23, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %26
10: ; preds = %5
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 95
br i1 %14, label %15, label %22
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = call signext i8 @tolower(i8 signext %17)
%19 = load i8*, i8** %3
store i8 %18, i8* %19
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8* %21, i8** %3
br label %22
22: ; preds = %15, %10
br label %23
23: ; preds = %22
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 1
store i8* %25, i8** %4
br label %5
26: ; preds = %5
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 0
store i8 0, i8* %28
ret void
}

LLVM IR (-O2):
define void @canonicalizeNumeral(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i8* [ %0, %2 ], [ %11, %10 ]
%5 = phi i8* [ %1, %2 ], [ %12, %10 ]
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 0, label %13
i8 95, label %10
]
7: ; preds = %3
%8 = tail call signext i8 @tolower(i8 signext %6)
store i8 %8, i8* %4
%9 = getelementptr inbounds i8, i8* %4, i64 1
br label %10
10: ; preds = %3, %7
%11 = phi i8* [ %9, %7 ], [ %4, %3 ]
%12 = getelementptr inbounds i8, i8* %5, i64 1
br label %3
13: ; preds = %3
store i8 0, i8* %4
ret void
}