#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*/ sprintf(char *, char *, size_t, char const *);
int /*<<< orphan*/ strchr(char const *, char const);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char const *);
char *process(char *resultStr, const char *textLines[], int linesNum,
              const char *extraStr) {
  size_t i, j;
  size_t co;
  size_t extra_str_len = strlen(extraStr);
  for (i = 0; i < linesNum; i++) {
    char good = 1;
    for (j = 0; j < extra_str_len; j++)
      if (!strchr(textLines[i], extraStr[j])) {
        good = 0;
        break;
      }
    if (good) {
      sprintf(resultStr, "%lu %s", i, textLines[i]);
      return resultStr;
    }
  }
  strcpy(resultStr, "No suitable string found!!1");
  return resultStr;
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x48(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmp    %rcx,%rax
jae    1229 <process+0xe9>
movb   $0x1,-0x49(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x48(%rbp),%rax
jae    11dc <process+0x9c>
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1050 <strchr@plt>
cmp    $0x0,%eax
jne    11c6 <process+0x86>
movb   $0x0,-0x49(%rbp)
jmp    11dc <process+0x9c>
jmp    11cb <process+0x8b>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1189 <process+0x49>
cmpb   $0x0,-0x49(%rbp)
je     1213 <process+0xd3>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xdff(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1241 <process+0x101>
jmp    1218 <process+0xd8>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    116c <process+0x2c>
mov    -0x10(%rbp),%rdi
lea    0xdd3(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r12
mov    %edx,%ebx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rcx,%rdi
call   1040 <strlen@plt>
test   %ebx,%ebx
je     11aa <process+0x6a>
mov    %rax,%r13
movslq %ebx,%rax
mov    %rax,(%rsp)
xor    %ebx,%ebx
test   %r13,%r13
je     11bb <process+0x7b>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,8),%rdi
movsbl (%r12,%rbp,1),%esi
call   1050 <strchr@plt>
test   %eax,%eax
je     11a0 <process+0x60>
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1180 <process+0x40>
jmp    11bd <process+0x7d>
nopl   (%rax)
add    $0x1,%rbx
cmp    (%rsp),%rbx
jne    116e <process+0x2e>
lea    0xe56(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
jmp    11d3 <process+0x93>
xor    %ebx,%ebx
mov    (%r15,%rbx,8),%rcx
lea    0xe38(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1060 <sprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%lu %s\00"
@.str.1 = [28 x i8] c"No suitable string found!!1\00"
define i8* @process(i8* %0, i8** %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i8
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%15 = load i8*, i8** %9
%16 = call i64 @strlen(i8* %15)
store i64 %16, i64* %13
store i64 0, i64* %10
br label %17
17: ; preds = %56, %4
%18 = load i64, i64* %10
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = icmp ult i64 %18, %20
br i1 %21, label %22, label %59
22: ; preds = %17
store i8 1, i8* %14
store i64 0, i64* %11
br label %23
23: ; preds = %40, %22
%24 = load i64, i64* %11
%25 = load i64, i64* %13
%26 = icmp ult i64 %24, %25
br i1 %26, label %27, label %43
27: ; preds = %23
%28 = load i8**, i8*** %7
%29 = load i64, i64* %10
%30 = getelementptr inbounds i8*, i8** %28, i64 %29
%31 = load i8*, i8** %30
%32 = load i8*, i8** %9
%33 = load i64, i64* %11
%34 = getelementptr inbounds i8, i8* %32, i64 %33
%35 = load i8, i8* %34
%36 = call i32 @strchr(i8* %31, i8 signext %35)
%37 = icmp ne i32 %36, 0
br i1 %37, label %39, label %38
38: ; preds = %27
store i8 0, i8* %14
br label %43
39: ; preds = %27
br label %40
40: ; preds = %39
%41 = load i64, i64* %11
%42 = add i64 %41, 1
store i64 %42, i64* %11
br label %23
43: ; preds = %38, %23
%44 = load i8, i8* %14
%45 = icmp ne i8 %44, 0
br i1 %45, label %46, label %55
46: ; preds = %43
%47 = load i8*, i8** %6
%48 = load i64, i64* %10
%49 = load i8**, i8*** %7
%50 = load i64, i64* %10
%51 = getelementptr inbounds i8*, i8** %49, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 @sprintf(i8* %47, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %48, i8* %52)
%54 = load i8*, i8** %6
store i8* %54, i8** %5
br label %63
55: ; preds = %43
br label %56
56: ; preds = %55
%57 = load i64, i64* %10
%58 = add i64 %57, 1
store i64 %58, i64* %10
br label %17
59: ; preds = %17
%60 = load i8*, i8** %6
%61 = call i32 @strcpy(i8* %60, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%62 = load i8*, i8** %6
store i8* %62, i8** %5
br label %63
63: ; preds = %59, %46
%64 = load i8*, i8** %5
ret i8* %64
}

LLVM IR (-O2):
@.str = [7 x i8] c"%lu %s\00"
@.str.1 = [28 x i8] c"No suitable string found!!1\00"
define i8* @process(i8* %0, i8** nocapture %1, i32 %2, i8* nocapture %3) {
%5 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%6 = icmp eq i32 %2, 0
br i1 %6, label %32, label %7
7: ; preds = %4
%8 = icmp eq i64 %5, 0
%9 = sext i32 %2 to i64
br label %10
10: ; preds = %7, %29
%11 = phi i64 [ 0, %7 ], [ %30, %29 ]
br i1 %8, label %24, label %12
12: ; preds = %10
%13 = getelementptr inbounds i8*, i8** %1, i64 %11
br label %16
14: ; preds = %16
%15 = icmp eq i64 %23, %5
br i1 %15, label %24, label %16
16: ; preds = %12, %14
%17 = phi i64 [ 0, %12 ], [ %23, %14 ]
%18 = load i8*, i8** %13
%19 = getelementptr inbounds i8, i8* %3, i64 %17
%20 = load i8, i8* %19
%21 = tail call i32 @strchr(i8* %18, i8 signext %20)
%22 = icmp eq i32 %21, 0
%23 = add nuw i64 %17, 1
br i1 %22, label %29, label %14
24: ; preds = %10, %14
%25 = phi i64 [ %11, %14 ], [ 0, %10 ]
%26 = getelementptr inbounds i8*, i8** %1, i64 %25
%27 = load i8*, i8** %26
%28 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %25, i8* %27)
br label %34
29: ; preds = %16
%30 = add nuw i64 %11, 1
%31 = icmp eq i64 %30, %9
br i1 %31, label %32, label %10
32: ; preds = %29, %4
%33 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %24, %32
ret i8* %0
}