#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 */
short instr_q168ilut(short);
int /*<<< orphan*/ printf(char *, ...);
short prog_q168ilut(short);
scalar_t__ rand();
int Q16_8_IndexLUT_AUTOTEST() {
  printf("LAUNCHING THE (Q16_8_IndexLUT) RESOURCE AUTOTEST...\n");
  int i, j;
  for (j = 0; j < 10; j++) {
    short op1 = (short)(((int)rand()) % 1824);
    short op3 = prog_q168ilut(op1);
    short op2 = instr_q168ilut(op1);
    if (op2 != op3) {
      printf("- TEST OF THE (Q16_8_IndexLUT) RESOURCE => FAILED !\n");
      printf("  + %d COMPUTATION(s) BEFORE ERROR...\n", j);
      printf("  + OPERANDE 1 [%d]\n", op1);
      printf("  + ASM INSTR. [%d]\n", op2);
      printf("  + REF C CODE [%d]\n", op3);
      return 0;
    }
  }
  printf("- TEST OF THE (Q16_8_IndexLUT) RESOURCE => OK\n");
  return 1;
}


x86 assembly (clang, -O0):
<Q16_8_IndexLUT_AUTOTEST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    121b <Q16_8_IndexLUT_AUTOTEST+0xdb>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x720,%ecx
cltd
idiv   %ecx
mov    %dx,%ax
mov    %ax,-0xe(%rbp)
movswl -0xe(%rbp),%edi
call   1040 <prog_q168ilut@plt>
mov    %ax,-0x10(%rbp)
movswl -0xe(%rbp),%edi
call   1050 <instr_q168ilut@plt>
mov    %ax,-0x12(%rbp)
movswl -0x12(%rbp),%eax
movswl -0x10(%rbp),%ecx
cmp    %ecx,%eax
je     1208 <Q16_8_IndexLUT_AUTOTEST+0xc8>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movswl -0xe(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movswl -0x12(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movswl -0x10(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1230 <Q16_8_IndexLUT_AUTOTEST+0xf0>
jmp    120d <Q16_8_IndexLUT_AUTOTEST+0xcd>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <Q16_8_IndexLUT_AUTOTEST+0x1d>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q16_8_IndexLUT_AUTOTEST>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xf04(%rip),%rdi
call   1030 <puts@plt>
xor    %r14d,%r14d
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r13
imul   $0xffffffff8fb823ef,%r13,%rax
shr    $0x20,%rax
add    %r13d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xa,%eax
add    %ecx,%eax
imul   $0x720,%eax,%eax
sub    %eax,%r13d
movswl %r13w,%ebp
mov    %ebp,%edi
call   1050 <prog_q168ilut@plt>
mov    %eax,%r12d
mov    %ebp,%edi
call   1060 <instr_q168ilut@plt>
cmp    %r12w,%ax
jne    1461 <Q16_8_IndexLUT_AUTOTEST+0x311>
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r13
imul   $0xffffffff8fb823ef,%r13,%rax
shr    $0x20,%rax
add    %r13d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xa,%eax
add    %ecx,%eax
imul   $0x720,%eax,%eax
sub    %eax,%r13d
movswl %r13w,%ebx
mov    %ebx,%edi
call   1050 <prog_q168ilut@plt>
mov    %eax,%r12d
mov    %ebx,%edi
call   1060 <instr_q168ilut@plt>
cmp    %r12w,%ax
jne    1466 <Q16_8_IndexLUT_AUTOTEST+0x316>
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r13
imul   $0xffffffff8fb823ef,%r13,%rax
shr    $0x20,%rax
add    %r13d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xa,%eax
add    %ecx,%eax
imul   $0x720,%eax,%eax
sub    %eax,%r13d
movswl %r13w,%ebx
mov    %ebx,%edi
call   1050 <prog_q168ilut@plt>
mov    %eax,%r12d
mov    %ebx,%edi
call   1060 <instr_q168ilut@plt>
cmp    %r12w,%ax
jne    146e <Q16_8_IndexLUT_AUTOTEST+0x31e>
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r13
imul   $0xffffffff8fb823ef,%r13,%rax
shr    $0x20,%rax
add    %r13d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xa,%eax
add    %ecx,%eax
imul   $0x720,%eax,%eax
sub    %eax,%r13d
movswl %r13w,%ebx
mov    %ebx,%edi
call   1050 <prog_q168ilut@plt>
mov    %eax,%r12d
mov    %ebx,%edi
call   1060 <instr_q168ilut@plt>
cmp    %r12w,%ax
jne    1476 <Q16_8_IndexLUT_AUTOTEST+0x326>
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r13
imul   $0xffffffff8fb823ef,%r13,%rax
shr    $0x20,%rax
add    %r13d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xa,%eax
add    %ecx,%eax
imul   $0x720,%eax,%eax
sub    %eax,%r13d
movswl %r13w,%ebx
mov    %ebx,%edi
call   1050 <prog_q168ilut@plt>
mov    %eax,%r12d
mov    %ebx,%edi
call   1060 <instr_q168ilut@plt>
cmp    %r12w,%ax
jne    147e <Q16_8_IndexLUT_AUTOTEST+0x32e>
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r13
imul   $0xffffffff8fb823ef,%r13,%rax
shr    $0x20,%rax
add    %r13d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xa,%eax
add    %ecx,%eax
imul   $0x720,%eax,%eax
sub    %eax,%r13d
movswl %r13w,%ebx
mov    %ebx,%edi
call   1050 <prog_q168ilut@plt>
mov    %eax,%r12d
mov    %ebx,%edi
call   1060 <instr_q168ilut@plt>
cmp    %r12w,%ax
jne    1486 <Q16_8_IndexLUT_AUTOTEST+0x336>
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r13
imul   $0xffffffff8fb823ef,%r13,%rax
shr    $0x20,%rax
add    %r13d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xa,%eax
add    %ecx,%eax
imul   $0x720,%eax,%eax
sub    %eax,%r13d
movswl %r13w,%ebx
mov    %ebx,%edi
call   1050 <prog_q168ilut@plt>
mov    %eax,%r12d
mov    %ebx,%edi
call   1060 <instr_q168ilut@plt>
cmp    %r12w,%ax
jne    148e <Q16_8_IndexLUT_AUTOTEST+0x33e>
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r13
imul   $0xffffffff8fb823ef,%r13,%rax
shr    $0x20,%rax
add    %r13d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xa,%eax
add    %ecx,%eax
imul   $0x720,%eax,%eax
sub    %eax,%r13d
movswl %r13w,%ebx
mov    %ebx,%edi
call   1050 <prog_q168ilut@plt>
mov    %eax,%r12d
mov    %ebx,%edi
call   1060 <instr_q168ilut@plt>
cmp    %r12w,%ax
jne    1496 <Q16_8_IndexLUT_AUTOTEST+0x346>
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r13
imul   $0xffffffff8fb823ef,%r13,%rax
shr    $0x20,%rax
add    %r13d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xa,%eax
add    %ecx,%eax
imul   $0x720,%eax,%eax
sub    %eax,%r13d
movswl %r13w,%ebx
mov    %ebx,%edi
call   1050 <prog_q168ilut@plt>
mov    %eax,%r12d
mov    %ebx,%edi
call   1060 <instr_q168ilut@plt>
cmp    %r12w,%ax
jne    149e <Q16_8_IndexLUT_AUTOTEST+0x34e>
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r13
imul   $0xffffffff8fb823ef,%r13,%rax
shr    $0x20,%rax
add    %r13d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xa,%eax
add    %ecx,%eax
imul   $0x720,%eax,%eax
sub    %eax,%r13d
movswl %r13w,%ebx
mov    %ebx,%edi
call   1050 <prog_q168ilut@plt>
mov    %eax,%r12d
mov    %ebx,%edi
call   1060 <instr_q168ilut@plt>
cmp    %r12w,%ax
jne    14a6 <Q16_8_IndexLUT_AUTOTEST+0x356>
lea    0xc49(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%r14d
jmp    1501 <Q16_8_IndexLUT_AUTOTEST+0x3b1>
xor    %r15d,%r15d
jmp    14ac <Q16_8_IndexLUT_AUTOTEST+0x35c>
mov    $0x1,%r15d
jmp    14ac <Q16_8_IndexLUT_AUTOTEST+0x35c>
mov    $0x2,%r15d
jmp    14ac <Q16_8_IndexLUT_AUTOTEST+0x35c>
mov    $0x3,%r15d
jmp    14ac <Q16_8_IndexLUT_AUTOTEST+0x35c>
mov    $0x4,%r15d
jmp    14ac <Q16_8_IndexLUT_AUTOTEST+0x35c>
mov    $0x5,%r15d
jmp    14ac <Q16_8_IndexLUT_AUTOTEST+0x35c>
mov    $0x6,%r15d
jmp    14ac <Q16_8_IndexLUT_AUTOTEST+0x35c>
mov    $0x7,%r15d
jmp    14ac <Q16_8_IndexLUT_AUTOTEST+0x35c>
mov    $0x8,%r15d
jmp    14ac <Q16_8_IndexLUT_AUTOTEST+0x35c>
mov    $0x9,%r15d
movswl %r12w,%ebp
movswl %ax,%ebx
lea    0xc0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xb3a(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xb50(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xb54(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xb59(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [53 x i8] c"LAUNCHING THE (Q16_8_IndexLUT) RESOURCE AUTOTEST...\0A\00"
@.str.1 = [53 x i8] c"- TEST OF THE (Q16_8_IndexLUT) RESOURCE => FAILED !\0A\00"
@.str.2 = [39 x i8] c" + %d COMPUTATION(s) BEFORE ERROR...\0A\00"
@.str.3 = [21 x i8] c" + OPERANDE 1 [%d]\0A\00"
@.str.4 = [21 x i8] c" + ASM INSTR. [%d]\0A\00"
@.str.5 = [21 x i8] c" + REF C CODE [%d]\0A\00"
@.str.6 = [47 x i8] c"- TEST OF THE (Q16_8_IndexLUT) RESOURCE => OK\0A\00"
define i32 @Q16_8_IndexLUT_AUTOTEST() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %8
8: ; preds = %39, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %42
11: ; preds = %8
%12 = call i64 (...) @rand()
%13 = trunc i64 %12 to i32
%14 = srem i32 %13, 1824
%15 = trunc i32 %14 to i16
store i16 %15, i16* %4
%16 = load i16, i16* %4
%17 = call signext i16 @prog_q168ilut(i16 signext %16)
store i16 %17, i16* %5
%18 = load i16, i16* %4
%19 = call signext i16 @instr_q168ilut(i16 signext %18)
store i16 %19, i16* %6
%20 = load i16, i16* %6
%21 = sext i16 %20 to i32
%22 = load i16, i16* %5
%23 = sext i16 %22 to i32
%24 = icmp ne i32 %21, %23
br i1 %24, label %25, label %38
25: ; preds = %11
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%27 = load i32, i32* %3
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %27)
%29 = load i16, i16* %4
%30 = sext i16 %29 to i32
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %30)
%32 = load i16, i16* %6
%33 = sext i16 %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %33)
%35 = load i16, i16* %5
%36 = sext i16 %35 to i32
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %36)
store i32 0, i32* %1
br label %44
38: ; preds = %11
br label %39
39: ; preds = %38
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
br label %8
42: ; preds = %8
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %1
br label %44
44: ; preds = %42, %25
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
@.str.2 = [39 x i8] c" + %d COMPUTATION(s) BEFORE ERROR...\0A\00"
@.str.3 = [21 x i8] c" + OPERANDE 1 [%d]\0A\00"
@.str.4 = [21 x i8] c" + ASM INSTR. [%d]\0A\00"
@.str.5 = [21 x i8] c" + REF C CODE [%d]\0A\00"
@str = [52 x i8] c"LAUNCHING THE (Q16_8_IndexLUT) RESOURCE AUTOTEST...\00"
@str.7 = [46 x i8] c"- TEST OF THE (Q16_8_IndexLUT) RESOURCE => OK\00"
@str.8 = [52 x i8] c"- TEST OF THE (Q16_8_IndexLUT) RESOURCE => FAILED !\00"
define i32 @Q16_8_IndexLUT_AUTOTEST() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 (...) @rand()
%3 = trunc i64 %2 to i32
%4 = srem i32 %3, 1824
%5 = trunc i32 %4 to i16
%6 = tail call signext i16 @prog_q168ilut(i16 signext %5)
%7 = tail call signext i16 @instr_q168ilut(i16 signext %5)
%8 = icmp eq i16 %7, %6
br i1 %8, label %21, label %9
9: ; preds = %85, %77, %69, %61, %53, %45, %37, %29, %21, %0
%10 = phi i32 [ 0, %0 ], [ 1, %21 ], [ 2, %29 ], [ 3, %37 ], [ 4, %45 ], [ 5, %53 ], [ 6, %61 ], [ 7, %69 ], [ 8, %77 ], [ 9, %85 ]
%11 = phi i32 [ %4, %0 ], [ %24, %21 ], [ %32, %29 ], [ %40, %37 ], [ %48, %45 ], [ %56, %53 ], [ %64, %61 ], [ %72, %69 ], [ %80, %77 ], [ %88, %85 ]
%12 = phi i16 [ %6, %0 ], [ %26, %21 ], [ %34, %29 ], [ %42, %37 ], [ %50, %45 ], [ %58, %53 ], [ %66, %61 ], [ %74, %69 ], [ %82, %77 ], [ %90, %85 ]
%13 = phi i16 [ %7, %0 ], [ %27, %21 ], [ %35, %29 ], [ %43, %37 ], [ %51, %45 ], [ %59, %53 ], [ %67, %61 ], [ %75, %69 ], [ %83, %77 ], [ %91, %85 ]
%14 = sext i16 %12 to i32
%15 = sext i16 %13 to i32
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.8, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %15)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %14)
br label %95
21: ; preds = %0
%22 = tail call i64 (...) @rand()
%23 = trunc i64 %22 to i32
%24 = srem i32 %23, 1824
%25 = trunc i32 %24 to i16
%26 = tail call signext i16 @prog_q168ilut(i16 signext %25)
%27 = tail call signext i16 @instr_q168ilut(i16 signext %25)
%28 = icmp eq i16 %27, %26
br i1 %28, label %29, label %9
29: ; preds = %21
%30 = tail call i64 (...) @rand()
%31 = trunc i64 %30 to i32
%32 = srem i32 %31, 1824
%33 = trunc i32 %32 to i16
%34 = tail call signext i16 @prog_q168ilut(i16 signext %33)
%35 = tail call signext i16 @instr_q168ilut(i16 signext %33)
%36 = icmp eq i16 %35, %34
br i1 %36, label %37, label %9
37: ; preds = %29
%38 = tail call i64 (...) @rand()
%39 = trunc i64 %38 to i32
%40 = srem i32 %39, 1824
%41 = trunc i32 %40 to i16
%42 = tail call signext i16 @prog_q168ilut(i16 signext %41)
%43 = tail call signext i16 @instr_q168ilut(i16 signext %41)
%44 = icmp eq i16 %43, %42
br i1 %44, label %45, label %9
45: ; preds = %37
%46 = tail call i64 (...) @rand()
%47 = trunc i64 %46 to i32
%48 = srem i32 %47, 1824
%49 = trunc i32 %48 to i16
%50 = tail call signext i16 @prog_q168ilut(i16 signext %49)
%51 = tail call signext i16 @instr_q168ilut(i16 signext %49)
%52 = icmp eq i16 %51, %50
br i1 %52, label %53, label %9
53: ; preds = %45
%54 = tail call i64 (...) @rand()
%55 = trunc i64 %54 to i32
%56 = srem i32 %55, 1824
%57 = trunc i32 %56 to i16
%58 = tail call signext i16 @prog_q168ilut(i16 signext %57)
%59 = tail call signext i16 @instr_q168ilut(i16 signext %57)
%60 = icmp eq i16 %59, %58
br i1 %60, label %61, label %9
61: ; preds = %53
%62 = tail call i64 (...) @rand()
%63 = trunc i64 %62 to i32
%64 = srem i32 %63, 1824
%65 = trunc i32 %64 to i16
%66 = tail call signext i16 @prog_q168ilut(i16 signext %65)
%67 = tail call signext i16 @instr_q168ilut(i16 signext %65)
%68 = icmp eq i16 %67, %66
br i1 %68, label %69, label %9
69: ; preds = %61
%70 = tail call i64 (...) @rand()
%71 = trunc i64 %70 to i32
%72 = srem i32 %71, 1824
%73 = trunc i32 %72 to i16
%74 = tail call signext i16 @prog_q168ilut(i16 signext %73)
%75 = tail call signext i16 @instr_q168ilut(i16 signext %73)
%76 = icmp eq i16 %75, %74
br i1 %76, label %77, label %9
77: ; preds = %69
%78 = tail call i64 (...) @rand()
%79 = trunc i64 %78 to i32
%80 = srem i32 %79, 1824
%81 = trunc i32 %80 to i16
%82 = tail call signext i16 @prog_q168ilut(i16 signext %81)
%83 = tail call signext i16 @instr_q168ilut(i16 signext %81)
%84 = icmp eq i16 %83, %82
br i1 %84, label %85, label %9
85: ; preds = %77
%86 = tail call i64 (...) @rand()
%87 = trunc i64 %86 to i32
%88 = srem i32 %87, 1824
%89 = trunc i32 %88 to i16
%90 = tail call signext i16 @prog_q168ilut(i16 signext %89)
%91 = tail call signext i16 @instr_q168ilut(i16 signext %89)
%92 = icmp eq i16 %91, %90
br i1 %92, label %93, label %9
93: ; preds = %85
%94 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.7, i64 0, i64 0))
br label %95
95: ; preds = %9, %93
%96 = phi i32 [ 0, %9 ], [ 1, %93 ]
ret i32 %96
}