#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*/ *strchr(char *, char);
int strlen(char *);
char *baseNameStart(char *fullPathName) {
  static char *delimiters = "\\>]/:";
  int i;
  for (i = strlen(fullPathName) - 1; i > 0; i--)
    if (strchr(delimiters, fullPathName[i]) != NULL)
      return &fullPathName[i + 1];
  return (fullPathName);
}


x86 assembly (clang, -O0):
<baseNameStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1193 <baseNameStart+0x73>
mov    0x2ee4(%rip),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     1180 <baseNameStart+0x60>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    119b <baseNameStart+0x7b>
jmp    1185 <baseNameStart+0x65>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <baseNameStart+0x1b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baseNameStart>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %eax,%eax
lea    (%rax,%r14,1),%r12
add    $0x1,%r12
mov    %ebp,%ebx
add    $0xffffffff,%ebx
add    %r14,%rbx
lea    0xeb5(%rip),%r15
nopl   0x0(%rax,%rax,1)
cmp    $0x2,%ebp
jl     1172 <baseNameStart+0x52>
movsbl (%rbx),%esi
mov    %r15,%rdi
call   1040 <strchr@plt>
add    $0xffffffffffffffff,%r12
add    $0xffffffff,%ebp
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
je     1150 <baseNameStart+0x30>
jmp    1175 <baseNameStart+0x55>
mov    %r14,%r12
mov    %r12,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@baseNameStart.delimiters = internal global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0)
@.str = [6 x i8] c"\\>]/:\00"
define i8* @baseNameStart(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %4
br label %8
8: ; preds = %27, %1
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %30
11: ; preds = %8
%12 = load i8*, i8** @baseNameStart.delimiters
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32* @strchr(i8* %12, i8 signext %17)
%19 = icmp ne i32* %18, null
br i1 %19, label %20, label %26
20: ; preds = %11
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %21, i64 %24
store i8* %25, i8** %2
br label %32
26: ; preds = %11
br label %27
27: ; preds = %26
%28 = load i32, i32* %4
%29 = add nsw i32 %28, -1
store i32 %29, i32* %4
br label %8
30: ; preds = %8
%31 = load i8*, i8** %3
store i8* %31, i8** %2
br label %32
32: ; preds = %30, %20
%33 = load i8*, i8** %2
ret i8* %33
}

LLVM IR (-O2):
@.str = [6 x i8] c"\\>]/:\00"
define i8* @baseNameStart(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = zext i32 %2 to i64
br label %4
4: ; preds = %9, %1
%5 = phi i64 [ %6, %9 ], [ %3, %1 ]
%6 = add nsw i64 %5, -1
%7 = trunc i64 %5 to i32
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = and i64 %6, 4294967295
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = tail call i32* @strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %12)
%14 = icmp eq i32* %13, null
br i1 %14, label %4, label %15
15: ; preds = %9
%16 = and i64 %5, 4294967295
%17 = getelementptr inbounds i8, i8* %0, i64 %16
br label %18
18: ; preds = %4, %15
%19 = phi i8* [ %17, %15 ], [ %0, %4 ]
ret i8* %19
}