#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 *BTSHASP_PrintName(char *t, char *s) {
  int i;
  i = *(t - 1);
  if ((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):
<BTSHASP_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   $0x5f,-0x14(%rbp)
je     1181 <BTSHASP_PrintName+0x61>
cmpl   $0x30,-0x14(%rbp)
jl     1159 <BTSHASP_PrintName+0x39>
cmpl   $0x39,-0x14(%rbp)
jle    1181 <BTSHASP_PrintName+0x61>
cmpl   $0x41,-0x14(%rbp)
jl     116d <BTSHASP_PrintName+0x4d>
cmpl   $0x5a,-0x14(%rbp)
jle    1181 <BTSHASP_PrintName+0x61>
cmpl   $0x61,-0x14(%rbp)
jl     1193 <BTSHASP_PrintName+0x73>
cmpl   $0x7a,-0x14(%rbp)
jg     1193 <BTSHASP_PrintName+0x73>
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):
<BTSHASP_PrintName>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    -0x1(%rdi),%al
lea    -0x41(%rax),%ecx
cmp    $0x1a,%cl
jb     1147 <BTSHASP_PrintName+0x27>
cmp    $0x5f,%al
je     1147 <BTSHASP_PrintName+0x27>
lea    -0x30(%rax),%ecx
cmp    $0xa,%cl
jb     1147 <BTSHASP_PrintName+0x27>
add    $0x9f,%al
cmp    $0x19,%al
ja     114e <BTSHASP_PrintName+0x2e>
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

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

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