#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*/ isascii(char);
scalar_t__ islower(unsigned char);
char toupper(unsigned char);
void standard(char *word) {
  while (*word) {
    if (!isascii(*word))
      break;
    if (islower((unsigned char)*word))
      *word = toupper((unsigned char)*word);
    if (*word == '1')
      *word = 'L';
    if (*word == '0')
      *word = 'O';
    if (*word == '5')
      *word = 'S';
    word++;
  }
}


x86 assembly (clang, -O0):
<standard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     11e3 <standard+0xb3>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isascii@plt>
cmp    $0x0,%eax
jne    1163 <standard+0x33>
jmp    11e3 <standard+0xb3>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     118d <standard+0x5d>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    11a4 <standard+0x74>
mov    -0x8(%rbp),%rax
movb   $0x4c,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    11bb <standard+0x8b>
mov    -0x8(%rbp),%rax
movb   $0x4f,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x35,%eax
jne    11d2 <standard+0xa2>
mov    -0x8(%rbp),%rax
movb   $0x53,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    113c <standard+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1194 <standard+0x64>
mov    %rdi,%rbx
jmp    1150 <standard+0x20>
nopl   0x0(%rax)
mov    $0x53,%al
mov    %al,(%rbx)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1194 <standard+0x64>
movsbl %al,%edi
call   1050 <isascii@plt>
test   %eax,%eax
je     1194 <standard+0x64>
movzbl (%rbx),%edi
call   1030 <islower@plt>
mov    %rax,%rcx
movzbl (%rbx),%eax
test   %rcx,%rcx
je     1179 <standard+0x49>
movzbl %al,%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
cmp    $0x35,%al
je     1140 <standard+0x10>
cmp    $0x31,%al
je     1190 <standard+0x60>
cmp    $0x30,%al
jne    1144 <standard+0x14>
mov    $0x4f,%al
jmp    1142 <standard+0x12>
nopl   0x0(%rax)
mov    $0x4c,%al
jmp    1142 <standard+0x12>
pop    %rbx
ret

LLVM IR (-O0):
define void @standard(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %44, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %47
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = call i32 @isascii(i8 signext %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %7
br label %47
13: ; preds = %7
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = call i64 @islower(i8 zeroext %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = call signext i8 @toupper(i8 zeroext %20)
%22 = load i8*, i8** %2
store i8 %21, i8* %22
br label %23
23: ; preds = %18, %13
%24 = load i8*, i8** %2
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 49
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = load i8*, i8** %2
store i8 76, i8* %29
br label %30
30: ; preds = %28, %23
%31 = load i8*, i8** %2
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 48
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = load i8*, i8** %2
store i8 79, i8* %36
br label %37
37: ; preds = %35, %30
%38 = load i8*, i8** %2
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 53
br i1 %41, label %42, label %44
42: ; preds = %37
%43 = load i8*, i8** %2
store i8 83, i8* %43
br label %44
44: ; preds = %42, %37
%45 = load i8*, i8** %2
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %2
br label %3
47: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
define void @standard(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %26, label %4
4: ; preds = %1, %22
%5 = phi i8 [ %24, %22 ], [ %2, %1 ]
%6 = phi i8* [ %23, %22 ], [ %0, %1 ]
%7 = tail call i32 @isascii(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %26, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call i64 @islower(i8 zeroext %10)
%12 = icmp eq i64 %11, 0
%13 = load i8, i8* %6
br i1 %12, label %16, label %14
14: ; preds = %9
%15 = tail call signext i8 @toupper(i8 zeroext %13)
store i8 %15, i8* %6
br label %16
16: ; preds = %9, %14
%17 = phi i8 [ %15, %14 ], [ %13, %9 ]
switch i8 %17, label %22 [
i8 49, label %20
i8 48, label %18
i8 53, label %19
]
18: ; preds = %16
br label %20
19: ; preds = %16
br label %20
20: ; preds = %16, %19, %18
%21 = phi i8 [ 79, %18 ], [ 83, %19 ], [ 76, %16 ]
store i8 %21, i8* %6
br label %22
22: ; preds = %20, %16
%23 = getelementptr inbounds i8, i8* %6, i64 1
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %4
26: ; preds = %22, %4, %1
ret void
}