#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 */
bool is_absolute_path(char *X) {
  if (X == NULL) {
    return false;
  }
  if (*X != '/') {
    return false;
  }
  for (char *cptr = X; *cptr != '\0'; cptr++) {
    if (*cptr == '.') {
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<is_absolute_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <is_absolute_path+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    118c <is_absolute_path+0x8c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     113b <is_absolute_path+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    118c <is_absolute_path+0x8c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1185 <is_absolute_path+0x85>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    116f <is_absolute_path+0x6f>
movl   $0x0,-0x4(%rbp)
jmp    118c <is_absolute_path+0x8c>
jmp    1174 <is_absolute_path+0x74>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1143 <is_absolute_path+0x43>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_absolute_path>:
xor    %eax,%eax
test   %rdi,%rdi
je     1135 <is_absolute_path+0x35>
cmpb   $0x2f,(%rdi)
jne    1135 <is_absolute_path+0x35>
add    $0x1,%rdi
mov    $0x2f,%cl
test   %cl,%cl
je     1130 <is_absolute_path+0x30>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x2e,%cl
je     1135 <is_absolute_path+0x35>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <is_absolute_path+0x20>
mov    $0x1,%eax
ret

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

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