#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*/ assert(int /*<<< orphan*/);
size_t strlen(char const *);
const char *_file_info_remove_cli(const char *cli, const char *path) {
  assert(cli != NULL);
  assert(path != NULL);
  size_t len;
  len = strlen(cli);
  if (cli[len - 1] != '/' && path[len]) {
    ++len;
  }
  return path + len;
}


x86 assembly (clang, -O0):
<_file_info_remove_cli>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     119b <_file_info_remove_cli+0x7b>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     119b <_file_info_remove_cli+0x7b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_file_info_remove_cli>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
cmpb   $0x2f,-0x1(%rax,%r14,1)
je     115e <_file_info_remove_cli+0x3e>
cmpb   $0x1,(%rbx,%rax,1)
sbb    $0xffffffffffffffff,%rax
add    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_file_info_remove_cli(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%10 = add i64 %9, -1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 47
br i1 %13, label %20, label %14
14: ; preds = %2
%15 = getelementptr inbounds i8, i8* %1, i64 %9
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
%18 = zext i1 %17 to i64
%19 = add i64 %9, %18
br label %20
20: ; preds = %14, %2
%21 = phi i64 [ %9, %2 ], [ %19, %14 ]
%22 = getelementptr inbounds i8, i8* %1, i64 %21
ret i8* %22
}