#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*/ *strchr(char const *, char const);
int strlen(char const *);
int pos_suffix_not_containing(const char *s, const char *sep) {
  int pos = strlen(s);
  while (pos != 0 && strchr(sep, s[pos - 1] & 0xff) == NULL) {
    pos--;
  }
  return (pos);
}


x86 assembly (clang, -O0):
<pos_suffix_not_containing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
je     1177 <pos_suffix_not_containing+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xff,%eax
movsbl %al,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1187 <pos_suffix_not_containing+0x67>
jmp    1195 <pos_suffix_not_containing+0x75>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113c <pos_suffix_not_containing+0x1c>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos_suffix_not_containing>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
movslq %eax,%rcx
lea    0x1(%rcx),%ebp
mov    %rcx,%rbx
nopl   0x0(%rax,%rax,1)
sub    $0x1,%rbx
jb     1161 <pos_suffix_not_containing+0x41>
movsbl -0x1(%r15,%rcx,1),%esi
mov    %r14,%rdi
call   1040 <strchr@plt>
add    $0xffffffff,%ebp
mov    %rbx,%rcx
test   %rax,%rax
je     1140 <pos_suffix_not_containing+0x20>
jmp    1163 <pos_suffix_not_containing+0x43>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pos_suffix_not_containing(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** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
br label %8
8: ; preds = %26, %2
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = call i32* @strchr(i8* %12, i8 signext %21)
%23 = icmp eq i32* %22, null
br label %24
24: ; preds = %11, %8
%25 = phi i1 [ false, %8 ], [ %23, %11 ]
br i1 %25, label %26, label %29
26: ; preds = %24
%27 = load i32, i32* %5
%28 = add nsw i32 %27, -1
store i32 %28, i32* %5
br label %8
29: ; preds = %24
%30 = load i32, i32* %5
ret i32 %30
}

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