#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*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
void StripPathFromLastExtention(char *Path, char *StrippedPath) {
  int i;
  strcpy(StrippedPath, Path);
  for (i = (int)strlen(StrippedPath); i >= 0; i--)
    if (StrippedPath[i] == '.') {
      StrippedPath[i] = '\0';
      break;
    }
}


x86 assembly (clang, -O0):
<StripPathFromLastExtention>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     118c <StripPathFromLastExtention+0x6c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    1179 <StripPathFromLastExtention+0x59>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    118c <StripPathFromLastExtention+0x6c>
jmp    117e <StripPathFromLastExtention+0x5e>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <StripPathFromLastExtention+0x29>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StripPathFromLastExtention>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
js     1155 <StripPathFromLastExtention+0x35>
mov    %eax,%ecx
add    %rbx,%rcx
mov    %eax,%edx
cmpb   $0x2e,(%rbx,%rdx,1)
je     1157 <StripPathFromLastExtention+0x37>
lea    -0x1(%rax),%edx
add    $0xffffffffffffffff,%rcx
test   %eax,%eax
mov    %edx,%eax
jg     1140 <StripPathFromLastExtention+0x20>
pop    %rbx
ret
movb   $0x0,(%rcx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @StripPathFromLastExtention(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %1, i8* %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = trunc i64 %4 to i32
%6 = icmp sgt i32 %5, -1
br i1 %6, label %7, label %19
7: ; preds = %2, %16
%8 = phi i32 [ %17, %16 ], [ %5, %2 ]
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 46
br i1 %12, label %13, label %16
13: ; preds = %7
%14 = zext i32 %8 to i64
%15 = getelementptr inbounds i8, i8* %1, i64 %14
store i8 0, i8* %15
br label %19
16: ; preds = %7
%17 = add nsw i32 %8, -1
%18 = icmp sgt i32 %8, 0
br i1 %18, label %7, label %19
19: ; preds = %16, %2, %13
ret void
}