#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 */
scalar_t__ isalpha(char const);
int os_IsAbsolutePath(char const *path) {
  if (!path)
    return 0;
  if (path[0] == '/')
    return 1;
  if (path[0] == '\\')
    return 1;
  if (isalpha(path[0]) && path[1] == ':')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<os_IsAbsolutePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <os_IsAbsolutePath+0x23>
movl   $0x0,-0x4(%rbp)
jmp    11a5 <os_IsAbsolutePath+0x95>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    114f <os_IsAbsolutePath+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <os_IsAbsolutePath+0x95>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    116b <os_IsAbsolutePath+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <os_IsAbsolutePath+0x95>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     119e <os_IsAbsolutePath+0x8e>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3a,%eax
jne    119e <os_IsAbsolutePath+0x8e>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <os_IsAbsolutePath+0x95>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_IsAbsolutePath>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     1141 <os_IsAbsolutePath+0x31>
mov    %rdi,%rbx
mov    (%rdi),%al
mov    $0x1,%ebp
cmp    $0x2f,%al
je     1141 <os_IsAbsolutePath+0x31>
cmp    $0x5c,%al
je     1141 <os_IsAbsolutePath+0x31>
movsbl %al,%edi
call   1030 <isalpha@plt>
test   %rax,%rax
je     113f <os_IsAbsolutePath+0x2f>
cmpb   $0x3a,0x1(%rbx)
je     1141 <os_IsAbsolutePath+0x31>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @os_IsAbsolutePath(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %35
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 47
br i1 %12, label %13, label %14
13: ; preds = %7
store i32 1, i32* %2
br label %35
14: ; preds = %7
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 92
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 1, i32* %2
br label %35
21: ; preds = %14
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = call i64 @isalpha(i8 signext %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %34
27: ; preds = %21
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 1
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 58
br i1 %32, label %33, label %34
33: ; preds = %27
store i32 1, i32* %2
br label %35
34: ; preds = %27, %21
store i32 0, i32* %2
br label %35
35: ; preds = %34, %33, %20, %13, %6
%36 = load i32, i32* %2
ret i32 %36
}

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