#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 *rtl_suffixname(char *fullName) {
  register char *old = 0L;
  while (*fullName) {
    if ((((*fullName) == '/') || ((*fullName) == '\\'))) {
      old = NULL;
    }
    if (*fullName == '.') {
      old = fullName;
    }
    fullName++;
  }
  return old;
}


x86 assembly (clang, -O0):
<rtl_suffixname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116e <rtl_suffixname+0x6e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     113d <rtl_suffixname+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1145 <rtl_suffixname+0x45>
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    115d <rtl_suffixname+0x5d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <rtl_suffixname+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl_suffixname>:
xor    %eax,%eax
jmp    111d <rtl_suffixname+0x1d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
cmp    $0x2e,%cl
cmove  %rdi,%rax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x2f,%cl
je     1110 <rtl_suffixname+0x10>
cmp    $0x5c,%cl
je     1110 <rtl_suffixname+0x10>
test   %cl,%cl
jne    1112 <rtl_suffixname+0x12>
ret

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

LLVM IR (-O2):
define i8* @rtl_suffixname(i8* %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %11, %7 ]
%4 = phi i8* [ null, %1 ], [ %10, %7 ]
%5 = load i8, i8* %3
switch i8 %5, label %7 [
i8 0, label %12
i8 47, label %6
i8 92, label %6
]
6: ; preds = %2, %2
br label %7
7: ; preds = %2, %6
%8 = phi i8* [ null, %6 ], [ %4, %2 ]
%9 = icmp eq i8 %5, 46
%10 = select i1 %9, i8* %3, i8* %8
%11 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
12: ; preds = %2
ret i8* %4
}