#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 *rtl_isIn(char *, char *);
char *strchr(char *, int /*<<< orphan*/);
char *rtl_skipto(char *in, char *end) {
  char *pt;
  char *pos;
  pt = in;
  while (*pt) {
    pos = rtl_isIn(pt, end);
    if (pos) {
      return pos;
    }
    pt++;
  }
  return strchr(in, 0);
}


x86 assembly (clang, -O0):
<rtl_skipto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     117f <rtl_skipto+0x5f>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <rtl_isIn@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     116e <rtl_skipto+0x4e>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118e <rtl_skipto+0x6e>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1138 <rtl_skipto+0x18>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl_skipto>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
cmpb   $0x0,(%rdi)
je     115a <rtl_skipto+0x3a>
mov    %rsi,%r15
mov    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <rtl_isIn@plt>
test   %rax,%rax
jne    1165 <rtl_skipto+0x45>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1140 <rtl_skipto+0x20>
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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