#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*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ generate_answer(char *);
int /*<<< orphan*/ get_input(char *);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ insertion_sort(char *, int);
int intersection(char *, char *, char *, char);
int /*<<< orphan*/ memset(char *, char, int);
int merge(char *, char *, int);
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int, int, char *, ...);
int /*<<< orphan*/ nocbreak();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ splash_screen();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main() {
  initscr();
  nocbreak();
  start_color();
  init_pair(1, COLOR_RED, COLOR_BLACK);
  splash_screen();
  refresh();
  clear();
  srand(time(0));
  char respuesta[2][5], user[5], hint[5];
  generate_answer(respuesta[0]);
  mvprintw(0, 20, "|------|------|");
  move(1, 0);
  refresh();
  int won = 0, k, times;
  for (times = 0; times < 10 && !won; times++) {
    k = 0;
    memset(hint, '\0', 5);
    strcpy(respuesta[1], respuesta[0]);
    mvprintw(times + 1, 0, "Intento: ");
    get_input(user);
    mvprintw(times + 1, 20, "| ");
    mvprintw(times + 1, 22, user);
    mvprintw(times + 1, 26, " | ");
    k = intersection(respuesta[1], user, hint, '!');
    if (k == 4)
      won = 1;
    insertion_sort(respuesta[1], 4);
    insertion_sort(user, 4);
    for (int j = 0; j < merge(respuesta[1], user, 4) && k < 4; j++, k++)
      hint[k] = '#';
    mvprintw(times + 1, 29, "%s", hint);
    mvprintw(times + 1, 33, " |");
    refresh();
  }
  if (!won)
    mvprintw(times + 1, 0, "\nPerdiste. La respuesta era: %s\n", respuesta[0]);
  else
    mvprintw(times + 1, 0, "\nGanaste!\n");
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1110 <nocbreak@plt>
mov    $0x0,%al
call   1060 <start_color@plt>
mov    0x2d6d(%rip),%rax
mov    (%rax),%esi
mov    0x2d74(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    $0x0,%al
call   1100 <splash_screen@plt>
mov    $0x0,%al
call   10d0 <refresh@plt>
mov    $0x0,%al
call   1120 <clear@plt>
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
lea    -0xe(%rbp),%rdi
call   1090 <generate_answer@plt>
xor    %edi,%edi
mov    $0x14,%esi
lea    0xd46(%rip),%rdx
mov    $0x0,%al
call   1140 <mvprintw@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1160 <move@plt>
mov    $0x0,%al
call   10d0 <refresh@plt>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x24(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x24(%rbp)
mov    %al,-0x29(%rbp)
jge    12fd <main+0xbd>
cmpl   $0x0,-0x1c(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    130d <main+0xcd>
jmp    14a4 <main+0x264>
movl   $0x0,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1070 <memset@plt>
lea    -0xe(%rbp),%rdi
add    $0x5,%rdi
lea    -0xe(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x24(%rbp),%edi
add    $0x1,%edi
xor    %esi,%esi
lea    0xccc(%rip),%rdx
mov    $0x0,%al
call   1140 <mvprintw@plt>
lea    -0x13(%rbp),%rdi
call   1150 <get_input@plt>
mov    -0x24(%rbp),%edi
add    $0x1,%edi
mov    $0x14,%esi
lea    0xcb5(%rip),%rdx
mov    $0x0,%al
call   1140 <mvprintw@plt>
mov    -0x24(%rbp),%edi
add    $0x1,%edi
lea    -0x13(%rbp),%rdx
mov    $0x16,%esi
mov    $0x0,%al
call   1140 <mvprintw@plt>
mov    -0x24(%rbp),%edi
add    $0x1,%edi
mov    $0x1a,%esi
lea    0xc85(%rip),%rdx
mov    $0x0,%al
call   1140 <mvprintw@plt>
lea    -0xe(%rbp),%rdi
add    $0x5,%rdi
lea    -0x13(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x21,%ecx
call   10c0 <intersection@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x4,-0x20(%rbp)
jne    13ca <main+0x18a>
movl   $0x1,-0x1c(%rbp)
lea    -0xe(%rbp),%rdi
add    $0x5,%rdi
mov    $0x4,%esi
call   1130 <insertion_sort@plt>
lea    -0x13(%rbp),%rdi
mov    $0x4,%esi
call   1130 <insertion_sort@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x30(%rbp)
lea    -0xe(%rbp),%rdi
add    $0x5,%rdi
lea    -0x13(%rbp),%rsi
mov    $0x4,%edx
call   10b0 <merge@plt>
mov    -0x30(%rbp),%ecx
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2a(%rbp)
jge    1429 <main+0x1e9>
cmpl   $0x4,-0x20(%rbp)
setl   %al
mov    %al,-0x2a(%rbp)
mov    -0x2a(%rbp),%al
test   $0x1,%al
jne    1439 <main+0x1f9>
jmp    1459 <main+0x219>
movslq -0x20(%rbp),%rax
movb   $0x23,-0x18(%rbp,%rax,1)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13f1 <main+0x1b1>
mov    -0x24(%rbp),%edi
add    $0x1,%edi
lea    -0x18(%rbp),%rcx
mov    $0x1d,%esi
lea    0xbaf(%rip),%rdx
mov    $0x0,%al
call   1140 <mvprintw@plt>
mov    -0x24(%rbp),%edi
add    $0x1,%edi
mov    $0x21,%esi
lea    0xb99(%rip),%rdx
mov    $0x0,%al
call   1140 <mvprintw@plt>
mov    $0x0,%al
call   10d0 <refresh@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12e2 <main+0xa2>
cmpl   $0x0,-0x1c(%rbp)
jne    14cd <main+0x28d>
mov    -0x24(%rbp),%edi
add    $0x1,%edi
lea    -0xe(%rbp),%rcx
xor    %esi,%esi
lea    0xb63(%rip),%rdx
mov    $0x0,%al
call   1140 <mvprintw@plt>
jmp    14e3 <main+0x2a3>
mov    -0x24(%rbp),%edi
add    $0x1,%edi
xor    %esi,%esi
lea    0xb69(%rip),%rdx
mov    $0x0,%al
call   1140 <mvprintw@plt>
mov    $0x0,%al
call   10e0 <getch@plt>
mov    $0x0,%al
call   10f0 <endwin@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1110 <nocbreak@plt>
xor    %eax,%eax
call   1060 <start_color@plt>
mov    0x2d6e(%rip),%rax
mov    (%rax),%esi
mov    0x2d75(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
xor    %eax,%eax
call   1100 <splash_screen@plt>
xor    %eax,%eax
call   10d0 <refresh@plt>
xor    %eax,%eax
call   1120 <clear@plt>
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
lea    0xe(%rsp),%rdi
call   1090 <generate_answer@plt>
lea    0xd4d(%rip),%rdx
xor    %edi,%edi
mov    $0x14,%esi
xor    %eax,%eax
call   1140 <mvprintw@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1160 <move@plt>
xor    %eax,%eax
call   10d0 <refresh@plt>
lea    0x13(%rsp),%r13
lea    0x9(%rsp),%r15
lea    0xd2b(%rip),%rbp
lea    0x23(%rsp),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1070 <memset@plt>
mov    %r13,%rdi
lea    0xe(%rsp),%rsi
call   1030 <strcpy@plt>
mov    %rbx,0x18(%rsp)
add    $0x1,%ebx
mov    %ebx,%edi
xor    %esi,%esi
mov    %rbp,%rdx
xor    %eax,%eax
call   1140 <mvprintw@plt>
mov    %r14,%rdi
call   1150 <get_input@plt>
mov    %ebx,%edi
mov    $0x14,%esi
lea    0xce3(%rip),%rdx
xor    %eax,%eax
call   1140 <mvprintw@plt>
mov    %ebx,%edi
mov    $0x16,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1140 <mvprintw@plt>
mov    %ebx,%edi
mov    $0x1a,%esi
lea    0xcbc(%rip),%rdx
xor    %eax,%eax
call   1140 <mvprintw@plt>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x21,%ecx
call   10c0 <intersection@plt>
mov    %eax,0x4(%rsp)
mov    %r13,%rdi
mov    $0x4,%esi
call   1130 <insertion_sort@plt>
mov    %r14,%rdi
mov    $0x4,%esi
call   1130 <insertion_sort@plt>
mov    %r13,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   10b0 <merge@plt>
test   %eax,%eax
jle    13ec <main+0x1ac>
cmpl   $0x3,0x4(%rsp)
jg     13ec <main+0x1ac>
movslq 0x4(%rsp),%r15
mov    $0x1,%r12d
nopl   0x0(%rax)
movb   $0x23,0x9(%rsp,%r15,1)
mov    %r13,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   10b0 <merge@plt>
cmp    %eax,%r12d
jge    13ec <main+0x1ac>
lea    0x1(%r15),%rax
add    $0x1,%r12d
cmp    $0x3,%r15
mov    %rax,%r15
jl     13c0 <main+0x180>
mov    %ebx,%edi
mov    $0x1d,%esi
lea    0xc24(%rip),%rdx
lea    0x9(%rsp),%r15
mov    %r15,%rcx
xor    %eax,%eax
call   1140 <mvprintw@plt>
mov    %ebx,%edi
mov    $0x21,%esi
lea    0xc0a(%rip),%rdx
xor    %eax,%eax
call   1140 <mvprintw@plt>
xor    %eax,%eax
call   10d0 <refresh@plt>
mov    0x18(%rsp),%rdi
cmp    $0x8,%edi
ja     143a <main+0x1fa>
cmpl   $0x4,0x4(%rsp)
jne    12f0 <main+0xb0>
add    $0x2,%edi
cmpl   $0x4,0x4(%rsp)
je     145b <main+0x21b>
lea    0xbd9(%rip),%rdx
lea    0xe(%rsp),%rcx
xor    %esi,%esi
xor    %eax,%eax
call   1140 <mvprintw@plt>
jmp    146b <main+0x22b>
lea    0xbe3(%rip),%rdx
xor    %esi,%esi
xor    %eax,%eax
call   1140 <mvprintw@plt>
xor    %eax,%eax
call   10e0 <getch@plt>
xor    %eax,%eax
call   10f0 <endwin@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@COLOR_RED = global i32 0
@COLOR_BLACK = global i32 0
@.str = [16 x i8] c"|------|------|\00"
@.str.1 = [10 x i8] c"Intento: \00"
@.str.2 = [3 x i8] c"| \00"
@.str.3 = [4 x i8] c" | \00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [3 x i8] c" |\00"
@.str.6 = [33 x i8] c"\0APerdiste. La respuesta era: %s\0A\00"
@.str.7 = [11 x i8] c"\0AGanaste!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [5 x i8]]
%3 = alloca [5 x i8]
%4 = alloca [5 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (...) @initscr()
%10 = call i32 (...) @nocbreak()
%11 = call i32 (...) @start_color()
%12 = load i32, i32* @COLOR_RED
%13 = load i32, i32* @COLOR_BLACK
%14 = call i32 @init_pair(i32 1, i32 %12, i32 %13)
%15 = call i32 (...) @splash_screen()
%16 = call i32 (...) @refresh()
%17 = call i32 (...) @clear()
%18 = call i32 @time(i32 0)
%19 = call i32 @srand(i32 %18)
%20 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 0
%21 = getelementptr inbounds [5 x i8], [5 x i8]* %20, i64 0, i64 0
%22 = call i32 @generate_answer(i8* %21)
%23 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 0, i32 20, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @move(i32 1, i32 0)
%25 = call i32 (...) @refresh()
store i32 0, i32* %5
store i32 0, i32* %7
br label %26
26: ; preds = %102, %0
%27 = load i32, i32* %7
%28 = icmp slt i32 %27, 10
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = load i32, i32* %5
%31 = icmp ne i32 %30, 0
%32 = xor i1 %31, true
br label %33
33: ; preds = %29, %26
%34 = phi i1 [ false, %26 ], [ %32, %29 ]
br i1 %34, label %35, label %105
35: ; preds = %33
store i32 0, i32* %6
%36 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%37 = call i32 @memset(i8* %36, i8 signext 0, i32 5)
%38 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 1
%39 = getelementptr inbounds [5 x i8], [5 x i8]* %38, i64 0, i64 0
%40 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 0
%41 = getelementptr inbounds [5 x i8], [5 x i8]* %40, i64 0, i64 0
%42 = call i32 @strcpy(i8* %39, i8* %41)
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
%45 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %44, i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%46 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%47 = call i32 @get_input(i8* %46)
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
%50 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %49, i32 20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%51 = load i32, i32* %7
%52 = add nsw i32 %51, 1
%53 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%54 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %52, i32 22, i8* %53)
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
%57 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %56, i32 26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%58 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 1
%59 = getelementptr inbounds [5 x i8], [5 x i8]* %58, i64 0, i64 0
%60 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%61 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%62 = call i32 @intersection(i8* %59, i8* %60, i8* %61, i8 signext 33)
store i32 %62, i32* %6
%63 = load i32, i32* %6
%64 = icmp eq i32 %63, 4
br i1 %64, label %65, label %66
65: ; preds = %35
store i32 1, i32* %5
br label %66
66: ; preds = %65, %35
%67 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 1
%68 = getelementptr inbounds [5 x i8], [5 x i8]* %67, i64 0, i64 0
%69 = call i32 @insertion_sort(i8* %68, i32 4)
%70 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%71 = call i32 @insertion_sort(i8* %70, i32 4)
store i32 0, i32* %8
br label %72
72: ; preds = %88, %66
%73 = load i32, i32* %8
%74 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 1
%75 = getelementptr inbounds [5 x i8], [5 x i8]* %74, i64 0, i64 0
%76 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%77 = call i32 @merge(i8* %75, i8* %76, i32 4)
%78 = icmp slt i32 %73, %77
br i1 %78, label %79, label %82
79: ; preds = %72
%80 = load i32, i32* %6
%81 = icmp slt i32 %80, 4
br label %82
82: ; preds = %79, %72
%83 = phi i1 [ false, %72 ], [ %81, %79 ]
br i1 %83, label %84, label %93
84: ; preds = %82
%85 = load i32, i32* %6
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 %86
store i8 35, i8* %87
br label %88
88: ; preds = %84
%89 = load i32, i32* %8
%90 = add nsw i32 %89, 1
store i32 %90, i32* %8
%91 = load i32, i32* %6
%92 = add nsw i32 %91, 1
store i32 %92, i32* %6
br label %72
93: ; preds = %82
%94 = load i32, i32* %7
%95 = add nsw i32 %94, 1
%96 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%97 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %95, i32 29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %96)
%98 = load i32, i32* %7
%99 = add nsw i32 %98, 1
%100 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %99, i32 33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%101 = call i32 (...) @refresh()
br label %102
102: ; preds = %93
%103 = load i32, i32* %7
%104 = add nsw i32 %103, 1
store i32 %104, i32* %7
br label %26
105: ; preds = %33
%106 = load i32, i32* %5
%107 = icmp ne i32 %106, 0
br i1 %107, label %114, label %108
108: ; preds = %105
%109 = load i32, i32* %7
%110 = add nsw i32 %109, 1
%111 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 0
%112 = getelementptr inbounds [5 x i8], [5 x i8]* %111, i64 0, i64 0
%113 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %110, i32 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i8* %112)
br label %118
114: ; preds = %105
%115 = load i32, i32* %7
%116 = add nsw i32 %115, 1
%117 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %116, i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %118
118: ; preds = %114, %108
%119 = call i32 (...) @getch()
%120 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@COLOR_RED = global i32 0
@COLOR_BLACK = global i32 0
@.str = [16 x i8] c"|------|------|\00"
@.str.1 = [10 x i8] c"Intento: \00"
@.str.2 = [3 x i8] c"| \00"
@.str.3 = [4 x i8] c" | \00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [3 x i8] c" |\00"
@.str.6 = [33 x i8] c"\0APerdiste. La respuesta era: %s\0A\00"
@.str.7 = [11 x i8] c"\0AGanaste!\0A\00"
define i32 @main() {
%1 = alloca [2 x [5 x i8]]
%2 = alloca [5 x i8]
%3 = alloca [5 x i8]
%4 = tail call i32 (...) @initscr()
%5 = tail call i32 (...) @nocbreak()
%6 = tail call i32 (...) @start_color()
%7 = load i32, i32* @COLOR_RED
%8 = load i32, i32* @COLOR_BLACK
%9 = tail call i32 @init_pair(i32 1, i32 %7, i32 %8)
%10 = tail call i32 (...) @splash_screen()
%11 = tail call i32 (...) @refresh()
%12 = tail call i32 (...) @clear()
%13 = tail call i32 @time(i32 0)
%14 = tail call i32 @srand(i32 %13)
%15 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %1, i64 0, i64 0, i64 0
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%17 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%18 = call i32 @generate_answer(i8* %15)
%19 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 0, i32 20, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @move(i32 1, i32 0)
%21 = call i32 (...) @refresh()
%22 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %1, i64 0, i64 1, i64 0
br label %23
23: ; preds = %0, %43
%24 = phi i32 [ 0, %0 ], [ %27, %43 ]
%25 = call i32 @memset(i8* %17, i8 signext 0, i32 5)
%26 = call i32 @strcpy(i8* %22, i8* %15)
%27 = add nuw nsw i32 %24, 1
%28 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %27, i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%29 = call i32 @get_input(i8* %16)
%30 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %27, i32 20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %27, i32 22, i8* %16)
%32 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %27, i32 26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%33 = call i32 @intersection(i8* %22, i8* %16, i8* %17, i8 signext 33)
%34 = icmp ne i32 %33, 4
%35 = call i32 @insertion_sort(i8* %22, i32 4)
%36 = call i32 @insertion_sort(i8* %16, i32 4)
%37 = call i32 @merge(i8* %22, i8* %16, i32 4)
%38 = icmp sgt i32 %37, 0
%39 = icmp slt i32 %33, 4
%40 = select i1 %38, i1 %39, i1 false
br i1 %40, label %41, label %43
41: ; preds = %23
%42 = sext i32 %33 to i64
br label %49
43: ; preds = %49, %23
%44 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %27, i32 29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %17)
%45 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %27, i32 33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%46 = call i32 (...) @refresh()
%47 = icmp ult i32 %24, 9
%48 = select i1 %47, i1 %34, i1 false
br i1 %48, label %23, label %59
49: ; preds = %41, %49
%50 = phi i64 [ %42, %41 ], [ %54, %49 ]
%51 = phi i32 [ 0, %41 ], [ %53, %49 ]
%52 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 %50
store i8 35, i8* %52
%53 = add nuw nsw i32 %51, 1
%54 = add nsw i64 %50, 1
%55 = call i32 @merge(i8* %22, i8* %16, i32 4)
%56 = icmp slt i32 %53, %55
%57 = icmp slt i64 %50, 3
%58 = select i1 %56, i1 %57, i1 false
br i1 %58, label %49, label %43
59: ; preds = %43
%60 = add nuw nsw i32 %24, 2
br i1 %34, label %61, label %63
61: ; preds = %59
%62 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %60, i32 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i8* %15)
br label %65
63: ; preds = %59
%64 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %60, i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %65
65: ; preds = %63, %61
%66 = call i32 (...) @getch()
%67 = call i32 (...) @endwin()
ret i32 0
}