#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*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  char input[40] = {'\0'};
  char equation[40] = {'\0'};
  char tempequation[40] = {'\0'};
  int tempeq1 = 0;
  int tempeq2 = 0;
  int tempsum = 0;
  int num_counter = 0;
  int num_counter2 = 0;
  int op_counter = 1;
  int counter = 0;
  int temp = 0;
  int counter2 = 0;
  int failurecount = 0;
  int successcount = 0;
  int checkcounter = 0;
  int repeatflag = 1;
  char success[512][40] = {{'\0'}};
  char failure[512][40] = {{'\0'}};
  int desired_output = 0;
  int op_selector = 0;
  int possibilities = 0;
  scanf("%s", input);
  scanf("%d", &desired_output);
  if (strlen(input) > 10) {
    return 0;
  }
  temp = strlen(input) - 1;
  possibilities = 2;
  while (counter < temp - 1) {
    possibilities = possibilities * 2;
    counter++;
  }
  while (input[num_counter2] != '\0') {
    equation[num_counter] = input[num_counter2];
    if (input[num_counter2 + 1] != 0) {
      equation[op_counter] = 'a';
    }
    num_counter++;
    num_counter++;
    op_counter++;
    op_counter++;
    num_counter2++;
  }
  counter2 = 0;
  srand(time(NULL));
  op_counter = 1;
  strcpy(tempequation, equation);
  counter = 0;
  while (counter <= possibilities) {
    while (repeatflag == 1) {
      strcpy(tempequation, equation);
      while (equation[op_counter + 1] != '\0') {
        op_selector = rand() % 2;
        switch (op_selector) {
        case 0:
          tempequation[op_counter] = 45;
          break;
        case 1:
          tempequation[op_counter] = 43;
          break;
        }
        op_counter++;
        op_counter++;
      }
      counter2 = 0;
      tempsum = 0;
      tempeq1 = tempequation[counter2] - 48;
      tempsum = tempsum + tempeq1;
      while (counter2 <= strlen(tempequation)) {
        counter2++;
        tempeq2 = tempequation[counter2 + 1] - 48;
        switch (tempequation[counter2]) {
        case '-':
          tempsum = tempsum - tempeq2;
          break;
        case '+':
          tempsum = tempsum + tempeq2;
          break;
        }
        counter2++;
      }
      repeatflag = 0;
      while (checkcounter < 512) {
        if (strcmp(tempequation, success[checkcounter]) == 0) {
          repeatflag = 1;
          tempsum = 0;
        }
        if (strcmp(tempequation, failure[checkcounter]) == 0) {
          repeatflag = 1;
          tempsum = 0;
        }
        checkcounter++;
      }
      if (counter == possibilities) {
        repeatflag = 0;
      }
      checkcounter = 0;
      op_counter = 1;
    }
    repeatflag = 1;
    checkcounter = 0;
    if (tempsum == desired_output) {
      strcpy(success[successcount], tempequation);
      successcount++;
    }
    if (tempsum != desired_output) {
      strcpy(failure[failurecount], tempequation);
      failurecount++;
    }
    tempsum = 0;
    counter2 = 0;
    op_counter = 1;
    counter++;
  }
  counter = 0;
  counter2 = 0;
  if (successcount == 0) {
    printf("-1");
    return 1;
  }
  while (counter < 512) {
    while (counter2 < (512 - counter)) {
      if (strcmp(success[counter2], success[counter2 + 1]) < 0) {
        strcpy(tempequation, success[counter2]);
        strcpy(success[counter2], success[counter2 + 1]);
        strcpy(success[counter2 + 1], tempequation);
      }
      counter2++;
    }
    counter++;
    counter2 = 0;
  }
  counter = 0;
  while (counter < successcount) {
    printf("\n%s", success[counter]);
    printf("=%d", desired_output);
    counter++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
movl   $0x0,-0x94(%rbp)
movl   $0x0,-0x98(%rbp)
movl   $0x0,-0x9c(%rbp)
movl   $0x0,-0xa0(%rbp)
movl   $0x0,-0xa4(%rbp)
movl   $0x1,-0xa8(%rbp)
movl   $0x0,-0xac(%rbp)
movl   $0x0,-0xb0(%rbp)
movl   $0x0,-0xb4(%rbp)
movl   $0x0,-0xb8(%rbp)
movl   $0x0,-0xbc(%rbp)
movl   $0x0,-0xc0(%rbp)
movl   $0x1,-0xc4(%rbp)
lea    -0x50d0(%rbp),%rdi
xor    %esi,%esi
mov    $0x5000,%edx
call   1060 <memset@plt>
lea    -0xa0d0(%rbp),%rdi
xor    %esi,%esi
mov    $0x5000,%edx
call   1060 <memset@plt>
movl   $0x0,-0xa0d4(%rbp)
movl   $0x0,-0xa0d8(%rbp)
movl   $0x0,-0xa0dc(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    0xd54(%rip),%rdi
lea    -0xa0d4(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0xa,%eax
jle    12e0 <main+0x150>
movl   $0x0,-0x4(%rbp)
jmp    1968 <main+0x7d8>
lea    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xb0(%rbp)
movl   $0x2,-0xa0dc(%rbp)
mov    -0xac(%rbp),%eax
mov    -0xb0(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1336 <main+0x1a6>
mov    -0xa0dc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xa0dc(%rbp)
mov    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
jmp    12fc <main+0x16c>
jmp    133b <main+0x1ab>
movslq -0xa4(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     13db <main+0x24b>
movslq -0xa4(%rbp),%rax
mov    -0x30(%rbp,%rax,1),%cl
movslq -0xa0(%rbp),%rax
mov    %cl,-0x60(%rbp,%rax,1)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x30(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     138b <main+0x1fb>
movslq -0xa8(%rbp),%rax
movb   $0x61,-0x60(%rbp,%rax,1)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    133b <main+0x1ab>
movl   $0x0,-0xb4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
movl   $0x1,-0xa8(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0xac(%rbp)
mov    -0xac(%rbp),%eax
cmp    -0xa0dc(%rbp),%eax
jg     17a4 <main+0x614>
jmp    1430 <main+0x2a0>
cmpl   $0x1,-0xc4(%rbp)
jne    16da <main+0x54a>
lea    -0x90(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x60(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     14f4 <main+0x364>
xor    %eax,%eax
call   10b0 <rand@plt>
mov    %eax,%edx
shr    $0x1f,%edx
mov    %eax,%ecx
add    %edx,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
mov    %eax,-0xa0d8(%rbp)
mov    -0xa0d8(%rbp),%eax
mov    %eax,-0xa0e0(%rbp)
test   %eax,%eax
je     14ae <main+0x31e>
jmp    149a <main+0x30a>
mov    -0xa0e0(%rbp),%eax
sub    $0x1,%eax
je     14c2 <main+0x332>
jmp    14d1 <main+0x341>
movslq -0xa8(%rbp),%rax
movb   $0x2d,-0x90(%rbp,%rax,1)
2d
jmp    14d1 <main+0x341>
movslq -0xa8(%rbp),%rax
movb   $0x2b,-0x90(%rbp,%rax,1)
2b
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    144d <main+0x2bd>
movl   $0x0,-0xb4(%rbp)
movl   $0x0,-0x9c(%rbp)
movslq -0xb4(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%eax
ff
sub    $0x30,%eax
mov    %eax,-0x94(%rbp)
mov    -0x9c(%rbp),%eax
add    -0x94(%rbp),%eax
mov    %eax,-0x9c(%rbp)
mov    -0xb4(%rbp),%eax
mov    %eax,-0xa0e4(%rbp)
lea    -0x90(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0xa0e4(%rbp),%eax
cmp    %ecx,%eax
jg     15f9 <main+0x469>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
movslq -0xb4(%rbp),%rax
lea    -0x90(%rbp),%rcx
movsbl 0x1(%rax,%rcx,1),%eax
add    $0xffffffd0,%eax
mov    %eax,-0x98(%rbp)
movslq -0xb4(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%eax
ff
mov    %eax,-0xa0e8(%rbp)
sub    $0x2b,%eax
je     15d3 <main+0x443>
jmp    15a8 <main+0x418>
mov    -0xa0e8(%rbp),%eax
sub    $0x2d,%eax
jne    15e5 <main+0x455>
jmp    15bc <main+0x42c>
mov    -0x9c(%rbp),%eax
sub    -0x98(%rbp),%eax
mov    %eax,-0x9c(%rbp)
jmp    15e5 <main+0x455>
mov    -0x9c(%rbp),%eax
add    -0x98(%rbp),%eax
mov    %eax,-0x9c(%rbp)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    1532 <main+0x3a2>
movl   $0x0,-0xc4(%rbp)
cmpl   $0x200,-0xc0(%rbp)
jge    16a5 <main+0x515>
lea    -0x90(%rbp),%rdi
movslq -0xc0(%rbp),%rax
lea    -0x50d0(%rbp),%rsi
imul   $0x28,%rax,%rax
add    %rax,%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1652 <main+0x4c2>
movl   $0x1,-0xc4(%rbp)
movl   $0x0,-0x9c(%rbp)
lea    -0x90(%rbp),%rdi
movslq -0xc0(%rbp),%rax
lea    -0xa0d0(%rbp),%rsi
imul   $0x28,%rax,%rax
add    %rax,%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1691 <main+0x501>
movl   $0x1,-0xc4(%rbp)
movl   $0x0,-0x9c(%rbp)
mov    -0xc0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc0(%rbp)
jmp    1603 <main+0x473>
mov    -0xac(%rbp),%eax
cmp    -0xa0dc(%rbp),%eax
jne    16c1 <main+0x531>
movl   $0x0,-0xc4(%rbp)
movl   $0x0,-0xc0(%rbp)
movl   $0x1,-0xa8(%rbp)
jmp    1430 <main+0x2a0>
movl   $0x1,-0xc4(%rbp)
movl   $0x0,-0xc0(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0xa0d4(%rbp),%eax
jne    1730 <main+0x5a0>
movslq -0xbc(%rbp),%rax
lea    -0x50d0(%rbp),%rdi
imul   $0x28,%rax,%rax
add    %rax,%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0xa0d4(%rbp),%eax
je     1772 <main+0x5e2>
movslq -0xb8(%rbp),%rax
lea    -0xa0d0(%rbp),%rdi
imul   $0x28,%rax,%rax
add    %rax,%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
movl   $0x0,-0x9c(%rbp)
movl   $0x0,-0xb4(%rbp)
movl   $0x1,-0xa8(%rbp)
mov    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
jmp    1419 <main+0x289>
movl   $0x0,-0xac(%rbp)
movl   $0x0,-0xb4(%rbp)
cmpl   $0x0,-0xbc(%rbp)
jne    17df <main+0x64f>
lea    0x834(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1968 <main+0x7d8>
jmp    17e4 <main+0x654>
cmpl   $0x200,-0xac(%rbp)
jge    18fa <main+0x76a>
jmp    17f9 <main+0x669>
mov    -0xb4(%rbp),%eax
mov    $0x200,%ecx
sub    -0xac(%rbp),%ecx
cmp    %ecx,%eax
jge    18dc <main+0x74c>
movslq -0xb4(%rbp),%rax
lea    -0x50d0(%rbp),%rdi
imul   $0x28,%rax,%rax
add    %rax,%rdi
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x50d0(%rbp),%rsi
imul   $0x28,%rax,%rax
add    %rax,%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jge    18c8 <main+0x738>
lea    -0x90(%rbp),%rdi
movslq -0xb4(%rbp),%rax
lea    -0x50d0(%rbp),%rsi
imul   $0x28,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
movslq -0xb4(%rbp),%rax
lea    -0x50d0(%rbp),%rdi
imul   $0x28,%rax,%rax
add    %rax,%rdi
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x50d0(%rbp),%rsi
imul   $0x28,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x50d0(%rbp),%rdi
imul   $0x28,%rax,%rax
add    %rax,%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    17f9 <main+0x669>
mov    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
movl   $0x0,-0xb4(%rbp)
jmp    17e4 <main+0x654>
movl   $0x0,-0xac(%rbp)
mov    -0xac(%rbp),%eax
cmp    -0xbc(%rbp),%eax
jge    1961 <main+0x7d1>
movslq -0xac(%rbp),%rax
lea    -0x50d0(%rbp),%rsi
imul   $0x28,%rax,%rax
add    %rax,%rsi
lea    0x6d1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xa0d4(%rbp),%esi
lea    0x6c1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
jmp    1904 <main+0x774>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa0b8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movq   $0x0,0xa0(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movq   $0x0,0x40(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movq   $0x0,0x70(%rsp)
lea    0xb0(%rsp),%rdi
xor    %r12d,%r12d
mov    $0x5000,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0x50b0(%rsp),%rdi
mov    $0x5000,%edx
xor    %esi,%esi
call   1060 <memset@plt>
movl   $0x0,(%rsp)
lea    0xde5(%rip),%rdi
lea    0x80(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
lea    0xdd0(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0xa,%eax
jg     15df <main+0x44f>
lea    0x80(%rsp),%rdi
call   1040 <strlen@plt>
mov    $0x2,%r14d
cmp    $0x3,%eax
jl     12a8 <main+0x118>
lea    -0x2(%rax),%edx
add    $0xfffffffd,%eax
mov    %edx,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    1283 <main+0xf3>
mov    $0x2,%r14d
jmp    1299 <main+0x109>
and    $0xfffffff8,%edx
mov    $0x2,%r14d
nopl   0x0(%rax)
shl    $0x8,%r14d
add    $0xfffffff8,%edx
jne    1290 <main+0x100>
test   %ecx,%ecx
je     12a8 <main+0x118>
nopl   (%rax)
add    %r14d,%r14d
add    $0xffffffff,%ecx
jne    12a0 <main+0x110>
mov    0x80(%rsp),%al
test   %al,%al
je     12e9 <main+0x159>
mov    %al,0x20(%rsp)
mov    0x81(%rsp),%al
test   %al,%al
je     12e9 <main+0x159>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x61,0x21(%rsp,%rcx,2)
mov    %al,0x22(%rsp,%rcx,2)
movzbl 0x82(%rsp,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    12d0 <main+0x140>
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0x50(%rsp),%rbx
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %r14d,%eax
or     $0x1,%eax
mov    %eax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x8(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
movl   $0x0,0x4(%rsp)
mov    %r14d,0x14(%rsp)
jmp    1350 <main+0x1c0>
mov    0x4(%rsp),%eax
add    $0x1,%eax
mov    %eax,0x4(%rsp)
cmp    0x10(%rsp),%eax
je     14ec <main+0x35c>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
lea    0x20(%rsp),%rsi
call   1030 <strcpy@plt>
cmpb   $0x0,0x22(%rsp)
je     13a0 <main+0x210>
xor    %ebp,%ebp
jmp    1381 <main+0x1f1>
nopl   0x0(%rax,%rax,1)
mov    $0x2d,%al
mov    %al,0x51(%rsp,%rbp,1)
cmpb   $0x0,0x24(%rsp,%rbp,1)
lea    0x2(%rbp),%rbp
je     13a0 <main+0x210>
xor    %eax,%eax
call   10b0 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
je     1370 <main+0x1e0>
cmp    $0x1,%eax
jne    1376 <main+0x1e6>
mov    $0x2b,%al
jmp    1372 <main+0x1e2>
nop
movsbl 0x50(%rsp),%r15d
add    $0xffffffd0,%r15d
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
js     1400 <main+0x270>
xor    %ebp,%ebp
jmp    13d2 <main+0x242>
nopw   0x0(%rax,%rax,1)
add    %eax,%r15d
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbp
jg     1400 <main+0x270>
movsbl 0x52(%rsp,%rbp,1),%eax
movsbl 0x51(%rsp,%rbp,1),%ecx
add    $0x2,%rbp
add    $0xffffffd0,%eax
cmp    $0x2b,%ecx
je     13c0 <main+0x230>
cmp    $0x2d,%ecx
jne    13c3 <main+0x233>
sub    %eax,%r15d
jmp    13c3 <main+0x233>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %r12d,%r12d
xor    %r13d,%r13d
mov    %rbx,%rbp
mov    $0x1,%r14d
nop
lea    (%rsp,%r12,1),%rsi
add    $0xb0,%rsi
mov    %rbp,%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
sete   %bl
lea    (%rsp,%r12,1),%rsi
add    $0x50b0,%rsi
mov    %rbp,%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
sete   %al
or     %bl,%al
mov    $0x0,%eax
cmovne %eax,%r15d
cmovne %r14d,%r13d
add    $0x28,%r12
cmp    $0x5000,%r12
jne    1410 <main+0x280>
mov    0x14(%rsp),%r14d
cmp    %r14d,0x4(%rsp)
mov    %rbp,%rbx
je     1477 <main+0x2e7>
cmp    $0x1,%r13d
je     1350 <main+0x1c0>
mov    (%rsp),%eax
cmp    %eax,%r15d
jne    14b0 <main+0x320>
mov    0x8(%rsp),%rbp
movslq %ebp,%rbp
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
lea    (%rsp,%rax,8),%rdi
add    $0xb0,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
add    $0x1,%ebp
mov    %rbp,0x8(%rsp)
mov    (%rsp),%eax
cmp    %eax,%r15d
je     1330 <main+0x1a0>
mov    0x18(%rsp),%rbp
movslq %ebp,%rbp
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
lea    (%rsp,%rax,8),%rdi
add    $0x50b0,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
add    $0x1,%ebp
mov    %rbp,0x18(%rsp)
jmp    1330 <main+0x1a0>
cmpl   $0x0,0x8(%rsp)
je     15c6 <main+0x436>
xor    %r14d,%r14d
mov    $0x200,%r12d
lea    0x50(%rsp),%r15
jmp    1521 <main+0x391>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14d
add    $0xffffffffffffffff,%r12
cmp    $0x200,%r14d
je     1570 <main+0x3e0>
mov    %r12,%rbx
lea    0xb0(%rsp),%rbp
jmp    1539 <main+0x3a9>
xchg   %ax,%ax
mov    %r13,%rbp
add    $0xffffffffffffffff,%rbx
je     1510 <main+0x380>
lea    0x28(%rbp),%r13
mov    %rbp,%rdi
mov    %r13,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jns    1530 <main+0x3a0>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
jmp    1530 <main+0x3a0>
mov    0x8(%rsp),%rax
test   %eax,%eax
jle    15dc <main+0x44c>
mov    %eax,%ebp
lea    0xb0(%rsp),%rbx
lea    0xa79(%rip),%r14
lea    0xa76(%rip),%r15
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x28,%rbx
add    $0xffffffffffffffff,%rbp
jne    15a0 <main+0x410>
jmp    15df <main+0x44f>
lea    0xa33(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%r12d
jmp    15df <main+0x44f>
xor    %r12d,%r12d
mov    %r12d,%eax
add    $0xa0b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"-1\00"
@.str.3 = [4 x i8] c"\0A%s\00"
@.str.4 = [4 x i8] c"=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i8]
%3 = alloca [40 x i8]
%4 = alloca [40 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca [512 x [40 x i8]]
%19 = alloca [512 x [40 x i8]]
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32 0, i32* %1
%23 = bitcast [40 x i8]* %2 to i8*
%24 = bitcast [40 x i8]* %3 to i8*
%25 = bitcast [40 x i8]* %4 to i8*
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 1, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 1, i32* %17
%26 = bitcast [512 x [40 x i8]]* %18 to i8*
%27 = bitcast [512 x [40 x i8]]* %19 to i8*
store i32 0, i32* %20
store i32 0, i32* %21
store i32 0, i32* %22
%28 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %28)
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %20)
%31 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%32 = call i32 @strlen(i8* %31)
%33 = icmp sgt i32 %32, 10
br i1 %33, label %34, label %35
34: ; preds = %0
store i32 0, i32* %1
br label %304
35: ; preds = %0
%36 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%37 = call i32 @strlen(i8* %36)
%38 = sub nsw i32 %37, 1
store i32 %38, i32* %12
store i32 2, i32* %22
br label %39
39: ; preds = %44, %35
%40 = load i32, i32* %11
%41 = load i32, i32* %12
%42 = sub nsw i32 %41, 1
%43 = icmp slt i32 %40, %42
br i1 %43, label %44, label %49
44: ; preds = %39
%45 = load i32, i32* %22
%46 = mul nsw i32 %45, 2
store i32 %46, i32* %22
%47 = load i32, i32* %11
%48 = add nsw i32 %47, 1
store i32 %48, i32* %11
br label %39
49: ; preds = %39
br label %50
50: ; preds = %76, %49
%51 = load i32, i32* %9
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %87
57: ; preds = %50
%58 = load i32, i32* %9
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = load i32, i32* %8
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 %63
store i8 %61, i8* %64
%65 = load i32, i32* %9
%66 = add nsw i32 %65, 1
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %76
72: ; preds = %57
%73 = load i32, i32* %10
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 %74
store i8 97, i8* %75
br label %76
76: ; preds = %72, %57
%77 = load i32, i32* %8
%78 = add nsw i32 %77, 1
store i32 %78, i32* %8
%79 = load i32, i32* %8
%80 = add nsw i32 %79, 1
store i32 %80, i32* %8
%81 = load i32, i32* %10
%82 = add nsw i32 %81, 1
store i32 %82, i32* %10
%83 = load i32, i32* %10
%84 = add nsw i32 %83, 1
store i32 %84, i32* %10
%85 = load i32, i32* %9
%86 = add nsw i32 %85, 1
store i32 %86, i32* %9
br label %50
87: ; preds = %50
store i32 0, i32* %13
%88 = call i32 @time(i32* null)
%89 = call i32 @srand(i32 %88)
store i32 1, i32* %10
%90 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%91 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%92 = call i32 @strcpy(i8* %90, i8* %91)
store i32 0, i32* %11
br label %93
93: ; preds = %228, %87
%94 = load i32, i32* %11
%95 = load i32, i32* %22
%96 = icmp sle i32 %94, %95
br i1 %96, label %97, label %231
97: ; preds = %93
br label %98
98: ; preds = %201, %97
%99 = load i32, i32* %17
%100 = icmp eq i32 %99, 1
br i1 %100, label %101, label %202
101: ; preds = %98
%102 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%103 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%104 = call i32 @strcpy(i8* %102, i8* %103)
br label %105
105: ; preds = %125, %101
%106 = load i32, i32* %10
%107 = add nsw i32 %106, 1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 %108
%110 = load i8, i8* %109
%111 = sext i8 %110 to i32
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %130
113: ; preds = %105
%114 = call i32 (...) @rand()
%115 = srem i32 %114, 2
store i32 %115, i32* %21
%116 = load i32, i32* %21
switch i32 %116, label %125 [
i32 0, label %117
i32 1, label %121
]
117: ; preds = %113
%118 = load i32, i32* %10
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 %119
store i8 45, i8* %120
br label %125
121: ; preds = %113
%122 = load i32, i32* %10
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 %123
store i8 43, i8* %124
br label %125
125: ; preds = %113, %121, %117
%126 = load i32, i32* %10
%127 = add nsw i32 %126, 1
store i32 %127, i32* %10
%128 = load i32, i32* %10
%129 = add nsw i32 %128, 1
store i32 %129, i32* %10
br label %105
130: ; preds = %105
store i32 0, i32* %13
store i32 0, i32* %7
%131 = load i32, i32* %13
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 %132
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = sub nsw i32 %135, 48
store i32 %136, i32* %5
%137 = load i32, i32* %7
%138 = load i32, i32* %5
%139 = add nsw i32 %137, %138
store i32 %139, i32* %7
br label %140
140: ; preds = %168, %130
%141 = load i32, i32* %13
%142 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%143 = call i32 @strlen(i8* %142)
%144 = icmp sle i32 %141, %143
br i1 %144, label %145, label %171
145: ; preds = %140
%146 = load i32, i32* %13
%147 = add nsw i32 %146, 1
store i32 %147, i32* %13
%148 = load i32, i32* %13
%149 = add nsw i32 %148, 1
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 %150
%152 = load i8, i8* %151
%153 = sext i8 %152 to i32
%154 = sub nsw i32 %153, 48
store i32 %154, i32* %6
%155 = load i32, i32* %13
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 %156
%158 = load i8, i8* %157
%159 = sext i8 %158 to i32
switch i32 %159, label %168 [
i32 45, label %160
i32 43, label %164
]
160: ; preds = %145
%161 = load i32, i32* %7
%162 = load i32, i32* %6
%163 = sub nsw i32 %161, %162
store i32 %163, i32* %7
br label %168
164: ; preds = %145
%165 = load i32, i32* %7
%166 = load i32, i32* %6
%167 = add nsw i32 %165, %166
store i32 %167, i32* %7
br label %168
168: ; preds = %145, %164, %160
%169 = load i32, i32* %13
%170 = add nsw i32 %169, 1
store i32 %170, i32* %13
br label %140
171: ; preds = %140
store i32 0, i32* %17
br label %172
172: ; preds = %193, %171
%173 = load i32, i32* %16
%174 = icmp slt i32 %173, 512
br i1 %174, label %175, label %196
175: ; preds = %172
%176 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%177 = load i32, i32* %16
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %18, i64 0, i64 %178
%180 = getelementptr inbounds [40 x i8], [40 x i8]* %179, i64 0, i64 0
%181 = call i64 @strcmp(i8* %176, i8* %180)
%182 = icmp eq i64 %181, 0
br i1 %182, label %183, label %184
183: ; preds = %175
store i32 1, i32* %17
store i32 0, i32* %7
br label %184
184: ; preds = %183, %175
%185 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%186 = load i32, i32* %16
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %19, i64 0, i64 %187
%189 = getelementptr inbounds [40 x i8], [40 x i8]* %188, i64 0, i64 0
%190 = call i64 @strcmp(i8* %185, i8* %189)
%191 = icmp eq i64 %190, 0
br i1 %191, label %192, label %193
192: ; preds = %184
store i32 1, i32* %17
store i32 0, i32* %7
br label %193
193: ; preds = %192, %184
%194 = load i32, i32* %16
%195 = add nsw i32 %194, 1
store i32 %195, i32* %16
br label %172
196: ; preds = %172
%197 = load i32, i32* %11
%198 = load i32, i32* %22
%199 = icmp eq i32 %197, %198
br i1 %199, label %200, label %201
200: ; preds = %196
store i32 0, i32* %17
br label %201
201: ; preds = %200, %196
store i32 0, i32* %16
store i32 1, i32* %10
br label %98
202: ; preds = %98
store i32 1, i32* %17
store i32 0, i32* %16
%203 = load i32, i32* %7
%204 = load i32, i32* %20
%205 = icmp eq i32 %203, %204
br i1 %205, label %206, label %215
206: ; preds = %202
%207 = load i32, i32* %15
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %18, i64 0, i64 %208
%210 = getelementptr inbounds [40 x i8], [40 x i8]* %209, i64 0, i64 0
%211 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%212 = call i32 @strcpy(i8* %210, i8* %211)
%213 = load i32, i32* %15
%214 = add nsw i32 %213, 1
store i32 %214, i32* %15
br label %215
215: ; preds = %206, %202
%216 = load i32, i32* %7
%217 = load i32, i32* %20
%218 = icmp ne i32 %216, %217
br i1 %218, label %219, label %228
219: ; preds = %215
%220 = load i32, i32* %14
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %19, i64 0, i64 %221
%223 = getelementptr inbounds [40 x i8], [40 x i8]* %222, i64 0, i64 0
%224 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%225 = call i32 @strcpy(i8* %223, i8* %224)
%226 = load i32, i32* %14
%227 = add nsw i32 %226, 1
store i32 %227, i32* %14
br label %228
228: ; preds = %219, %215
store i32 0, i32* %7
store i32 0, i32* %13
store i32 1, i32* %10
%229 = load i32, i32* %11
%230 = add nsw i32 %229, 1
store i32 %230, i32* %11
br label %93
231: ; preds = %93
store i32 0, i32* %11
store i32 0, i32* %13
%232 = load i32, i32* %15
%233 = icmp eq i32 %232, 0
br i1 %233, label %234, label %236
234: ; preds = %231
%235 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %304
236: ; preds = %231
br label %237
237: ; preds = %285, %236
%238 = load i32, i32* %11
%239 = icmp slt i32 %238, 512
br i1 %239, label %240, label %288
240: ; preds = %237
br label %241
241: ; preds = %282, %240
%242 = load i32, i32* %13
%243 = load i32, i32* %11
%244 = sub nsw i32 512, %243
%245 = icmp slt i32 %242, %244
br i1 %245, label %246, label %285
246: ; preds = %241
%247 = load i32, i32* %13
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %18, i64 0, i64 %248
%250 = getelementptr inbounds [40 x i8], [40 x i8]* %249, i64 0, i64 0
%251 = load i32, i32* %13
%252 = add nsw i32 %251, 1
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %18, i64 0, i64 %253
%255 = getelementptr inbounds [40 x i8], [40 x i8]* %254, i64 0, i64 0
%256 = call i64 @strcmp(i8* %250, i8* %255)
%257 = icmp slt i64 %256, 0
br i1 %257, label %258, label %282
258: ; preds = %246
%259 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%260 = load i32, i32* %13
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %18, i64 0, i64 %261
%263 = getelementptr inbounds [40 x i8], [40 x i8]* %262, i64 0, i64 0
%264 = call i32 @strcpy(i8* %259, i8* %263)
%265 = load i32, i32* %13
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %18, i64 0, i64 %266
%268 = getelementptr inbounds [40 x i8], [40 x i8]* %267, i64 0, i64 0
%269 = load i32, i32* %13
%270 = add nsw i32 %269, 1
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %18, i64 0, i64 %271
%273 = getelementptr inbounds [40 x i8], [40 x i8]* %272, i64 0, i64 0
%274 = call i32 @strcpy(i8* %268, i8* %273)
%275 = load i32, i32* %13
%276 = add nsw i32 %275, 1
%277 = sext i32 %276 to i64
%278 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %18, i64 0, i64 %277
%279 = getelementptr inbounds [40 x i8], [40 x i8]* %278, i64 0, i64 0
%280 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%281 = call i32 @strcpy(i8* %279, i8* %280)
br label %282
282: ; preds = %258, %246
%283 = load i32, i32* %13
%284 = add nsw i32 %283, 1
store i32 %284, i32* %13
br label %241
285: ; preds = %241
%286 = load i32, i32* %11
%287 = add nsw i32 %286, 1
store i32 %287, i32* %11
store i32 0, i32* %13
br label %237
288: ; preds = %237
store i32 0, i32* %11
br label %289
289: ; preds = %293, %288
%290 = load i32, i32* %11
%291 = load i32, i32* %15
%292 = icmp slt i32 %290, %291
br i1 %292, label %293, label %303
293: ; preds = %289
%294 = load i32, i32* %11
%295 = sext i32 %294 to i64
%296 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %18, i64 0, i64 %295
%297 = getelementptr inbounds [40 x i8], [40 x i8]* %296, i64 0, i64 0
%298 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %297)
%299 = load i32, i32* %20
%300 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %299)
%301 = load i32, i32* %11
%302 = add nsw i32 %301, 1
store i32 %302, i32* %11
br label %289
303: ; preds = %289
store i32 0, i32* %1
br label %304
304: ; preds = %303, %234, %34
%305 = load i32, i32* %1
ret i32 %305
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"-1\00"
@.str.3 = [4 x i8] c"\0A%s\00"
@.str.4 = [4 x i8] c"=%d\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = alloca [40 x i8]
%3 = alloca [40 x i8]
%4 = alloca [512 x [40 x i8]]
%5 = alloca [512 x [40 x i8]]
%6 = alloca i32
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %4, i64 0, i64 0, i64 0
%11 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %5, i64 0, i64 0, i64 0
%12 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%15 = call i32 @strlen(i8* %7)
%16 = icmp sgt i32 %15, 10
br i1 %16, label %199, label %17
17: ; preds = %0
%18 = call i32 @strlen(i8* %7)
%19 = add i32 %18, -2
%20 = icmp sgt i32 %18, 2
br i1 %20, label %21, label %37
21: ; preds = %17
%22 = add i32 %18, -3
%23 = and i32 %19, 7
%24 = icmp ult i32 %22, 7
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = and i32 %19, -8
br label %46
27: ; preds = %46, %21
%28 = phi i32 [ undef, %21 ], [ %49, %46 ]
%29 = phi i32 [ 2, %21 ], [ %49, %46 ]
%30 = icmp eq i32 %23, 0
br i1 %30, label %37, label %31
31: ; preds = %27, %31
%32 = phi i32 [ %34, %31 ], [ %29, %27 ]
%33 = phi i32 [ %35, %31 ], [ 0, %27 ]
%34 = shl nsw i32 %32, 1
%35 = add i32 %33, 1
%36 = icmp eq i32 %35, %23
br i1 %36, label %37, label %31
37: ; preds = %27, %31, %17
%38 = phi i32 [ 2, %17 ], [ %28, %27 ], [ %34, %31 ]
%39 = load i8, i8* %7
%40 = icmp eq i8 %39, 0
br i1 %40, label %65, label %41
41: ; preds = %37
%42 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
store i8 %39, i8* %42
%43 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 1
%44 = load i8, i8* %43
%45 = icmp eq i8 %44, 0
br i1 %45, label %65, label %52
46: ; preds = %46, %25
%47 = phi i32 [ 2, %25 ], [ %49, %46 ]
%48 = phi i32 [ 0, %25 ], [ %50, %46 ]
%49 = shl i32 %47, 8
%50 = add i32 %48, 8
%51 = icmp eq i32 %50, %26
br i1 %51, label %27, label %46
52: ; preds = %41, %52
%53 = phi i8 [ %63, %52 ], [ %44, %41 ]
%54 = phi i64 [ %61, %52 ], [ 1, %41 ]
%55 = phi i64 [ %59, %52 ], [ 1, %41 ]
%56 = phi i64 [ %58, %52 ], [ 0, %41 ]
%57 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 %55
store i8 97, i8* %57
%58 = add nuw i64 %56, 2
%59 = add nuw i64 %55, 2
%60 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 %58
store i8 %53, i8* %60
%61 = add nuw nsw i64 %54, 1
%62 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = icmp eq i8 %63, 0
br i1 %64, label %65, label %52
65: ; preds = %52, %41, %37
%66 = call i32 @time(i32* null)
%67 = call i32 @srand(i32 %66)
%68 = call i32 @strcpy(i8* %9, i8* %8)
%69 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 2
%70 = or i32 %38, 1
br label %71
71: ; preds = %65, %159
%72 = phi i32 [ 0, %65 ], [ %152, %159 ]
%73 = phi i32 [ 0, %65 ], [ %160, %159 ]
%74 = phi i32 [ 0, %65 ], [ %161, %159 ]
%75 = icmp ne i32 %74, %38
br label %76
76: ; preds = %71, %138
%77 = call i32 @strcpy(i8* %9, i8* %8)
%78 = load i8, i8* %69
%79 = icmp eq i8 %78, 0
br i1 %79, label %94, label %80
80: ; preds = %76, %88
%81 = phi i64 [ %89, %88 ], [ 1, %76 ]
%82 = call i32 (...) @rand()
%83 = srem i32 %82, 2
switch i32 %83, label %88 [
i32 0, label %85
i32 1, label %84
]
84: ; preds = %80
br label %85
85: ; preds = %80, %84
%86 = phi i8 [ 43, %84 ], [ 45, %80 ]
%87 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 %81
store i8 %86, i8* %87
br label %88
88: ; preds = %85, %80
%89 = add nuw i64 %81, 2
%90 = add nuw nsw i64 %81, 3
%91 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 %90
%92 = load i8, i8* %91
%93 = icmp eq i8 %92, 0
br i1 %93, label %94, label %80
94: ; preds = %88, %76
%95 = load i8, i8* %9
%96 = sext i8 %95 to i32
%97 = add nsw i32 %96, -48
%98 = call i32 @strlen(i8* %9)
%99 = icmp slt i32 %98, 0
br i1 %99, label %121, label %100
100: ; preds = %94, %116
%101 = phi i64 [ %104, %116 ], [ 0, %94 ]
%102 = phi i32 [ %117, %116 ], [ %97, %94 ]
%103 = or i64 %101, 1
%104 = add nuw nsw i64 %101, 2
%105 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 %104
%106 = load i8, i8* %105
%107 = sext i8 %106 to i32
%108 = add nsw i32 %107, -48
%109 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 %103
%110 = load i8, i8* %109
%111 = sext i8 %110 to i32
switch i32 %111, label %116 [
i32 45, label %112
i32 43, label %114
]
112: ; preds = %100
%113 = sub nsw i32 %102, %108
br label %116
114: ; preds = %100
%115 = add nsw i32 %108, %102
br label %116
116: ; preds = %100, %114, %112
%117 = phi i32 [ %102, %100 ], [ %115, %114 ], [ %113, %112 ]
%118 = call i32 @strlen(i8* %9)
%119 = sext i32 %118 to i64
%120 = icmp sgt i64 %104, %119
br i1 %120, label %121, label %100
121: ; preds = %116, %94
%122 = phi i32 [ %97, %94 ], [ %117, %116 ]
br label %123
123: ; preds = %121, %123
%124 = phi i64 [ %136, %123 ], [ 0, %121 ]
%125 = phi i32 [ %135, %123 ], [ 0, %121 ]
%126 = phi i32 [ %134, %123 ], [ %122, %121 ]
%127 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %4, i64 0, i64 %124, i64 0
%128 = call i64 @strcmp(i8* %9, i8* %127)
%129 = icmp eq i64 %128, 0
%130 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %5, i64 0, i64 %124, i64 0
%131 = call i64 @strcmp(i8* %9, i8* %130)
%132 = icmp eq i64 %131, 0
%133 = select i1 %132, i1 true, i1 %129
%134 = select i1 %133, i32 0, i32 %126
%135 = select i1 %133, i32 1, i32 %125
%136 = add nuw nsw i64 %124, 1
%137 = icmp eq i64 %136, 512
br i1 %137, label %138, label %123
138: ; preds = %123
%139 = icmp eq i32 %135, 1
%140 = select i1 %75, i1 %139, i1 false
br i1 %140, label %76, label %141
141: ; preds = %138
%142 = load i32, i32* %6
%143 = icmp eq i32 %134, %142
br i1 %143, label %144, label %150
144: ; preds = %141
%145 = sext i32 %72 to i64
%146 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %4, i64 0, i64 %145, i64 0
%147 = call i32 @strcpy(i8* %146, i8* %9)
%148 = add nsw i32 %72, 1
%149 = load i32, i32* %6
br label %150
150: ; preds = %144, %141
%151 = phi i32 [ %149, %144 ], [ %142, %141 ]
%152 = phi i32 [ %148, %144 ], [ %72, %141 ]
%153 = icmp eq i32 %134, %151
br i1 %153, label %159, label %154
154: ; preds = %150
%155 = sext i32 %73 to i64
%156 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %5, i64 0, i64 %155, i64 0
%157 = call i32 @strcpy(i8* %156, i8* %9)
%158 = add nsw i32 %73, 1
br label %159
159: ; preds = %154, %150
%160 = phi i32 [ %158, %154 ], [ %73, %150 ]
%161 = add nuw i32 %74, 1
%162 = icmp eq i32 %161, %70
br i1 %162, label %163, label %71
163: ; preds = %159
%164 = icmp eq i32 %152, 0
br i1 %164, label %165, label %167
165: ; preds = %163
%166 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %199
167: ; preds = %163, %187
%168 = phi i64 [ %189, %187 ], [ 512, %163 ]
%169 = phi i32 [ %188, %187 ], [ 0, %163 ]
br label %174
170: ; preds = %187
%171 = icmp sgt i32 %152, 0
br i1 %171, label %172, label %199
172: ; preds = %170
%173 = zext i32 %152 to i64
br label %191
174: ; preds = %167, %185
%175 = phi i64 [ 0, %167 ], [ %177, %185 ]
%176 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %4, i64 0, i64 %175, i64 0
%177 = add nuw nsw i64 %175, 1
%178 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %4, i64 0, i64 %177, i64 0
%179 = call i64 @strcmp(i8* %176, i8* %178)
%180 = icmp slt i64 %179, 0
br i1 %180, label %181, label %185
181: ; preds = %174
%182 = call i32 @strcpy(i8* %9, i8* %176)
%183 = call i32 @strcpy(i8* %176, i8* %178)
%184 = call i32 @strcpy(i8* %178, i8* %9)
br label %185
185: ; preds = %181, %174
%186 = icmp eq i64 %177, %168
br i1 %186, label %187, label %174
187: ; preds = %185
%188 = add nuw nsw i32 %169, 1
%189 = add nsw i64 %168, -1
%190 = icmp eq i32 %188, 512
br i1 %190, label %170, label %167
191: ; preds = %172, %191
%192 = phi i64 [ 0, %172 ], [ %197, %191 ]
%193 = getelementptr inbounds [512 x [40 x i8]], [512 x [40 x i8]]* %4, i64 0, i64 %192, i64 0
%194 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %193)
%195 = load i32, i32* %6
%196 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %195)
%197 = add nuw nsw i64 %192, 1
%198 = icmp eq i64 %197, %173
br i1 %198, label %199, label %191
199: ; preds = %191, %170, %0, %165
%200 = phi i32 [ 1, %165 ], [ 0, %0 ], [ 0, %170 ], [ 0, %191 ]
ret i32 %200
}