#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 /*<<< orphan*/ str;

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int frowkey(char *, int, char *, int, int, char *);
int /*<<< orphan*/ memset(char *, int, int);
int snprintf(char *, int, char *, unsigned char);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
void test_frowkey() {
  struct {
    char *format;
    char *result;
  } correct_cases[] = {
      {"D8D1S18", "0000000000007AB70100000000000000000000000000006C696C79"},
      {"d8D1S18", "B77A0000000000000100000000000000000000000000006C696C79"},
      {"d8D1s18", "B77A000000000000016C696C790000000000000000000000000000"},
      {"d8D1s8F10", "B77A000000000000016C696C7900000000FFFFFFFFFFFFFFFFFFFF"},
      {"d8D1s8Z10", "B77A000000000000016C696C790000000000000000000000000000"},
      {"F5d8D1s8Z5", "FFFFFFFFFFB77A000000000000016C696C79000000000000000000"},
      {"d2D1s2", "B77A016C69"},
      {"D2D1S2", "7AB7016C69"},
      {"d1D1s2", "B7016C69"},
      {"D1D1S1", "B7016C"},
      {NULL, NULL},
  };
  char str[BUFSIZ];
  char buf[BUFSIZ];
  int i = 0;
  int j = 0;
  for (; correct_cases[i].format != NULL; i++) {
    memset(str, 0x00, sizeof(str));
    int len = frowkey(str, BUFSIZ, correct_cases[i].format, 31415, 1, "lily");
    fprintf(stderr, "len=%d\n", len);
    assert(len == strlen(correct_cases[i].result) / 2);
    for (j = 0; j < len; j++) {
      assert(snprintf(buf + j * 2, 3, "%02X", (unsigned char)str[j]) == 2);
    }
    assert(strcmp(buf, correct_cases[i].result) == 0);
  }
  assert(frowkey(buf, 30, "d2D1s5F-14", 31415, 1, "lily") == -1);
  assert(frowkey(buf, 30, "d20D1s5F6", 31415, 1, "lily") == -1);
  assert(frowkey(buf, 30, "dD1s5F6", 31415, 1, "lily") == -1);
  assert(frowkey(buf, 30, "d2D1s5F", 31415, 1, "lily") == -1);
}


