#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);
int is_abspath(char *);
void test_isabspath() {
  assert(is_abspath("file") == 0);
  assert(is_abspath("./file") == 0);
  assert(is_abspath(".file") == 0);
  assert(is_abspath("..file") == 0);
  assert(is_abspath("/../relpath") == 0);
  assert(is_abspath("/path/to/file") == 1);
  assert(is_abspath("/ab/xy/.file") == 1);
  assert(is_abspath("/ab/xy/..file") == 1);
  assert(is_abspath("/ab/.xy/file") == 1);
  assert(is_abspath("/ab/..xy/file") == 1);
}


x86 assembly (clang, -O0):
<test_isabspath>:
push   %rbp
mov    %rsp,%rbp
lea    0xf0c(%rip),%rdi
call   1040 <is_abspath@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xeb9(%rip),%rdi
call   1040 <is_abspath@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xed3(%rip),%rdi
call   1040 <is_abspath@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xeb6(%rip),%rdi
call   1040 <is_abspath@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe6c(%rip),%rdi
call   1040 <is_abspath@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe5c(%rip),%rdi
call   1040 <is_abspath@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe4e(%rip),%rdi
call   1040 <is_abspath@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe3f(%rip),%rdi
call   1040 <is_abspath@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe31(%rip),%rdi
call   1040 <is_abspath@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe22(%rip),%rdi
call   1040 <is_abspath@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isabspath>:
push   %rax
lea    0xf0f(%rip),%rdi
call   1040 <is_abspath@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
lea    0xebf(%rip),%rdi
call   1040 <is_abspath@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
lea    0xedc(%rip),%rdi
call   1040 <is_abspath@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
lea    0xec2(%rip),%rdi
call   1040 <is_abspath@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
lea    0xe7b(%rip),%rdi
call   1040 <is_abspath@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
lea    0xe6e(%rip),%rdi
call   1040 <is_abspath@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
lea    0xe62(%rip),%rdi
call   1040 <is_abspath@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
lea    0xe55(%rip),%rdi
call   1040 <is_abspath@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
lea    0xe49(%rip),%rdi
call   1040 <is_abspath@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
lea    0xe3c(%rip),%rdi
call   1040 <is_abspath@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"file\00"
@.str.1 = [7 x i8] c"./file\00"
@.str.2 = [6 x i8] c".file\00"
@.str.3 = [7 x i8] c"..file\00"
@.str.4 = [12 x i8] c"/../relpath\00"
@.str.5 = [14 x i8] c"/path/to/file\00"
@.str.6 = [13 x i8] c"/ab/xy/.file\00"
@.str.7 = [14 x i8] c"/ab/xy/..file\00"
@.str.8 = [13 x i8] c"/ab/.xy/file\00"
@.str.9 = [14 x i8] c"/ab/..xy/file\00"
define void @test_isabspath() {
%1 = call i32 @is_abspath(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @is_abspath(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @is_abspath(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @is_abspath(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call i32 @is_abspath(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call i32 @is_abspath(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%22 = icmp eq i32 %21, 1
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = call i32 @is_abspath(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%26 = icmp eq i32 %25, 1
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = call i32 @is_abspath(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%30 = icmp eq i32 %29, 1
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = call i32 @is_abspath(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%34 = icmp eq i32 %33, 1
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = call i32 @is_abspath(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%38 = icmp eq i32 %37, 1
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"file\00"
@.str.1 = [7 x i8] c"./file\00"
@.str.2 = [6 x i8] c".file\00"
@.str.3 = [7 x i8] c"..file\00"
@.str.4 = [12 x i8] c"/../relpath\00"
@.str.5 = [14 x i8] c"/path/to/file\00"
@.str.6 = [13 x i8] c"/ab/xy/.file\00"
@.str.7 = [14 x i8] c"/ab/xy/..file\00"
@.str.8 = [13 x i8] c"/ab/.xy/file\00"
@.str.9 = [14 x i8] c"/ab/..xy/file\00"
define void @test_isabspath() {
%1 = tail call i32 @is_abspath(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @is_abspath(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @is_abspath(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @is_abspath(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 @is_abspath(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 @is_abspath(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%22 = icmp eq i32 %21, 1
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call i32 @is_abspath(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%26 = icmp eq i32 %25, 1
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
%29 = tail call i32 @is_abspath(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%30 = icmp eq i32 %29, 1
%31 = zext i1 %30 to i32
%32 = tail call i32 @assert(i32 %31)
%33 = tail call i32 @is_abspath(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%34 = icmp eq i32 %33, 1
%35 = zext i1 %34 to i32
%36 = tail call i32 @assert(i32 %35)
%37 = tail call i32 @is_abspath(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%38 = icmp eq i32 %37, 1
%39 = zext i1 %38 to i32
%40 = tail call i32 @assert(i32 %39)
ret void
}