#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 strlen(char *);
void StripLevel(char *sString) {
  int i;
  int dString;
  dString = strlen(sString) - 1;
  for (i = dString; i >= 0; i--) {
    if (sString[i] == '/') {
      sString[i] = 0;
      return;
    }
  }
  sString[0] = 0;
}


x86 assembly (clang, -O0):
<StripLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1174 <StripLevel+0x64>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1161 <StripLevel+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    117b <StripLevel+0x6b>
jmp    1166 <StripLevel+0x56>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <StripLevel+0x21>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StripLevel>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%eax
nopl   0x0(%rax,%rax,1)
test   %eax,%eax
jle    1137 <StripLevel+0x27>
lea    -0x1(%rax),%rcx
cmpb   $0x2f,-0x1(%rbx,%rax,1)
mov    %rcx,%rax
jne    1120 <StripLevel+0x10>
mov    %ecx,%eax
add    %rax,%rbx
movb   $0x0,(%rbx)
pop    %rbx
ret

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

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