#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*/ memmove(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void removedrive(char *path) {
  if (((path[0] >= 'a' && path[0] <= 'z') ||
       (path[0] >= 'A' && path[0] <= 'Z')) &&
      path[1] == ':')
    memmove(path, path + 2, strlen(path));
}


x86 assembly (clang, -O0):
<removedrive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     114c <removedrive+0x2c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jle    116c <removedrive+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     11a9 <removedrive+0x89>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     11a9 <removedrive+0x89>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3a,%eax
jne    11a9 <removedrive+0x89>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
call   1040 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removedrive>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x19,%al
ja     1157 <removedrive+0x37>
mov    %rdi,%rbx
cmpb   $0x3a,0x1(%rdi)
jne    1157 <removedrive+0x37>
lea    0x2(%rbx),%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memmove@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @removedrive(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 122
br i1 %13, label %26, label %14
14: ; preds = %8, %1
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 65
br i1 %19, label %20, label %39
20: ; preds = %14
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 90
br i1 %25, label %26, label %39
26: ; preds = %20, %8
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 58
br i1 %31, label %32, label %39
32: ; preds = %26
%33 = load i8*, i8** %2
%34 = load i8*, i8** %2
%35 = getelementptr inbounds i8, i8* %34, i64 2
%36 = load i8*, i8** %2
%37 = call i32 @strlen(i8* %36)
%38 = call i32 @memmove(i8* %33, i8* %35, i32 %37)
br label %39
39: ; preds = %32, %26, %20, %14
ret void
}

LLVM IR (-O2):
define void @removedrive(i8* %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -33
%4 = add i8 %3, -65
%5 = icmp ult i8 %4, 26
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 58
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = tail call i32 @strlen(i8* %0)
%13 = tail call i32 @memmove(i8* %0, i8* %11, i32 %12)
br label %14
14: ; preds = %1, %10, %6
ret void
}