#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 check_inpos(char const *, char const *, int const *);
int main(int argc, char **argv) {
  const char *table = "pass2.ctb";
  int result = 0;
  const char *str1 = "Rene";
  const int expected_inpos1[] = {0, 1, 2, 3, 3};
  result |= check_inpos(table, str1, expected_inpos1);
  const char *str2 = "Reno";
  const int expected_inpos2[] = {0, 1, 2, 3, 3};
  result |= check_inpos(table, str2, expected_inpos2);
  const char *str3 = "xRen";
  const int expected_inpos3[] = {1, 2, 3};
  result |= check_inpos(table, str3, expected_inpos3);
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed0(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xec8(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <check_inpos@plt>
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0xe8c(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xeb2(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xeaf(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xead(%rip),%eax
mov    %eax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x48(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1030 <check_inpos@plt>
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0xe50(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe85(%rip),%rax
mov    %rax,-0x74(%rbp)
mov    0xe83(%rip),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x68(%rbp),%rsi
lea    -0x74(%rbp),%rdx
call   1030 <check_inpos@plt>
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    0xf12(%rip),%ebx
mov    %ebx,0x40(%rsp)
movaps 0xef7(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0xecb(%rip),%r14
lea    0xece(%rip),%rsi
lea    0x30(%rsp),%rdx
mov    %r14,%rdi
call   1030 <check_inpos@plt>
mov    %eax,%ebp
mov    %ebx,0x20(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xead(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %r14,%rdi
call   1030 <check_inpos@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    0xec3(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xeb0(%rip),%rax
mov    %rax,(%rsp)
lea    0xe85(%rip),%rsi
mov    %rsp,%rdx
mov    %r14,%rdi
call   1030 <check_inpos@plt>
or     %ebx,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"pass2.ctb\00"
@.str.1 = [5 x i8] c"Rene\00"
@__const.main.expected_inpos1 = [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 3]
@.str.2 = [5 x i8] c"Reno\00"
@__const.main.expected_inpos2 = [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 3]
@.str.3 = [5 x i8] c"xRen\00"
@__const.main.expected_inpos3 = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [5 x i32]
%10 = alloca i8*
%11 = alloca [5 x i32]
%12 = alloca i8*
%13 = alloca [3 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %6
store i32 0, i32* %7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %8
%14 = bitcast [5 x i32]* %9 to i8*
%15 = load i8*, i8** %6
%16 = load i8*, i8** %8
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%18 = call i32 @check_inpos(i8* %15, i8* %16, i32* %17)
%19 = load i32, i32* %7
%20 = or i32 %19, %18
store i32 %20, i32* %7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %10
%21 = bitcast [5 x i32]* %11 to i8*
%22 = load i8*, i8** %6
%23 = load i8*, i8** %10
%24 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 0
%25 = call i32 @check_inpos(i8* %22, i8* %23, i32* %24)
%26 = load i32, i32* %7
%27 = or i32 %26, %25
store i32 %27, i32* %7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %12
%28 = bitcast [3 x i32]* %13 to i8*
%29 = load i8*, i8** %6
%30 = load i8*, i8** %12
%31 = getelementptr inbounds [3 x i32], [3 x i32]* %13, i64 0, i64 0
%32 = call i32 @check_inpos(i8* %29, i8* %30, i32* %31)
%33 = load i32, i32* %7
%34 = or i32 %33, %32
store i32 %34, i32* %7
%35 = load i32, i32* %7
ret i32 %35
}

LLVM IR (-O2):
@.str = [10 x i8] c"pass2.ctb\00"
@.str.1 = [5 x i8] c"Rene\00"
@.str.2 = [5 x i8] c"Reno\00"
@__const.main.expected_inpos2 = [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 3]
@.str.3 = [5 x i8] c"xRen\00"
@__const.main.expected_inpos3 = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i32]
%4 = alloca [5 x i32]
%5 = alloca [3 x i32]
%6 = bitcast [5 x i32]* %3 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%8 = call i32 @check_inpos(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = bitcast [5 x i32]* %4 to i8*
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%11 = call i32 @check_inpos(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %10)
%12 = or i32 %11, %8
%13 = bitcast [3 x i32]* %5 to i8*
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%15 = call i32 @check_inpos(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* %14)
%16 = or i32 %12, %15
ret i32 %16
}