#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*/ ok(int, char *);
int rfile_fn_is_abs(char *);
int rfile_fn_is_url(char *);
void test_001(void) {
  ok(rfile_fn_is_url("http://example.com"), "is url");
  ok(!rfile_fn_is_url("/usr/local"), "is file");
  ok(!rfile_fn_is_url("http/example.com"), "is file");
  ok(rfile_fn_is_abs("/usr/local"), "is abs");
  ok(!rfile_fn_is_abs("http/example.com"), "is relative");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <rfile_fn_is_url@plt>
mov    %eax,%edi
lea    0xeca(%rip),%rsi
call   1030 <ok@plt>
lea    0xec5(%rip),%rdi
call   1050 <rfile_fn_is_url@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
lea    0xeb7(%rip),%rsi
call   1030 <ok@plt>
lea    0xeb3(%rip),%rdi
call   1050 <rfile_fn_is_url@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
lea    0xe92(%rip),%rsi
call   1030 <ok@plt>
lea    0xe7b(%rip),%rdi
call   1040 <rfile_fn_is_abs@plt>
mov    %eax,%edi
lea    0xe91(%rip),%rsi
call   1030 <ok@plt>
lea    0xe74(%rip),%rdi
call   1040 <rfile_fn_is_abs@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
lea    0xe73(%rip),%rsi
call   1030 <ok@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r15
push   %r14
push   %rbx
lea    0xec4(%rip),%rdi
call   1050 <rfile_fn_is_url@plt>
lea    0xecb(%rip),%rsi
mov    %eax,%edi
call   1030 <ok@plt>
lea    0xec4(%rip),%r14
mov    %r14,%rdi
call   1050 <rfile_fn_is_url@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xeb8(%rip),%rbx
mov    %rbx,%rsi
call   1030 <ok@plt>
lea    0xeb1(%rip),%r15
mov    %r15,%rdi
call   1050 <rfile_fn_is_url@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
mov    %rbx,%rsi
call   1030 <ok@plt>
mov    %r14,%rdi
call   1040 <rfile_fn_is_abs@plt>
lea    0xe9b(%rip),%rsi
mov    %eax,%edi
call   1030 <ok@plt>
mov    %r15,%rdi
call   1040 <rfile_fn_is_abs@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xe84(%rip),%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <ok@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"http://example.com\00"
@.str.1 = [7 x i8] c"is url\00"
@.str.2 = [11 x i8] c"/usr/local\00"
@.str.3 = [8 x i8] c"is file\00"
@.str.4 = [17 x i8] c"http/example.com\00"
@.str.5 = [7 x i8] c"is abs\00"
@.str.6 = [12 x i8] c"is relative\00"
define void @test_001() {
%1 = call i32 @rfile_fn_is_url(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @ok(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @rfile_fn_is_url(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = call i32 @ok(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @rfile_fn_is_url(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call i32 @ok(i32 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @rfile_fn_is_abs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @ok(i32 %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @rfile_fn_is_abs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
%19 = call i32 @ok(i32 %18, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"http://example.com\00"
@.str.1 = [7 x i8] c"is url\00"
@.str.2 = [11 x i8] c"/usr/local\00"
@.str.3 = [8 x i8] c"is file\00"
@.str.4 = [17 x i8] c"http/example.com\00"
@.str.5 = [7 x i8] c"is abs\00"
@.str.6 = [12 x i8] c"is relative\00"
define void @test_001() {
%1 = tail call i32 @rfile_fn_is_url(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ok(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @rfile_fn_is_url(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @ok(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @rfile_fn_is_url(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @ok(i32 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 @rfile_fn_is_abs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%12 = tail call i32 @ok(i32 %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%13 = tail call i32 @rfile_fn_is_abs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @ok(i32 %15, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
ret void
}