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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, int, int,
                           int, int);
int /*<<< orphan*/ isxdigit(int);
scalar_t__ memcmp(int *, char *, int);
void testarrisizzi(FILE *fhout, uint8_t essidlen, uint8_t *essid) {
  static int c;
  static uint32_t i;
  static char *izzi = "IZZI-";
  static int fixseed2[] = {0x001C15, 0x189C27, 0x3C0461, 0x509551, 0x704FB8,
                           0x8871B1, 0x8C61A3, 0x9CC8FC, 0xA811FC, 0xD4AB82,
                           0xF0AF85, 0xF82DC0, 0xF88B37, 0xF8F532, 0xFCAE34};
  if (essidlen < 9)
    return;
  if (memcmp(essid, izzi, 5) != 0)
    return;
  if ((!isxdigit(essid[5])) || (!isxdigit(essid[6])) || (!isxdigit(essid[7])) ||
      (!isxdigit(essid[8])))
    return;
  for (i = 0; i < sizeof(fixseed2) / sizeof(int); i++) {
    for (c = 0; c < 0x100; c++)
      fprintf(fhout, "%06X%02X%C%C%C%C\n", fixseed2[i], c, essid[5], essid[6],
              essid[7], essid[8]);
  }
  return;
}


x86 assembly (clang, -O0):
<testarrisizzi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1152 <testarrisizzi+0x22>
jmp    1284 <testarrisizzi+0x154>
mov    -0x18(%rbp),%rdi
mov    0x2ee3(%rip),%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
je     1176 <testarrisizzi+0x46>
jmp    1284 <testarrisizzi+0x154>
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%eax
je     11ca <testarrisizzi+0x9a>
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%eax
je     11ca <testarrisizzi+0x9a>
mov    -0x18(%rbp),%rax
mov    0x1c(%rax),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%eax
je     11ca <testarrisizzi+0x9a>
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%eax
jne    11cf <testarrisizzi+0x9f>
jmp    1284 <testarrisizzi+0x154>
movl   $0x0,0x2ebb(%rip)
movslq 0x2eb4(%rip),%rax
cmp    $0xf,%rax
jae    127f <testarrisizzi+0x14f>
movl   $0x0,0x2e9c(%rip)
cmpl   $0x100,0x2e92(%rip)
jge    1266 <testarrisizzi+0x136>
mov    -0x8(%rbp),%rdi
movslq 0x2e85(%rip),%rcx
lea    0x2e3a(%rip),%rax
mov    (%rax,%rcx,4),%edx
mov    0x2e71(%rip),%ecx
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%r8d
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%r9d
mov    -0x18(%rbp),%rax
mov    0x1c(%rax),%r10d
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%eax
lea    0xdc1(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <fprintf@plt>
mov    0x2e38(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e2f(%rip)
jmp    11f4 <testarrisizzi+0xc4>
jmp    126b <testarrisizzi+0x13b>
mov    0x2e23(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e1a(%rip)
jmp    11d9 <testarrisizzi+0xa9>
jmp    1284 <testarrisizzi+0x154>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testarrisizzi>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    $0x9,%esi
jl     115d <testarrisizzi+0x2d>
mov    %rdx,%r13
mov    %rdi,%r14
lea    0xeb5(%rip),%rsi
mov    %rdx,%rdi
mov    $0x5,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
je     1167 <testarrisizzi+0x37>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    0x14(%r13),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     115d <testarrisizzi+0x2d>
mov    0x18(%r13),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     115d <testarrisizzi+0x2d>
mov    0x1c(%r13),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     115d <testarrisizzi+0x2d>
mov    0x20(%r13),%edi
call   1050 <isxdigit@plt>
test   %eax,%eax
je     115d <testarrisizzi+0x2d>
movl   $0x0,0x2e9b(%rip)
xor    %eax,%eax
lea    0xe72(%rip),%r12
lea    0xe51(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
movl   $0x0,0x2e72(%rip)
xor    %ecx,%ecx
nopl   0x0(%rax)
cltq
mov    (%r12,%rax,4),%edx
mov    0x14(%r13),%r8d
mov    0x18(%r13),%r9d
mov    0x1c(%r13),%eax
mov    0x20(%r13),%ebx
mov    %r14,%rdi
mov    %r15,%rsi
push   %rbx
push   %rax
call   1040 <fprintf@plt>
add    $0x10,%rsp
mov    0x2e3f(%rip),%edx
lea    0x1(%rdx),%ecx
mov    %ecx,0x2e36(%rip)
mov    0x2e34(%rip),%eax
cmp    $0xff,%edx
jl     11d0 <testarrisizzi+0xa0>
add    $0x1,%eax
mov    %eax,0x2e23(%rip)
cmp    $0xf,%eax
jb     11c0 <testarrisizzi+0x90>
jmp    115d <testarrisizzi+0x2d>

LLVM IR (-O0):
@testarrisizzi.c = internal global i32 0
@testarrisizzi.i = internal global i32 0
@testarrisizzi.izzi = internal global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0)
@.str = [6 x i8] c"IZZI-\00"
@testarrisizzi.fixseed2 = internal global [15 x i32] [i32 7189, i32 1612839, i32 3933281, i32 5281105, i32 7360440, i32 8942001, i32 9200035, i32 10275068, i32 11014652, i32 13937538, i32 15773573, i32 16264640, i32 16288567, i32 16315698, i32 16559668]
@.str.1 = [18 x i8] c"%06X%02X%C%C%C%C\0A\00"
define void @testarrisizzi(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 slt i32 %7, 9
br i1 %8, label %9, label %10
9: ; preds = %3
br label %78
10: ; preds = %3
%11 = load i32*, i32** %6
%12 = load i8*, i8** @testarrisizzi.izzi
%13 = call i64 @memcmp(i32* %11, i8* %12, i32 5)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
br label %78
16: ; preds = %10
%17 = load i32*, i32** %6
%18 = getelementptr inbounds i32, i32* %17, i64 5
%19 = load i32, i32* %18
%20 = call i32 @isxdigit(i32 %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %40
22: ; preds = %16
%23 = load i32*, i32** %6
%24 = getelementptr inbounds i32, i32* %23, i64 6
%25 = load i32, i32* %24
%26 = call i32 @isxdigit(i32 %25)
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %40
28: ; preds = %22
%29 = load i32*, i32** %6
%30 = getelementptr inbounds i32, i32* %29, i64 7
%31 = load i32, i32* %30
%32 = call i32 @isxdigit(i32 %31)
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %40
34: ; preds = %28
%35 = load i32*, i32** %6
%36 = getelementptr inbounds i32, i32* %35, i64 8
%37 = load i32, i32* %36
%38 = call i32 @isxdigit(i32 %37)
%39 = icmp ne i32 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %34, %28, %22, %16
br label %78
41: ; preds = %34
store i32 0, i32* @testarrisizzi.i
br label %42
42: ; preds = %74, %41
%43 = load i32, i32* @testarrisizzi.i
%44 = sext i32 %43 to i64
%45 = icmp ult i64 %44, 15
br i1 %45, label %46, label %77
46: ; preds = %42
store i32 0, i32* @testarrisizzi.c
br label %47
47: ; preds = %70, %46
%48 = load i32, i32* @testarrisizzi.c
%49 = icmp slt i32 %48, 256
br i1 %49, label %50, label %73
50: ; preds = %47
%51 = load i32*, i32** %4
%52 = load i32, i32* @testarrisizzi.i
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [15 x i32], [15 x i32]* @testarrisizzi.fixseed2, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = load i32, i32* @testarrisizzi.c
%57 = load i32*, i32** %6
%58 = getelementptr inbounds i32, i32* %57, i64 5
%59 = load i32, i32* %58
%60 = load i32*, i32** %6
%61 = getelementptr inbounds i32, i32* %60, i64 6
%62 = load i32, i32* %61
%63 = load i32*, i32** %6
%64 = getelementptr inbounds i32, i32* %63, i64 7
%65 = load i32, i32* %64
%66 = load i32*, i32** %6
%67 = getelementptr inbounds i32, i32* %66, i64 8
%68 = load i32, i32* %67
%69 = call i32 @fprintf(i32* %51, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %55, i32 %56, i32 %59, i32 %62, i32 %65, i32 %68)
br label %70
70: ; preds = %50
%71 = load i32, i32* @testarrisizzi.c
%72 = add nsw i32 %71, 1
store i32 %72, i32* @testarrisizzi.c
br label %47
73: ; preds = %47
br label %74
74: ; preds = %73
%75 = load i32, i32* @testarrisizzi.i
%76 = add nsw i32 %75, 1
store i32 %76, i32* @testarrisizzi.i
br label %42
77: ; preds = %42
br label %78
78: ; preds = %77, %40, %15, %9
ret void
}

LLVM IR (-O2):
@testarrisizzi.c = internal unnamed_addr global i32 0
@testarrisizzi.i = internal unnamed_addr global i32 0
@.str = [6 x i8] c"IZZI-\00"
@testarrisizzi.fixseed2 = internal unnamed_addr constant [15 x i32] [i32 7189, i32 1612839, i32 3933281, i32 5281105, i32 7360440, i32 8942001, i32 9200035, i32 10275068, i32 11014652, i32 13937538, i32 15773573, i32 16264640, i32 16288567, i32 16315698, i32 16559668]
@.str.1 = [18 x i8] c"%06X%02X%C%C%C%C\0A\00"
define void @testarrisizzi(i32* nocapture %0, i32 %1, i32* %2) {
%4 = icmp slt i32 %1, 9
br i1 %4, label %49, label %5
5: ; preds = %3
%6 = tail call i64 @memcmp(i32* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %49
8: ; preds = %5
%9 = getelementptr inbounds i32, i32* %2, i64 5
%10 = load i32, i32* %9
%11 = tail call i32 @isxdigit(i32 %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %49, label %13
13: ; preds = %8
%14 = getelementptr inbounds i32, i32* %2, i64 6
%15 = load i32, i32* %14
%16 = tail call i32 @isxdigit(i32 %15)
%17 = icmp eq i32 %16, 0
br i1 %17, label %49, label %18
18: ; preds = %13
%19 = getelementptr inbounds i32, i32* %2, i64 7
%20 = load i32, i32* %19
%21 = tail call i32 @isxdigit(i32 %20)
%22 = icmp eq i32 %21, 0
br i1 %22, label %49, label %23
23: ; preds = %18
%24 = getelementptr inbounds i32, i32* %2, i64 8
%25 = load i32, i32* %24
%26 = tail call i32 @isxdigit(i32 %25)
%27 = icmp eq i32 %26, 0
br i1 %27, label %49, label %28
28: ; preds = %23
store i32 0, i32* @testarrisizzi.i
br label %29
29: ; preds = %28, %46
%30 = phi i32 [ 0, %28 ], [ %47, %46 ]
store i32 0, i32* @testarrisizzi.c
br label %31
31: ; preds = %31, %29
%32 = phi i32 [ %30, %29 ], [ %45, %31 ]
%33 = phi i32 [ 0, %29 ], [ %43, %31 ]
%34 = sext i32 %32 to i64
%35 = getelementptr inbounds [15 x i32], [15 x i32]* @testarrisizzi.fixseed2, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = load i32, i32* %9
%38 = load i32, i32* %14
%39 = load i32, i32* %19
%40 = load i32, i32* %24
%41 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %36, i32 %33, i32 %37, i32 %38, i32 %39, i32 %40)
%42 = load i32, i32* @testarrisizzi.c
%43 = add nsw i32 %42, 1
store i32 %43, i32* @testarrisizzi.c
%44 = icmp slt i32 %42, 255
%45 = load i32, i32* @testarrisizzi.i
br i1 %44, label %31, label %46
46: ; preds = %31
%47 = add nsw i32 %45, 1
store i32 %47, i32* @testarrisizzi.i
%48 = icmp ult i32 %47, 15
br i1 %48, label %29, label %49
49: ; preds = %46, %8, %13, %18, %23, %5, %3
ret void
}