#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 /*<<< orphan*/ mangle(unsigned char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ printseed(unsigned char *);
int /*<<< orphan*/ printstream(unsigned char *, unsigned char);
long strtol(char *, char **, int /*<<< orphan*/);
int main(int argc, char **argv) {
  unsigned char *label[2];
  unsigned char restart = 1, swap = 0;
  long streamno = 0;
  char *endptr;
  unsigned char lockseed[16] = {0x0, 0xb, 0x1, 0x4, 0xf, 0x4, 0xb, 0x5,
                                0x7, 0xf, 0xd, 0x6, 0x1, 0xe, 0x9, 0x8};
  unsigned char keyseed[16] = {0x0, 0x0, 0x9, 0xa, 0x1, 0x8, 0x5, 0xf,
                               0x1, 0x1, 0xe, 0x1, 0x0, 0xd, 0xe, 0xc};
  if (argc < 2) {
    printf("Usage: %s <stream number>\n\n", argv[0]);
    printf("<stream number> selects one of 16 fill-in values sent by the lock "
           "on reset.\n");
    printf("Both sides use it as the first nibble of the seed initially sent "
           "on D1 by\n");
    printf(
        "the lock. Transmission bit order is 3-0-1-2. e.g. '1-0-1-1' => 0xe\n");
    return -1;
  }
  streamno = strtol(argv[1], &endptr, 0);
  printf("%p %p\n", argv[1], endptr);
  if (*endptr) {
    printf("invalid format for stream number. example: decimal: 15, hex: 0xe, "
           "oct: 017\n");
    return 1;
  }
  if (streamno > 15 || streamno < 0) {
    printf("invalid stream number. Valid range is 0x0-0xf\n");
    return 1;
  }
  keyseed[1] = (unsigned char)streamno;
  printf("initial seeds:\n");
  printseed(lockseed);
  printseed(keyseed);
  printf("\n");
  label[0] = "LockOutKeyIn";
  label[1] = "LockInKeyOut";
  while (1) {
    printf("\n");
    printf("D0[%s]: ", label[0]);
    printstream(swap ? keyseed : lockseed, restart);
    printf("D1[%s]: ", label[1]);
    printstream(swap ? lockseed : keyseed, restart);
    mangle(keyseed);
    mangle(keyseed);
    mangle(keyseed);
    mangle(lockseed);
    mangle(lockseed);
    mangle(lockseed);
    restart = keyseed[7];
    swap = restart & 1;
    if (swap) {
      label[0] = "LockInKeyOut";
      label[1] = "LockOutKeyIn";
    } else {
      label[0] = "LockOutKeyIn";
      label[1] = "LockInKeyOut";
    }
    if (!restart)
      restart = 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x1,-0x21(%rbp)
movb   $0x0,-0x22(%rbp)
movq   $0x0,-0x30(%rbp)
mov    0xe83(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe80(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe7d(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe7a(%rip),%rax
mov    %rax,-0x58(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11f7 <main+0xa7>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ee <main+0x29e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x38(%rbp),%rsi
xor    %edx,%edx
call   1050 <strtol@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x38(%rbp),%rdx
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
cmpb   $0x0,(%rax)
je     124f <main+0xff>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13ee <main+0x29e>
cmpq   $0xf,-0x30(%rbp)
jg     1265 <main+0x115>
cmpq   $0x0,-0x30(%rbp)
jge    127f <main+0x12f>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13ee <main+0x29e>
mov    -0x30(%rbp),%rax
mov    %al,-0x5f(%rbp)
lea    0xf0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1060 <printseed@plt>
lea    -0x60(%rbp),%rdi
call   1060 <printseed@plt>
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x22(%rbp),%eax
cmp    $0x0,%eax
je     1304 <main+0x1b4>
lea    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
jmp    130c <main+0x1bc>
lea    -0x50(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rdi
movzbl -0x21(%rbp),%esi
call   1040 <printstream@plt>
mov    -0x18(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x22(%rbp),%eax
cmp    $0x0,%eax
je     1345 <main+0x1f5>
lea    -0x50(%rbp),%rax
mov    %rax,-0x70(%rbp)
jmp    134d <main+0x1fd>
lea    -0x60(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rdi
movzbl -0x21(%rbp),%esi
call   1040 <printstream@plt>
lea    -0x60(%rbp),%rdi
call   1070 <mangle@plt>
lea    -0x60(%rbp),%rdi
call   1070 <mangle@plt>
lea    -0x60(%rbp),%rdi
call   1070 <mangle@plt>
lea    -0x50(%rbp),%rdi
call   1070 <mangle@plt>
lea    -0x50(%rbp),%rdi
call   1070 <mangle@plt>
lea    -0x50(%rbp),%rdi
call   1070 <mangle@plt>
mov    -0x59(%rbp),%al
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%eax
and    $0x1,%eax
mov    %al,-0x22(%rbp)
cmpb   $0x0,-0x22(%rbp)
je     13c5 <main+0x275>
lea    0xe06(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xdee(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    13db <main+0x28b>
lea    0xdde(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xde0(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpb   $0x0,-0x21(%rbp)
jne    13e9 <main+0x299>
movb   $0x1,-0x21(%rbp)
jmp    12ca <main+0x17a>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
movaps 0xe78(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe7c(%rip),%xmm0
movaps %xmm0,(%rsp)
cmp    $0x1,%edi
jg     11d4 <main+0x64>
mov    (%rbx),%rsi
lea    0xe79(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf42(%rip),%rdi
call   1040 <puts@plt>
lea    0xf82(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebx
lea    0xfbb(%rip),%rdi
jmp    1222 <main+0xb2>
mov    0x8(%rbx),%rdi
lea    0x18(%rsp),%rsi
xor    %edx,%edx
call   1070 <strtol@plt>
mov    %rax,%r14
mov    0x8(%rbx),%rsi
mov    0x18(%rsp),%rbp
lea    0xe45(%rip),%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebx
cmpb   $0x0,0x0(%rbp)
je     1215 <main+0xa5>
lea    0xe99(%rip),%rdi
jmp    1222 <main+0xb2>
cmp    $0xf,%r14
jbe    1238 <main+0xc8>
lea    0xe5c(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14b,0x1(%rsp)
lea    0xe2b(%rip),%rdi
call   1040 <puts@plt>
lea    0x20(%rsp),%r15
mov    %r15,%rdi
call   1080 <printseed@plt>
mov    %rsp,%r13
mov    %r13,%rdi
call   1080 <printseed@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%bl
lea    0xdcf(%rip),%rbp
lea    0xdd5(%rip),%r12
xor    %r14d,%r14d
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdcc(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r14d,%r14d
mov    %r13,%rdi
cmove  %r15,%rdi
movzbl %bl,%ebp
mov    %r15,%r14
cmove  %r13,%r14
mov    %ebp,%esi
call   1060 <printstream@plt>
lea    0xda9(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1060 <printstream@plt>
mov    %r13,%rdi
call   1090 <mangle@plt>
mov    %r13,%rdi
call   1090 <mangle@plt>
mov    %r13,%rdi
call   1090 <mangle@plt>
mov    %r15,%rdi
call   1090 <mangle@plt>
mov    %r15,%rdi
call   1090 <mangle@plt>
mov    %r15,%rdi
call   1090 <mangle@plt>
movzbl 0x7(%rsp),%ebx
mov    %ebx,%r14d
and    $0x1,%r14d
lea    0xd2f(%rip),%rax
mov    %rax,%r12
lea    0xd32(%rip),%rbp
cmove  %rbp,%r12
cmove  %rax,%rbp
test   %ebx,%ebx
mov    $0x1,%eax
cmove  %eax,%ebx
jmp    1280 <main+0x110>

LLVM IR (-O0):
@__const.main.lockseed = [16 x i8] c"\00\0B\01\04\0F\04\0B\05\07\0F\0D\06\01\0E\09\08"
@__const.main.keyseed = [16 x i8] c"\00\00\09\0A\01\08\05\0F\01\01\0E\01\00\0D\0E\0C"
@.str = [28 x i8] c"Usage: %s <stream number>\0A\0A\00"
@.str.1 = [77 x i8] c"<stream number> selects one of 16 fill-in values sent by the lock on reset.\0A\00"
@.str.2 = [75 x i8] c"Both sides use it as the first nibble of the seed initially sent on D1 by\0A\00"
@.str.3 = [68 x i8] c"the lock. Transmission bit order is 3-0-1-2. e.g. '1-0-1-1' => 0xe\0A\00"
@.str.4 = [7 x i8] c"%p %p\0A\00"
@.str.5 = [76 x i8] c"invalid format for stream number. example: decimal: 15, hex: 0xe, oct: 017\0A\00"
@.str.6 = [47 x i8] c"invalid stream number. Valid range is 0x0-0xf\0A\00"
@.str.7 = [16 x i8] c"initial seeds:\0A\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [13 x i8] c"LockOutKeyIn\00"
@.str.10 = [13 x i8] c"LockInKeyOut\00"
@.str.11 = [9 x i8] c"D0[%s]: \00"
@.str.12 = [9 x i8] c"D1[%s]: \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8*]
%7 = alloca i8
%8 = alloca i8
%9 = alloca i64
%10 = alloca i8*
%11 = alloca [16 x i8]
%12 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 1, i8* %7
store i8 0, i8* %8
store i64 0, i64* %9
%13 = bitcast [16 x i8]* %11 to i8*
%14 = bitcast [16 x i8]* %12 to i8*
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 2
br i1 %16, label %17, label %25
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %3
br label %121
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i64 @strtol(i8* %28, i8** %10, i32 0)
store i64 %29, i64* %9
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = load i8*, i8** %10
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %32, i8* %33)
%35 = load i8*, i8** %10
%36 = load i8, i8* %35
%37 = icmp ne i8 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %25
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %121
40: ; preds = %25
%41 = load i64, i64* %9
%42 = icmp sgt i64 %41, 15
br i1 %42, label %46, label %43
43: ; preds = %40
%44 = load i64, i64* %9
%45 = icmp slt i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %43, %40
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %121
48: ; preds = %43
%49 = load i64, i64* %9
%50 = trunc i64 %49 to i8
%51 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 1
store i8 %50, i8* %51
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%53 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%54 = call i32 @printseed(i8* %53)
%55 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
%56 = call i32 @printseed(i8* %55)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%58 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8** %58
%59 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8** %59
br label %60
60: ; preds = %48, %120
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%62 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%63 = load i8*, i8** %62
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* %63)
%65 = load i8, i8* %8
%66 = zext i8 %65 to i32
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %60
%69 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
br label %72
70: ; preds = %60
%71 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
br label %72
72: ; preds = %70, %68
%73 = phi i8* [ %69, %68 ], [ %71, %70 ]
%74 = load i8, i8* %7
%75 = call i32 @printstream(i8* %73, i8 zeroext %74)
%76 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 1
%77 = load i8*, i8** %76
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* %77)
%79 = load i8, i8* %8
%80 = zext i8 %79 to i32
%81 = icmp ne i32 %80, 0
br i1 %81, label %82, label %84
82: ; preds = %72
%83 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
br label %86
84: ; preds = %72
%85 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
br label %86
86: ; preds = %84, %82
%87 = phi i8* [ %83, %82 ], [ %85, %84 ]
%88 = load i8, i8* %7
%89 = call i32 @printstream(i8* %87, i8 zeroext %88)
%90 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
%91 = call i32 @mangle(i8* %90)
%92 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
%93 = call i32 @mangle(i8* %92)
%94 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
%95 = call i32 @mangle(i8* %94)
%96 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%97 = call i32 @mangle(i8* %96)
%98 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%99 = call i32 @mangle(i8* %98)
%100 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%101 = call i32 @mangle(i8* %100)
%102 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 7
%103 = load i8, i8* %102
store i8 %103, i8* %7
%104 = load i8, i8* %7
%105 = zext i8 %104 to i32
%106 = and i32 %105, 1
%107 = trunc i32 %106 to i8
store i8 %107, i8* %8
%108 = load i8, i8* %8
%109 = icmp ne i8 %108, 0
br i1 %109, label %110, label %113
110: ; preds = %86
%111 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8** %111
%112 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8** %112
br label %116
113: ; preds = %86
%114 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8** %114
%115 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8** %115
br label %116
116: ; preds = %113, %110
%117 = load i8, i8* %7
%118 = icmp ne i8 %117, 0
br i1 %118, label %120, label %119
119: ; preds = %116
store i8 1, i8* %7
br label %120
120: ; preds = %119, %116
br label %60
121: ; preds = %46, %38, %17
%122 = load i32, i32* %3
ret i32 %122
}

LLVM IR (-O2):
@__const.main.lockseed = [16 x i8] c"\00\0B\01\04\0F\04\0B\05\07\0F\0D\06\01\0E\09\08"
@__const.main.keyseed = [16 x i8] c"\00\00\09\0A\01\08\05\0F\01\01\0E\01\00\0D\0E\0C"
@.str = [28 x i8] c"Usage: %s <stream number>\0A\0A\00"
@.str.4 = [7 x i8] c"%p %p\0A\00"
@.str.9 = [13 x i8] c"LockOutKeyIn\00"
@.str.10 = [13 x i8] c"LockInKeyOut\00"
@.str.11 = [9 x i8] c"D0[%s]: \00"
@.str.12 = [9 x i8] c"D1[%s]: \00"
@str = [15 x i8] c"initial seeds:\00"
@str.13 = [46 x i8] c"invalid stream number. Valid range is 0x0-0xf\00"
@str.14 = [75 x i8] c"invalid format for stream number. example: decimal: 15, hex: 0xe, oct: 017\00"
@str.15 = [76 x i8] c"<stream number> selects one of 16 fill-in values sent by the lock on reset.\00"
@str.16 = [74 x i8] c"Both sides use it as the first nibble of the seed initially sent on D1 by\00"
@str.17 = [67 x i8] c"the lock. Transmission bit order is 3-0-1-2. e.g. '1-0-1-1' => 0xe\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca [16 x i8]
%5 = alloca [16 x i8]
%6 = bitcast i8** %3 to i8*
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%9 = icmp slt i32 %0, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.15, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.16, i64 0, i64 0))
br label %61
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @strtol(i8* %17, i8** %3, i32 0)
%19 = load i8*, i8** %16
%20 = load i8*, i8** %3
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %19, i8* %20)
%22 = load i8, i8* %20
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %61
24: ; preds = %15
%25 = icmp ugt i64 %18, 15
br i1 %25, label %61, label %26
26: ; preds = %24
%27 = trunc i64 %18 to i8
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 1
store i8 %27, i8* %28
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%30 = call i32 @printseed(i8* %7)
%31 = call i32 @printseed(i8* %8)
%32 = call i32 @putchar(i32 10)
%33 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 7
br label %34
34: ; preds = %34, %26
%35 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), %26 ], [ %57, %34 ]
%36 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), %26 ], [ %58, %34 ]
%37 = phi i8 [ 1, %26 ], [ %60, %34 ]
%38 = phi i32 [ 0, %26 ], [ %55, %34 ]
%39 = call i32 @putchar(i32 10)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8* %36)
%41 = icmp eq i32 %38, 0
%42 = select i1 %41, i8* %7, i8* %8
%43 = call i32 @printstream(i8* %42, i8 zeroext %37)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* %35)
%45 = select i1 %41, i8* %8, i8* %7
%46 = call i32 @printstream(i8* %45, i8 zeroext %37)
%47 = call i32 @mangle(i8* %8)
%48 = call i32 @mangle(i8* %8)
%49 = call i32 @mangle(i8* %8)
%50 = call i32 @mangle(i8* %7)
%51 = call i32 @mangle(i8* %7)
%52 = call i32 @mangle(i8* %7)
%53 = load i8, i8* %33
%54 = and i8 %53, 1
%55 = zext i8 %54 to i32
%56 = icmp eq i8 %54, 0
%57 = select i1 %56, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0)
%58 = select i1 %56, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0)
%59 = icmp eq i8 %53, 0
%60 = select i1 %59, i8 1, i8 %53
br label %34
61: ; preds = %24, %15, %10
%62 = phi i8* [ getelementptr inbounds ([67 x i8], [67 x i8]* @str.17, i64 0, i64 0), %10 ], [ getelementptr inbounds ([75 x i8], [75 x i8]* @str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([46 x i8], [46 x i8]* @str.13, i64 0, i64 0), %24 ]
%63 = phi i32 [ -1, %10 ], [ 1, %15 ], [ 1, %24 ]
%64 = tail call i32 @puts(i8* dereferenceable(1) %62)
ret i32 %63
}