#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 *scout_any_segment(char const *, int /*<<< orphan*/);
const char *scout_path_abempty(const char *c) {
  const char *p = NULL;
  do {
    if (*c != '/')
      break;
    p = c++;
    c = scout_any_segment(c, 0);
    if (c != NULL)
      p = c++;
  } while (c != NULL);
  return p;
}


x86 assembly (clang, -O0):
<scout_path_abempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1139 <scout_path_abempty+0x29>
jmp    1189 <scout_path_abempty+0x79>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <scout_any_segment@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1179 <scout_path_abempty+0x69>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
jmp    117e <scout_path_abempty+0x6e>
cmpq   $0x0,-0x8(%rbp)
jne    1124 <scout_path_abempty+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scout_path_abempty>:
push   %rbx
cmpb   $0x2f,(%rdi)
jne    113e <scout_path_abempty+0x2e>
mov    %rdi,%rbx
nopl   0x0(%rax)
lea    0x1(%rbx),%rdi
xor    %esi,%esi
call   1030 <scout_any_segment@plt>
test   %rax,%rax
je     1140 <scout_path_abempty+0x30>
lea    0x1(%rax),%rbx
cmpb   $0x2f,(%rbx)
je     1120 <scout_path_abempty+0x10>
mov    %rax,%rbx
jmp    1140 <scout_path_abempty+0x30>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @scout_path_abempty(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
br i1 %3, label %7, label %13
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 47
br i1 %6, label %7, label %13
7: ; preds = %1, %4
%8 = phi i8* [ %12, %4 ], [ %0, %1 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = tail call i8* @scout_any_segment(i8* %9, i32 0)
%11 = icmp eq i8* %10, null
%12 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i8* [ null, %1 ], [ %10, %4 ], [ %8, %7 ]
ret i8* %14
}