#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*/ printf(char *, char *);
char *strrchr(char *, char);
int main() {
  printf("%s\n", strrchr("dfsf/dsfsdfds/fdsfdsf", '/'));
  printf("%s\n", strrchr("dfsf/dsfsdfds///1fdsfdsf", '/'));
  printf("%s\n", strrchr("dfsf/dsfsdfds//fdsfdsf", '/'));
  printf("%s\n", strrchr("dfsf/dsfsdfds//fdsfdsf/", '/'));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,%rsi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,%rsi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
lea    0xef2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xefb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xf04(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xf14(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [22 x i8] c"dfsf/dsfsdfds/fdsfdsf\00"
@.str.2 = [25 x i8] c"dfsf/dsfsdfds///1fdsfdsf\00"
@.str.3 = [23 x i8] c"dfsf/dsfsdfds//fdsfdsf\00"
@.str.4 = [24 x i8] c"dfsf/dsfsdfds//fdsfdsf/\00"
define i32 @main() {
%1 = call i8* @strrchr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8 signext 47)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = call i8* @strrchr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8 signext 47)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i8* @strrchr(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8 signext 47)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i8* @strrchr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8 signext 47)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [22 x i8] c"dfsf/dsfsdfds/fdsfdsf\00"
@.str.2 = [25 x i8] c"dfsf/dsfsdfds///1fdsfdsf\00"
@.str.3 = [23 x i8] c"dfsf/dsfsdfds//fdsfdsf\00"
@.str.4 = [24 x i8] c"dfsf/dsfsdfds//fdsfdsf/\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 13))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 15))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 14))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 22))
ret i32 0
}