#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 */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int Splitpart__parse(char *, int *, int *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/);
char *strrchr(char *, char);
int Splitpart__is_part_path(char *path, int flag) {
  int partno, total_parts, ret;
  off_t offset, bytes, total_bytes;
  char *name;
  name = strrchr(path, '/');
  if (name == NULL)
    name = path;
  else
    name++;
  ret = Splitpart__parse(name, &partno, &total_parts, &offset, &bytes,
                         &total_bytes, 0);
  return (ret > 0);
}


x86 assembly (clang, -O0):
<Splitpart__is_part_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1159 <Splitpart__is_part_path+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1165 <Splitpart__is_part_path+0x45>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
lea    -0x24(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <Splitpart__parse@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Splitpart__is_part_path>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rdi
test   %rax,%rax
cmove  %rbx,%rdi
movl   $0x0,(%rsp)
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
call   1030 <Splitpart__parse@plt>
xor    %ecx,%ecx
test   %eax,%eax
setg   %cl
mov    %ecx,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Splitpart__is_part_path(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%12 = load i8*, i8** %3
%13 = call i8* @strrchr(i8* %12, i8 signext 47)
store i8* %13, i8** %11
%14 = load i8*, i8** %11
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load i8*, i8** %3
store i8* %17, i8** %11
br label %21
18: ; preds = %2
%19 = load i8*, i8** %11
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %11
br label %21
21: ; preds = %18, %16
%22 = load i8*, i8** %11
%23 = call i32 @Splitpart__parse(i8* %22, i32* %5, i32* %6, i32* %8, i32* %9, i32* %10, i32 0)
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = icmp sgt i32 %24, 0
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @Splitpart__is_part_path(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%14 = icmp eq i8* %13, null
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = select i1 %14, i8* %0, i8* %15
%17 = call i32 @Splitpart__parse(i8* %16, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32 0)
%18 = icmp sgt i32 %17, 0
%19 = zext i1 %18 to i32
ret i32 %19
}