#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 check_translation(char const *, char const *, int /*<<< orphan*/ *,
                      char const *);
int /*<<< orphan*/ lou_free();
int main(int argc, char **argv) {
  int result = 0;
  const char *txt = "Fussball-Vereinigung";
  const char *table = "tests/tables/inpos_match_replace.ctb";
  const char *brl = "FUSSBALL-V7EINIGUNG";
  const int inpos[] = {0, 1,  2,  3,  4,  5,  6,  7,  8, 9,
                       9, 12, 13, 14, 15, 16, 17, 18, 19};
  result |= check_translation(table, txt, NULL, brl);
  result |= check_inpos(table, txt, inpos);
  lou_free();
  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)
movl   $0x0,-0x14(%rbp)
lea    0xe99(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xea3(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xebd(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xec4(%rip),%rsi
mov    $0x4c,%edx
call   1060 <memcpy@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edx
call   1030 <check_translation@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x80(%rbp),%rdx
call   1040 <check_inpos@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <lou_free@plt>
mov    -0x14(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
movups 0xf4d(%rip),%xmm0
movups %xmm0,0x3c(%rsp)
movaps 0xf35(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xf19(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xefd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xee1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xe9b(%rip),%rbx
lea    0xe7f(%rip),%r14
lea    0xeb2(%rip),%rcx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <check_translation@plt>
mov    %eax,%ebp
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <check_inpos@plt>
mov    %eax,%ebx
or     %ebp,%ebx
xor    %eax,%eax
call   1050 <lou_free@plt>
mov    %ebx,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Fussball-Vereinigung\00"
@.str.1 = [37 x i8] c"tests/tables/inpos_match_replace.ctb\00"
@.str.2 = [20 x i8] c"FUSSBALL-V7EINIGUNG\00"
@__const.main.inpos = [19 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 9, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca [19 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8** %9
%11 = bitcast [19 x i32]* %10 to i8*
%12 = load i8*, i8** %8
%13 = load i8*, i8** %7
%14 = load i8*, i8** %9
%15 = call i32 @check_translation(i8* %12, i8* %13, i32* null, i8* %14)
%16 = load i32, i32* %6
%17 = or i32 %16, %15
store i32 %17, i32* %6
%18 = load i8*, i8** %8
%19 = load i8*, i8** %7
%20 = getelementptr inbounds [19 x i32], [19 x i32]* %10, i64 0, i64 0
%21 = call i32 @check_inpos(i8* %18, i8* %19, i32* %20)
%22 = load i32, i32* %6
%23 = or i32 %22, %21
store i32 %23, i32* %6
%24 = call i32 (...) @lou_free()
%25 = load i32, i32* %6
ret i32 %25
}

LLVM IR (-O2):
@.str = [21 x i8] c"Fussball-Vereinigung\00"
@.str.1 = [37 x i8] c"tests/tables/inpos_match_replace.ctb\00"
@.str.2 = [20 x i8] c"FUSSBALL-V7EINIGUNG\00"
@__const.main.inpos = [19 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 9, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [19 x i32]
%4 = bitcast [19 x i32]* %3 to i8*
%5 = tail call i32 @check_translation(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%6 = getelementptr inbounds [19 x i32], [19 x i32]* %3, i64 0, i64 0
%7 = call i32 @check_inpos(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = or i32 %7, %5
%9 = call i32 (...) @lou_free()
ret i32 %8
}