#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 *rindex(char *, char);
int main(int argc, char *argv[]) {
  printf("%s\n", rindex("azertyuiop", 'a'));
  printf("%s\n", rindex("azertyuiop", 'z'));
  printf("%s\n", rindex("azertyuiop", 'e'));
  printf("%s\n", rindex("azertyuiop", 'r'));
  printf("%s\n", rindex("azertyuiop", 't'));
  printf("%s\n", rindex("azertyuiop", 'y'));
  printf("%s\n", rindex("azertyuiop", 'u'));
  printf("%s\n", rindex("azertyuiop", 'i'));
  printf("%s\n", rindex("azertyuiop", 'o'));
  printf("%s\n", rindex("azertyuiop", 'p'));
  printf("%p\n", rindex("azertyu", 'p'));
  printf("%p\n", rindex("", 'p'));
  printf("%s\n", rindex("adrien", 'a'));
  printf("%p\n", rindex("toto", 'c'));
  printf("%s\n", rindex("tata", 'a'));
  printf("%s\n", rindex("azpodfpqzeojkfpisdjfqsdpio?f,", '?'));
  printf(
      "%s\n",
      rindex("azpodfpqzeojkfpisdjfqsdpioezdqfsofhqsjkld=fhlqsdhfoqsdifhqsdkl="
             "fhqsdljfisdfuosdpfgiqsjdgojzprjhgiosqhposjqdfgosdjqfpjqzio?"
             "fiosdjfsdiqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq"
             "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqf,",
             'q'));
  printf("%p\n", rindex("qefvgodshfqio", ' '));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x61,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
mov    $0x7a,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe87(%rip),%rdi
mov    $0x65,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe67(%rip),%rdi
mov    $0x72,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe47(%rip),%rdi
mov    $0x74,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe27(%rip),%rdi
mov    $0x79,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe07(%rip),%rdi
mov    $0x75,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xdef(%rip),%rdi
call   1030 <printf@plt>
lea    0xde7(%rip),%rdi
mov    $0x69,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xdcf(%rip),%rdi
call   1030 <printf@plt>
lea    0xdc7(%rip),%rdi
mov    $0x6f,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xdaf(%rip),%rdi
call   1030 <printf@plt>
lea    0xda7(%rip),%rdi
mov    $0x70,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xd8f(%rip),%rdi
call   1030 <printf@plt>
lea    0xd96(%rip),%rdi
mov    $0x70,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xd7e(%rip),%rdi
call   1030 <printf@plt>
lea    0xd75(%rip),%rdi
mov    $0x70,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xd5e(%rip),%rdi
call   1030 <printf@plt>
lea    0xd5e(%rip),%rdi
mov    $0x61,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xd2f(%rip),%rdi
call   1030 <printf@plt>
lea    0xd45(%rip),%rdi
mov    $0x63,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xd1e(%rip),%rdi
call   1030 <printf@plt>
lea    0xd2a(%rip),%rdi
mov    $0x61,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xcef(%rip),%rdi
call   1030 <printf@plt>
lea    0xd0f(%rip),%rdi
mov    $0x3f,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xccf(%rip),%rdi
call   1030 <printf@plt>
lea    0xd0d(%rip),%rdi
mov    $0x71,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xcaf(%rip),%rdi
call   1030 <printf@plt>
lea    0xdd7(%rip),%rdi
mov    $0x20,%esi
call   1040 <rindex@plt>
mov    %rax,%rsi
lea    0xc9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
call   1040 <rindex@plt>
lea    0xec1(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7a,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x65,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x72,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x74,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x79,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x75,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x69,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6f,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x70,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xdea(%rip),%rdi
mov    $0x70,%esi
call   1040 <rindex@plt>
lea    0xdd5(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xdc6(%rip),%rdi
mov    $0x70,%esi
call   1040 <rindex@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xdb3(%rip),%rdi
mov    $0x61,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xd9e(%rip),%rdi
mov    $0x63,%esi
call   1040 <rindex@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xd87(%rip),%rdi
mov    $0x61,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xd70(%rip),%rdi
mov    $0x3f,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xd72(%rip),%rdi
mov    $0x71,%esi
call   1040 <rindex@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xe40(%rip),%rdi
mov    $0x20,%esi
call   1040 <rindex@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"azertyuiop\00"
@.str.2 = [4 x i8] c"%p\0A\00"
@.str.3 = [8 x i8] c"azertyu\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [7 x i8] c"adrien\00"
@.str.6 = [5 x i8] c"toto\00"
@.str.7 = [5 x i8] c"tata\00"
@.str.8 = [30 x i8] c"azpodfpqzeojkfpisdjfqsdpio?f,\00"
@.str.9 = [234 x i8] c"azpodfpqzeojkfpisdjfqsdpioezdqfsofhqsjkld=fhlqsdhfoqsdifhqsdkl=fhqsdljfisdfuosdpfgiqsjdgojzprjhgiosqhposjqdfgosdjqfpjqzio?fiosdjfsdiqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqf,\00"
@.str.10 = [14 x i8] c"qefvgodshfqio\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 97)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 122)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 101)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 114)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 116)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 121)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 117)
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 105)
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 111)
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 112)
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = call i8* @rindex(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8 signext 112)
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = call i8* @rindex(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8 signext 112)
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %28)
%30 = call i8* @rindex(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8 signext 97)
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %30)
%32 = call i8* @rindex(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8 signext 99)
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %32)
%34 = call i8* @rindex(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8 signext 97)
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %34)
%36 = call i8* @rindex(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i8 signext 63)
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %36)
%38 = call i8* @rindex(i8* getelementptr inbounds ([234 x i8], [234 x i8]* @.str.9, i64 0, i64 0), i8 signext 113)
%39 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %38)
%40 = call i8* @rindex(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8 signext 32)
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"azertyuiop\00"
@.str.2 = [4 x i8] c"%p\0A\00"
@.str.3 = [8 x i8] c"azertyu\00"
@.str.4 = [1 x i8] zeroinitializer
@.str.5 = [7 x i8] c"adrien\00"
@.str.6 = [5 x i8] c"toto\00"
@.str.7 = [5 x i8] c"tata\00"
@.str.8 = [30 x i8] c"azpodfpqzeojkfpisdjfqsdpio?f,\00"
@.str.9 = [234 x i8] c"azpodfpqzeojkfpisdjfqsdpioezdqfsofhqsjkld=fhlqsdhfoqsdifhqsdkl=fhqsdljfisdfuosdpfgiqsjdgojzprjhgiosqhposjqdfgosdjqfpjqzio?fiosdjfsdiqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqf,\00"
@.str.10 = [14 x i8] c"qefvgodshfqio\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 97)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 122)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 101)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 114)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = tail call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 116)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = tail call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 121)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = tail call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 117)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = tail call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 105)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = tail call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 111)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = tail call i8* @rindex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext 112)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = tail call i8* @rindex(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8 signext 112)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = tail call i8* @rindex(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8 signext 112)
%26 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %25)
%27 = tail call i8* @rindex(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8 signext 97)
%28 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %27)
%29 = tail call i8* @rindex(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8 signext 99)
%30 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %29)
%31 = tail call i8* @rindex(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8 signext 97)
%32 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %31)
%33 = tail call i8* @rindex(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i8 signext 63)
%34 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %33)
%35 = tail call i8* @rindex(i8* getelementptr inbounds ([234 x i8], [234 x i8]* @.str.9, i64 0, i64 0), i8 signext 113)
%36 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %35)
%37 = tail call i8* @rindex(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8 signext 32)
%38 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %37)
ret i32 0
}