#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 *strchr(char const *, char);
bool is_remote(const char *subject) {
  char *slash = strchr(subject, '/');
  char *colon = strchr(subject, ':');
  if ((colon && !slash) || (colon && slash && colon < slash))
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<is_remote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1156 <is_remote+0x46>
cmpq   $0x0,-0x18(%rbp)
je     117a <is_remote+0x6a>
cmpq   $0x0,-0x20(%rbp)
je     1186 <is_remote+0x76>
cmpq   $0x0,-0x18(%rbp)
je     1186 <is_remote+0x76>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1186 <is_remote+0x76>
movl   $0x1,-0x4(%rbp)
jmp    118d <is_remote+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_remote>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1140 <is_remote+0x30>
mov    $0x1,%ecx
test   %r14,%r14
je     1159 <is_remote+0x49>
test   %r14,%r14
setne  %cl
test   %rax,%rax
setne  %dl
and    %cl,%dl
cmp    %r14,%rax
setb   %al
and    %dl,%al
movzbl %al,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @is_remote(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* @strchr(i8* %6, i8 signext 47)
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = call i8* @strchr(i8* %8, i8 signext 58)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %25
15: ; preds = %12, %1
%16 = load i8*, i8** %5
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %26
18: ; preds = %15
%19 = load i8*, i8** %4
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i8*, i8** %5
%23 = load i8*, i8** %4
%24 = icmp ult i8* %22, %23
br i1 %24, label %25, label %26
25: ; preds = %21, %12
store i32 1, i32* %2
br label %27
26: ; preds = %21, %18, %15
store i32 0, i32* %2
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @is_remote(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
%4 = icmp eq i8* %3, null
%5 = icmp ne i8* %2, null
%6 = select i1 %4, i1 true, i1 %5
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = icmp ne i8* %3, null
%9 = select i1 %8, i1 %5, i1 false
%10 = icmp ult i8* %3, %2
%11 = select i1 %9, i1 %10, i1 false
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %1
%14 = phi i32 [ 1, %1 ], [ %12, %7 ]
ret i32 %14
}