#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 *strchrnul(char const *, char);
int is_a_path(const char *buffer) {
  const char *spc = strchrnul(buffer, ' ');
  const char *b = buffer;
  while (b < spc) {
    if (*b == '/') {
      return 1;
    }
    b++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_a_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchrnul@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1171 <is_a_path+0x61>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1160 <is_a_path+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1178 <is_a_path+0x68>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1136 <is_a_path+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_a_path>:
push   %rbx
mov    %rdi,%rbx
mov    $0x20,%esi
call   1030 <strchrnul@plt>
xor    %ecx,%ecx
sub    %rbx,%rax
jbe    1148 <is_a_path+0x38>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
cmpb   $0x2f,(%rbx,%rcx,1)
je     1143 <is_a_path+0x33>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1130 <is_a_path+0x20>
xor    %ecx,%ecx
jmp    1148 <is_a_path+0x38>
mov    $0x1,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_a_path(i8* %0) {
%2 = tail call i8* @strchrnul(i8* %0, i8 signext 32)
%3 = icmp ugt i8* %2, %0
br i1 %3, label %4, label %16
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = getelementptr i8, i8* %0, i64 %7
br label %11
9: ; preds = %11
%10 = icmp eq i8* %15, %8
br i1 %10, label %16, label %11
11: ; preds = %4, %9
%12 = phi i8* [ %15, %9 ], [ %0, %4 ]
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 47
%15 = getelementptr inbounds i8, i8* %12, i64 1
br i1 %14, label %16, label %9
16: ; preds = %11, %9, %1
%17 = phi i32 [ 0, %1 ], [ 0, %9 ], [ 1, %11 ]
ret i32 %17
}