x86 assembly (clang, -O0):
<test_frowkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0x2bce(%rip),%rsi
lea    -0xb0(%rbp),%rdi
mov    $0xb0,%edx
call   10a0 <memcpy@plt>
mov    0x2e2e(%rip),%rax
mov    (%rax),%ecx
mov    %rcx,-0xf0(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0xb8(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0xe8(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0xc0(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xe0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xc8(%rbp)
movl   $0x0,-0xcc(%rbp)
movl   $0x0,-0xd0(%rbp)
movslq -0xcc(%rbp),%rcx
lea    -0xb0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
cmpq   $0x0,(%rax)
je     13b9 <test_frowkey+0x239>
mov    -0xe8(%rbp),%rdi
mov    -0xf0(%rbp),%rax
mov    %eax,%edx
xor    %esi,%esi
call   1060 <memset@plt>
mov    -0xe8(%rbp),%rdi
mov    0x2d7d(%rip),%rax
mov    (%rax),%esi
movslq -0xcc(%rbp),%rcx
lea    -0xb0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rdx
mov    $0x7ab7,%ecx
mov    $0x1,%r8d
lea    0xefc(%rip),%r9
call   1030 <frowkey@plt>
mov    %eax,-0xd4(%rbp)
mov    0x2d47(%rip),%rax
mov    (%rax),%edi
mov    -0xd4(%rbp),%edx
lea    0xee0(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0xd4(%rbp),%eax
mov    %eax,-0xf4(%rbp)
movslq -0xcc(%rbp),%rcx
lea    -0xb0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xf4(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
movl   $0x0,-0xd0(%rbp)
mov    -0xd0(%rbp),%eax
cmp    -0xd4(%rbp),%eax
jge    136f <test_frowkey+0x1ef>
mov    -0xe8(%rbp),%rax
mov    -0xe0(%rbp),%rdi
mov    -0xd0(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rdi
movslq -0xd0(%rbp),%rcx
mov    $0x3,%esi
lea    0xe4e(%rip),%rdx
movzbl (%rax,%rcx,1),%ecx
call   1050 <snprintf@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0xd0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd0(%rbp)
jmp    1300 <test_frowkey+0x180>
mov    -0xe0(%rbp),%rdi
movslq -0xcc(%rbp),%rcx
lea    -0xb0(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0xcc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xcc(%rbp)
jmp    1217 <test_frowkey+0x97>
mov    -0xe0(%rbp),%rdi
mov    $0x1e,%esi
lea    0xdc9(%rip),%rdx
mov    $0x7ab7,%ecx
mov    $0x1,%r8d
lea    0xda5(%rip),%r9
call   1030 <frowkey@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0xe0(%rbp),%rdi
mov    $0x1e,%esi
lea    0xd9a(%rip),%rdx
mov    $0x7ab7,%ecx
mov    $0x1,%r8d
lea    0xd6b(%rip),%r9
call   1030 <frowkey@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0xe0(%rbp),%rdi
mov    $0x1e,%esi
lea    0xd6a(%rip),%rdx
mov    $0x7ab7,%ecx
mov    $0x1,%r8d
lea    0xd31(%rip),%r9
call   1030 <frowkey@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0xe0(%rbp),%rdi
mov    $0x1e,%esi
lea    0xd38(%rip),%rdx
mov    $0x7ab7,%ecx
mov    $0x1,%r8d
lea    0xcf7(%rip),%r9
call   1030 <frowkey@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0xb8(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_frowkey>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x2e50(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r15
mov    %rax,-0x38(%rbp)
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
xor    %ebx,%ebx
lea    0xfdb(%rip),%r12
jmp    11ed <test_frowkey+0x7d>
nopw   0x0(%rax,%rax,1)
mov    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1070 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
mov    -0x48(%rbp),%rbx
add    $0x1,%rbx
cmp    $0xa,%rbx
je     12c5 <test_frowkey+0x155>
mov    %rbx,-0x48(%rbp)
shl    $0x4,%rbx
mov    %r15,%rdi
xor    %esi,%esi
mov    -0x38(%rbp),%rdx
call   1060 <memset@plt>
mov    0x2dce(%rip),%rax
mov    (%rax),%esi
lea    0x2b4d(%rip),%rax
mov    (%rbx,%rax,1),%rdx
mov    0x8(%rbx,%rax,1),%rbx
mov    %r15,%rdi
mov    $0x7ab7,%ecx
mov    $0x1,%r8d
lea    0xf52(%rip),%r9
call   1030 <frowkey@plt>
mov    %eax,%r14d
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
lea    0xf3f(%rip),%rsi
mov    %r14d,%edx
call   1090 <fprintf@plt>
mov    %rbx,-0x40(%rbp)
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xor    %edi,%edi
cmp    %ecx,%r14d
sete   %dil
call   1080 <assert@plt>
test   %r14d,%r14d
jle    11c0 <test_frowkey+0x50>
mov    %r14d,%r14d
mov    -0x30(%rbp),%rbx
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
movzbl (%r15,%r13,1),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r12,%rdx
call   1050 <snprintf@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1080 <assert@plt>
add    $0x1,%r13
add    $0x2,%rbx
cmp    %r13,%r14
jne    1290 <test_frowkey+0x120>
jmp    11c0 <test_frowkey+0x50>
lea    0xec9(%rip),%rdx
lea    0xeb0(%rip),%r14
mov    -0x30(%rbp),%rbx
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    $0x7ab7,%ecx
mov    $0x1,%r8d
mov    %r14,%r9
call   1030 <frowkey@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1080 <assert@plt>
lea    0xe99(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    $0x7ab7,%ecx
mov    $0x1,%r8d
mov    %r14,%r9
call   1030 <frowkey@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1080 <assert@plt>
lea    0xe73(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    $0x7ab7,%ecx
mov    $0x1,%r8d
mov    %r14,%r9
call   1030 <frowkey@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1080 <assert@plt>
lea    0xe4b(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    $0x7ab7,%ecx
mov    $0x1,%r8d
mov    %r14,%r9
call   1030 <frowkey@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1080 <assert@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i8* }
@.str = [8 x i8] c"D8D1S18\00"
@.str.1 = [55 x i8] c"0000000000007AB70100000000000000000000000000006C696C79\00"
@.str.2 = [8 x i8] c"d8D1S18\00"
@.str.3 = [55 x i8] c"B77A0000000000000100000000000000000000000000006C696C79\00"
@.str.4 = [8 x i8] c"d8D1s18\00"
@.str.5 = [55 x i8] c"B77A000000000000016C696C790000000000000000000000000000\00"
@.str.6 = [10 x i8] c"d8D1s8F10\00"
@.str.7 = [55 x i8] c"B77A000000000000016C696C7900000000FFFFFFFFFFFFFFFFFFFF\00"
@.str.8 = [10 x i8] c"d8D1s8Z10\00"
@.str.9 = [11 x i8] c"F5d8D1s8Z5\00"
@.str.10 = [55 x i8] c"FFFFFFFFFFB77A000000000000016C696C79000000000000000000\00"
@.str.11 = [7 x i8] c"d2D1s2\00"
@.str.12 = [11 x i8] c"B77A016C69\00"
@.str.13 = [7 x i8] c"D2D1S2\00"
@.str.14 = [11 x i8] c"7AB7016C69\00"
@.str.15 = [7 x i8] c"d1D1s2\00"
@.str.16 = [9 x i8] c"B7016C69\00"
@.str.17 = [7 x i8] c"D1D1S1\00"
@.str.18 = [7 x i8] c"B7016C\00"
@__const.test_frowkey.correct_cases = [11 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i32 0, i32 0) }, %struct.anon zeroinitializer]
@BUFSIZ = global i32 0
@.str.19 = [5 x i8] c"lily\00"
@stderr = global i32 0
@.str.20 = [8 x i8] c"len=%d\0A\00"
@.str.21 = [5 x i8] c"%02X\00"
@.str.22 = [11 x i8] c"d2D1s5F-14\00"
@.str.23 = [10 x i8] c"d20D1s5F6\00"
@.str.24 = [8 x i8] c"dD1s5F6\00"
@.str.25 = [8 x i8] c"d2D1s5F\00"
define void @test_frowkey() {
%1 = alloca [11 x %struct.anon]
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = bitcast [11 x %struct.anon]* %1 to i8*
%9 = load i32, i32* @BUFSIZ
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %2
%12 = alloca i8, i64 %10
store i64 %10, i64* %3
%13 = load i32, i32* @BUFSIZ
%14 = zext i32 %13 to i64
%15 = alloca i8, i64 %14
store i64 %14, i64* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %16
16: ; preds = %77, %0
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [11 x %struct.anon], [11 x %struct.anon]* %1, i64 0, i64 %18
%20 = getelementptr inbounds %struct.anon, %struct.anon* %19, i32 0, i32 0
%21 = load i8*, i8** %20
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %80
23: ; preds = %16
%24 = trunc i64 %10 to i32
%25 = call i32 @memset(i8* %12, i32 0, i32 %24)
%26 = load i32, i32* @BUFSIZ
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [11 x %struct.anon], [11 x %struct.anon]* %1, i64 0, i64 %28
%30 = getelementptr inbounds %struct.anon, %struct.anon* %29, i32 0, i32 0
%31 = load i8*, i8** %30
%32 = call i32 @frowkey(i8* %12, i32 %26, i8* %31, i32 31415, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
store i32 %32, i32* %7
%33 = load i32, i32* @stderr
%34 = load i32, i32* %7
%35 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %7
%37 = load i32, i32* %5
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [11 x %struct.anon], [11 x %struct.anon]* %1, i64 0, i64 %38
%40 = getelementptr inbounds %struct.anon, %struct.anon* %39, i32 0, i32 1
%41 = load i8*, i8** %40
%42 = call i32 @strlen(i8* %41)
%43 = sdiv i32 %42, 2
%44 = icmp eq i32 %36, %43
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
store i32 0, i32* %6
br label %47
47: ; preds = %64, %23
%48 = load i32, i32* %6
%49 = load i32, i32* %7
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %67
51: ; preds = %47
%52 = load i32, i32* %6
%53 = mul nsw i32 %52, 2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %15, i64 %54
%56 = load i32, i32* %6
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %12, i64 %57
%59 = load i8, i8* %58
%60 = call i32 @snprintf(i8* %55, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8 zeroext %59)
%61 = icmp eq i32 %60, 2
%62 = zext i1 %61 to i32
%63 = call i32 @assert(i32 %62)
br label %64
64: ; preds = %51
%65 = load i32, i32* %6
%66 = add nsw i32 %65, 1
store i32 %66, i32* %6
br label %47
67: ; preds = %47
%68 = load i32, i32* %5
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [11 x %struct.anon], [11 x %struct.anon]* %1, i64 0, i64 %69
%71 = getelementptr inbounds %struct.anon, %struct.anon* %70, i32 0, i32 1
%72 = load i8*, i8** %71
%73 = call i64 @strcmp(i8* %15, i8* %72)
%74 = icmp eq i64 %73, 0
%75 = zext i1 %74 to i32
%76 = call i32 @assert(i32 %75)
br label %77
77: ; preds = %67
%78 = load i32, i32* %5
%79 = add nsw i32 %78, 1
store i32 %79, i32* %5
br label %16
80: ; preds = %16
%81 = call i32 @frowkey(i8* %15, i32 30, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.22, i64 0, i64 0), i32 31415, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%82 = icmp eq i32 %81, -1
%83 = zext i1 %82 to i32
%84 = call i32 @assert(i32 %83)
%85 = call i32 @frowkey(i8* %15, i32 30, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i64 0, i64 0), i32 31415, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%86 = icmp eq i32 %85, -1
%87 = zext i1 %86 to i32
%88 = call i32 @assert(i32 %87)
%89 = call i32 @frowkey(i8* %15, i32 30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i32 31415, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%90 = icmp eq i32 %89, -1
%91 = zext i1 %90 to i32
%92 = call i32 @assert(i32 %91)
%93 = call i32 @frowkey(i8* %15, i32 30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.25, i64 0, i64 0), i32 31415, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%94 = icmp eq i32 %93, -1
%95 = zext i1 %94 to i32
%96 = call i32 @assert(i32 %95)
%97 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
%struct.anon = type { i8*, i8* }
@.str = [8 x i8] c"D8D1S18\00"
@.str.1 = [55 x i8] c"0000000000007AB70100000000000000000000000000006C696C79\00"
@.str.2 = [8 x i8] c"d8D1S18\00"
@.str.3 = [55 x i8] c"B77A0000000000000100000000000000000000000000006C696C79\00"
@.str.4 = [8 x i8] c"d8D1s18\00"
@.str.5 = [55 x i8] c"B77A000000000000016C696C790000000000000000000000000000\00"
@.str.6 = [10 x i8] c"d8D1s8F10\00"
@.str.7 = [55 x i8] c"B77A000000000000016C696C7900000000FFFFFFFFFFFFFFFFFFFF\00"
@.str.8 = [10 x i8] c"d8D1s8Z10\00"
@.str.9 = [11 x i8] c"F5d8D1s8Z5\00"
@.str.10 = [55 x i8] c"FFFFFFFFFFB77A000000000000016C696C79000000000000000000\00"
@.str.11 = [7 x i8] c"d2D1s2\00"
@.str.12 = [11 x i8] c"B77A016C69\00"
@.str.13 = [7 x i8] c"D2D1S2\00"
@.str.14 = [11 x i8] c"7AB7016C69\00"
@.str.15 = [7 x i8] c"d1D1s2\00"
@.str.16 = [9 x i8] c"B7016C69\00"
@.str.17 = [7 x i8] c"D1D1S1\00"
@.str.18 = [7 x i8] c"B7016C\00"
@__const.test_frowkey.correct_cases = [11 x %struct.anon] [%struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.10, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i32 0, i32 0) }, %struct.anon { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i32 0, i32 0) }, %struct.anon zeroinitializer]
@BUFSIZ = global i32 0
@.str.19 = [5 x i8] c"lily\00"
@stderr = global i32 0
@.str.20 = [8 x i8] c"len=%d\0A\00"
@.str.21 = [5 x i8] c"%02X\00"
@.str.22 = [11 x i8] c"d2D1s5F-14\00"
@.str.23 = [10 x i8] c"d20D1s5F6\00"
@.str.24 = [8 x i8] c"dD1s5F6\00"
@.str.25 = [8 x i8] c"d2D1s5F\00"
define void @test_frowkey() {
%1 = load i32, i32* @BUFSIZ
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = alloca i8, i64 %2
br label %5
5: ; preds = %0, %36
%6 = phi i64 [ 0, %0 ], [ %41, %36 ]
%7 = getelementptr inbounds [11 x %struct.anon], [11 x %struct.anon]* @__const.test_frowkey.correct_cases, i64 0, i64 %6, i32 0
%8 = call i32 @memset(i8* %3, i32 0, i32 %1)
%9 = load i32, i32* @BUFSIZ
%10 = load i8*, i8** %7
%11 = call i32 @frowkey(i8* %3, i32 %9, i8* %10, i32 31415, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0), i32 %11)
%14 = getelementptr inbounds [11 x %struct.anon], [11 x %struct.anon]* @__const.test_frowkey.correct_cases, i64 0, i64 %6, i32 1
%15 = load i8*, i8** %14
%16 = call i32 @strlen(i8* %15)
%17 = sdiv i32 %16, 2
%18 = icmp eq i32 %11, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = icmp sgt i32 %11, 0
br i1 %21, label %22, label %36
22: ; preds = %5
%23 = zext i32 %11 to i64
br label %24
24: ; preds = %22, %24
%25 = phi i64 [ 0, %22 ], [ %34, %24 ]
%26 = shl nuw nsw i64 %25, 1
%27 = getelementptr inbounds i8, i8* %4, i64 %26
%28 = getelementptr inbounds i8, i8* %3, i64 %25
%29 = load i8, i8* %28
%30 = call i32 @snprintf(i8* %27, i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i8 zeroext %29)
%31 = icmp eq i32 %30, 2
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = add nuw nsw i64 %25, 1
%35 = icmp eq i64 %34, %23
br i1 %35, label %36, label %24
36: ; preds = %24, %5
%37 = call i64 @strcmp(i8* %4, i8* %15)
%38 = icmp eq i64 %37, 0
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = add nuw nsw i64 %6, 1
%42 = icmp eq i64 %41, 10
br i1 %42, label %43, label %5
43: ; preds = %36
%44 = call i32 @frowkey(i8* %4, i32 30, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.22, i64 0, i64 0), i32 31415, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%45 = icmp eq i32 %44, -1
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = call i32 @frowkey(i8* %4, i32 30, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i64 0, i64 0), i32 31415, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%49 = icmp eq i32 %48, -1
%50 = zext i1 %49 to i32
%51 = call i32 @assert(i32 %50)
%52 = call i32 @frowkey(i8* %4, i32 30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0), i32 31415, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%53 = icmp eq i32 %52, -1
%54 = zext i1 %53 to i32
%55 = call i32 @assert(i32 %54)
%56 = call i32 @frowkey(i8* %4, i32 30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.25, i64 0, i64 0), i32 31415, i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%57 = icmp eq i32 %56, -1
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
ret void
}