#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*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
char *BASM_PP_PrintName(char *t, char *s) {
  int i;
  i = *(t - 1);
  if ((i == ';') || (i == '_') || ((i >= '0') && (i <= '9')) ||
      ((i >= 'A') && (i <= 'Z')) || ((i >= 'a') && (i <= 'z')))
    *t++ = ' ';
  strcpy(t, s);
  t += strlen(s);
  return (t);
}


x86 assembly (clang, -O0):
<BASM_PP_PrintName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl -0x1(%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x3b,-0x14(%rbp)
je     118b <BASM_PP_PrintName+0x6b>
cmpl   $0x5f,-0x14(%rbp)
je     118b <BASM_PP_PrintName+0x6b>
cmpl   $0x30,-0x14(%rbp)
jl     1163 <BASM_PP_PrintName+0x43>
cmpl   $0x39,-0x14(%rbp)
jle    118b <BASM_PP_PrintName+0x6b>
cmpl   $0x41,-0x14(%rbp)
jl     1177 <BASM_PP_PrintName+0x57>
cmpl   $0x5a,-0x14(%rbp)
jle    118b <BASM_PP_PrintName+0x6b>
cmpl   $0x61,-0x14(%rbp)
jl     119d <BASM_PP_PrintName+0x7d>
cmpl   $0x7a,-0x14(%rbp)
jg     119d <BASM_PP_PrintName+0x7d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x20,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BASM_PP_PrintName>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    -0x1(%rdi),%al
cmp    $0x3b,%al
je     1135 <BASM_PP_PrintName+0x15>
cmp    $0x5f,%al
jne    115c <BASM_PP_PrintName+0x3c>
movb   $0x20,(%rbx)
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    -0x30(%rax),%ecx
cmp    $0xa,%cl
jb     1135 <BASM_PP_PrintName+0x15>
lea    -0x41(%rax),%ecx
cmp    $0x1a,%cl
jb     1135 <BASM_PP_PrintName+0x15>
add    $0x9f,%al
cmp    $0x19,%al
ja     113c <BASM_PP_PrintName+0x1c>
jmp    1135 <BASM_PP_PrintName+0x15>

LLVM IR (-O0):
define i8* @BASM_PP_PrintName(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 59
br i1 %11, label %33, label %12
12: ; preds = %2
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 95
br i1 %14, label %33, label %15
15: ; preds = %12
%16 = load i32, i32* %5
%17 = icmp sge i32 %16, 48
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %5
%20 = icmp sle i32 %19, 57
br i1 %20, label %33, label %21
21: ; preds = %18, %15
%22 = load i32, i32* %5
%23 = icmp sge i32 %22, 65
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %5
%26 = icmp sle i32 %25, 90
br i1 %26, label %33, label %27
27: ; preds = %24, %21
%28 = load i32, i32* %5
%29 = icmp sge i32 %28, 97
br i1 %29, label %30, label %36
30: ; preds = %27
%31 = load i32, i32* %5
%32 = icmp sle i32 %31, 122
br i1 %32, label %33, label %36
33: ; preds = %30, %24, %18, %12, %2
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %3
store i8 32, i8* %34
br label %36
36: ; preds = %33, %30, %27
%37 = load i8*, i8** %3
%38 = load i8*, i8** %4
%39 = call i32 @strcpy(i8* %37, i8* %38)
%40 = load i8*, i8** %4
%41 = call i32 @strlen(i8* %40)
%42 = load i8*, i8** %3
%43 = sext i32 %41 to i64
%44 = getelementptr inbounds i8, i8* %42, i64 %43
store i8* %44, i8** %3
%45 = load i8*, i8** %3
ret i8* %45
}

LLVM IR (-O2):
define i8* @BASM_PP_PrintName(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 -1
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 95, label %14
i8 59, label %14
]
5: ; preds = %2
%6 = add i8 %4, -48
%7 = icmp ult i8 %6, 10
%8 = add i8 %4, -65
%9 = icmp ult i8 %8, 26
%10 = or i1 %7, %9
%11 = add i8 %4, -97
%12 = icmp ult i8 %11, 26
%13 = select i1 %10, i1 true, i1 %12
br i1 %13, label %14, label %16
14: ; preds = %2, %2, %5
%15 = getelementptr inbounds i8, i8* %0, i64 1
store i8 32, i8* %0
br label %16
16: ; preds = %5, %14
%17 = phi i8* [ %15, %14 ], [ %0, %5 ]
%18 = tail call i32 @strcpy(i8* %17, i8* %1)
%19 = tail call i32 @strlen(i8* %1)
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %17, i64 %20
ret i8* %21
}