#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 */
char *drop_path(char *s) {
  char *tail = NULL;
  char *t;
  for (t = s; *t; t++) {
    if (*t == '/')
      tail = t;
  }
  if (tail == NULL) {
    return s;
  } else {
    tail++;
    return tail;
  }
}


x86 assembly (clang, -O0):
<drop_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <drop_path+0x53>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    113d <drop_path+0x3d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1142 <drop_path+0x42>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <drop_path+0x18>
cmpq   $0x0,-0x18(%rbp)
jne    116b <drop_path+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <drop_path+0x7f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_path>:
xor    %ecx,%ecx
mov    %rdi,%rax
jmp    1117 <drop_path+0x17>
nopw   0x0(%rax,%rax,1)
mov    %rax,%rcx
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x2f,%dl
je     1110 <drop_path+0x10>
test   %dl,%dl
jne    1113 <drop_path+0x13>
lea    0x1(%rcx),%rax
test   %rcx,%rcx
cmove  %rdi,%rax
ret

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

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