#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 */
scalar_t__ synctex_ignore_leading_dot_slash_in_path(char const **);
const char *_synctex_base_name(const char *path) {
  const char *ptr = path;
  do {
    if (synctex_ignore_leading_dot_slash_in_path(&ptr)) {
      return ptr;
    }
    do {
      if (!*(++ptr)) {
        return path;
      }
    } while (!('/' == *ptr));
  } while (*(++ptr));
  return path;
}


x86 assembly (clang, -O0):
<_synctex_base_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <synctex_ignore_leading_dot_slash_in_path@plt>
cmp    $0x0,%rax
je     1144 <_synctex_base_name+0x34>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <_synctex_base_name+0xa5>
jmp    1149 <_synctex_base_name+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
cmpb   $0x0,0x1(%rax)
jne    116f <_synctex_base_name+0x5f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11b5 <_synctex_base_name+0xa5>
jmp    1174 <_synctex_base_name+0x64>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x2f,%eax
cmp    %ecx,%eax
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    1149 <_synctex_base_name+0x39>
jmp    1194 <_synctex_base_name+0x84>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
cmpb   $0x0,0x1(%rax)
jne    1124 <_synctex_base_name+0x14>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_synctex_base_name>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rdi,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <synctex_ignore_leading_dot_slash_in_path@plt>
mov    (%rsp),%rcx
test   %rax,%rax
jne    115e <_synctex_base_name+0x4e>
add    $0x1,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rcx,(%rsp)
movzbl (%rcx),%eax
test   %al,%al
je     1161 <_synctex_base_name+0x51>
add    $0x1,%rcx
cmp    $0x2f,%al
jne    1140 <_synctex_base_name+0x30>
mov    %rcx,(%rsp)
cmpb   $0x0,(%rcx)
jne    111e <_synctex_base_name+0xe>
jmp    1161 <_synctex_base_name+0x51>
mov    %rcx,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_synctex_base_name(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
br label %4
4: ; preds = %12, %1
%5 = call i64 @synctex_ignore_leading_dot_slash_in_path(i8** %2)
%6 = icmp eq i64 %5, 0
%7 = load i8*, i8** %2
br i1 %6, label %8, label %16
8: ; preds = %4, %8
%9 = phi i8* [ %10, %8 ], [ %7, %4 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %2
%11 = load i8, i8* %10
switch i8 %11, label %8 [
i8 0, label %16
i8 47, label %12
]
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %9, i64 2
store i8* %13, i8** %2
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %4, %8
%17 = phi i8* [ %0, %8 ], [ %7, %4 ], [ %0, %12 ]
ret i8* %17
}