#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 */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, int);
int /*<<< orphan*/ isxdigit(int);
scalar_t__ memcmp(int *, char const *, int);
void testtechnicolor(FILE *fhout, uint8_t essidlen, uint8_t *essid) {
  static int k1;
  static const char *tc8715d = "TC8715D";
  static const char *tc8717t = "TC8717T";
  if (essidlen >= 9) {
    if ((!isxdigit(essid[7])) || (!isxdigit(essid[8])))
      return;
    if (memcmp(essid, tc8715d, 7) == 0) {
      for (k1 = 0; k1 < 0x10000; k1++)
        fprintf(fhout, "TC8715D%04X%c%c\n", k1, essid[7], essid[8]);
    }
    if (memcmp(essid, tc8717t, 7) == 0) {
      for (k1 = 0; k1 < 0x10000; k1++)
        fprintf(fhout, "TC8717T%04X%c%c\n", k1, essid[7], essid[8]);
    }
    return;
  }
  return;
}


x86 assembly (clang, -O0):
<testtechnicolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x9,-0xc(%rbp)
jl     126f <testtechnicolor+0x13f>
mov    -0x18(%rbp),%rax
mov    0x1c(%rax),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%eax
je     1177 <testtechnicolor+0x47>
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%eax
jne    117c <testtechnicolor+0x4c>
jmp    1274 <testtechnicolor+0x144>
mov    -0x18(%rbp),%rdi
mov    0x2eb1(%rip),%rsi
mov    $0x7,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    11f3 <testtechnicolor+0xc3>
movl   $0x0,0x2ea7(%rip)
cmpl   $0x10000,0x2e9d(%rip)
jge    11ee <testtechnicolor+0xbe>
mov    -0x8(%rbp),%rdi
mov    0x2e8d(%rip),%edx
mov    -0x18(%rbp),%rax
mov    0x1c(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%r8d
lea    0xe3b(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e6c(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e63(%rip)
jmp    11a5 <testtechnicolor+0x75>
jmp    11f3 <testtechnicolor+0xc3>
mov    -0x18(%rbp),%rdi
mov    0x2e42(%rip),%rsi
mov    $0x7,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    126a <testtechnicolor+0x13a>
movl   $0x0,0x2e30(%rip)
cmpl   $0x10000,0x2e26(%rip)
jge    1265 <testtechnicolor+0x135>
mov    -0x8(%rbp),%rdi
mov    0x2e16(%rip),%edx
mov    -0x18(%rbp),%rax
mov    0x1c(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%r8d
lea    0xdd5(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2df5(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2dec(%rip)
jmp    121c <testtechnicolor+0xec>
jmp    126a <testtechnicolor+0x13a>
jmp    1274 <testtechnicolor+0x144>
jmp    1274 <testtechnicolor+0x144>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testtechnicolor>:
push   %r15
push   %r14
push   %rbx
cmp    $0x9,%esi
jl     1218 <testtechnicolor+0xe8>
mov    %rdx,%rbx
mov    %rdi,%r14
mov    0x1c(%rdx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     1218 <testtechnicolor+0xe8>
mov    0x20(%rbx),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     1218 <testtechnicolor+0xe8>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
jne    11b8 <testtechnicolor+0x88>
movl   $0x0,0x2eb5(%rip)
xor    %edx,%edx
lea    0xe80(%rip),%r15
mov    0x1c(%rbx),%ecx
mov    0x20(%rbx),%r8d
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <fprintf@plt>
mov    0x2e94(%rip),%eax
lea    0x1(%rax),%edx
mov    %edx,0x2e8b(%rip)
cmp    $0xffff,%eax
jl     1190 <testtechnicolor+0x60>
lea    0xe49(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
jne    1218 <testtechnicolor+0xe8>
movl   $0x0,0x2e61(%rip)
xor    %edx,%edx
lea    0xe3d(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x1c(%rbx),%ecx
mov    0x20(%rbx),%r8d
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <fprintf@plt>
mov    0x2e34(%rip),%eax
lea    0x1(%rax),%edx
mov    %edx,0x2e2b(%rip)
cmp    $0xffff,%eax
jl     11f0 <testtechnicolor+0xc0>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@testtechnicolor.k1 = internal global i32 0
@testtechnicolor.tc8715d = internal global i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0)
@.str = [8 x i8] c"TC8715D\00"
@testtechnicolor.tc8717t = internal global i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0)
@.str.1 = [8 x i8] c"TC8717T\00"
@.str.2 = [17 x i8] c"TC8715D%04X%c%c\0A\00"
@.str.3 = [17 x i8] c"TC8717T%04X%c%c\0A\00"
define void @testtechnicolor(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %5
%8 = icmp sge i32 %7, 9
br i1 %8, label %9, label %69
9: ; preds = %3
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 7
%12 = load i32, i32* %11
%13 = call i32 @isxdigit(i32 %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %9
%16 = load i32*, i32** %6
%17 = getelementptr inbounds i32, i32* %16, i64 8
%18 = load i32, i32* %17
%19 = call i32 @isxdigit(i32 %18)
%20 = icmp ne i32 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %15, %9
br label %70
22: ; preds = %15
%23 = load i32*, i32** %6
%24 = load i8*, i8** @testtechnicolor.tc8715d
%25 = call i64 @memcmp(i32* %23, i8* %24, i32 7)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %45
27: ; preds = %22
store i32 0, i32* @testtechnicolor.k1
br label %28
28: ; preds = %41, %27
%29 = load i32, i32* @testtechnicolor.k1
%30 = icmp slt i32 %29, 65536
br i1 %30, label %31, label %44
31: ; preds = %28
%32 = load i32*, i32** %4
%33 = load i32, i32* @testtechnicolor.k1
%34 = load i32*, i32** %6
%35 = getelementptr inbounds i32, i32* %34, i64 7
%36 = load i32, i32* %35
%37 = load i32*, i32** %6
%38 = getelementptr inbounds i32, i32* %37, i64 8
%39 = load i32, i32* %38
%40 = call i32 @fprintf(i32* %32, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %33, i32 %36, i32 %39)
br label %41
41: ; preds = %31
%42 = load i32, i32* @testtechnicolor.k1
%43 = add nsw i32 %42, 1
store i32 %43, i32* @testtechnicolor.k1
br label %28
44: ; preds = %28
br label %45
45: ; preds = %44, %22
%46 = load i32*, i32** %6
%47 = load i8*, i8** @testtechnicolor.tc8717t
%48 = call i64 @memcmp(i32* %46, i8* %47, i32 7)
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %68
50: ; preds = %45
store i32 0, i32* @testtechnicolor.k1
br label %51
51: ; preds = %64, %50
%52 = load i32, i32* @testtechnicolor.k1
%53 = icmp slt i32 %52, 65536
br i1 %53, label %54, label %67
54: ; preds = %51
%55 = load i32*, i32** %4
%56 = load i32, i32* @testtechnicolor.k1
%57 = load i32*, i32** %6
%58 = getelementptr inbounds i32, i32* %57, i64 7
%59 = load i32, i32* %58
%60 = load i32*, i32** %6
%61 = getelementptr inbounds i32, i32* %60, i64 8
%62 = load i32, i32* %61
%63 = call i32 @fprintf(i32* %55, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %56, i32 %59, i32 %62)
br label %64
64: ; preds = %54
%65 = load i32, i32* @testtechnicolor.k1
%66 = add nsw i32 %65, 1
store i32 %66, i32* @testtechnicolor.k1
br label %51
67: ; preds = %51
br label %68
68: ; preds = %67, %45
br label %70
69: ; preds = %3
br label %70
70: ; preds = %69, %68, %21
ret void
}

LLVM IR (-O2):
@testtechnicolor.k1 = internal unnamed_addr global i32 0
@.str = [8 x i8] c"TC8715D\00"
@.str.1 = [8 x i8] c"TC8717T\00"
@.str.2 = [17 x i8] c"TC8715D%04X%c%c\0A\00"
@.str.3 = [17 x i8] c"TC8717T%04X%c%c\0A\00"
define void @testtechnicolor(i32* nocapture %0, i32 %1, i32* %2) {
%4 = icmp sgt i32 %1, 8
br i1 %4, label %5, label %39
5: ; preds = %3
%6 = getelementptr inbounds i32, i32* %2, i64 7
%7 = load i32, i32* %6
%8 = tail call i32 @isxdigit(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %39, label %10
10: ; preds = %5
%11 = getelementptr inbounds i32, i32* %2, i64 8
%12 = load i32, i32* %11
%13 = tail call i32 @isxdigit(i32 %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %39, label %15
15: ; preds = %10
%16 = tail call i64 @memcmp(i32* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %27
18: ; preds = %15
store i32 0, i32* @testtechnicolor.k1
br label %19
19: ; preds = %18, %19
%20 = phi i32 [ 0, %18 ], [ %25, %19 ]
%21 = load i32, i32* %6
%22 = load i32, i32* %11
%23 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %20, i32 %21, i32 %22)
%24 = load i32, i32* @testtechnicolor.k1
%25 = add nsw i32 %24, 1
store i32 %25, i32* @testtechnicolor.k1
%26 = icmp slt i32 %24, 65535
br i1 %26, label %19, label %27
27: ; preds = %19, %15
%28 = tail call i64 @memcmp(i32* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %39
30: ; preds = %27
store i32 0, i32* @testtechnicolor.k1
br label %31
31: ; preds = %30, %31
%32 = phi i32 [ 0, %30 ], [ %37, %31 ]
%33 = load i32, i32* %6
%34 = load i32, i32* %11
%35 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %32, i32 %33, i32 %34)
%36 = load i32, i32* @testtechnicolor.k1
%37 = add nsw i32 %36, 1
store i32 %37, i32* @testtechnicolor.k1
%38 = icmp slt i32 %36, 65535
br i1 %38, label %31, label %39
39: ; preds = %31, %3, %27, %5, %10
ret void
}