#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*/ generate_answer(char *);
int get_input(char *);
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*/ printf(char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main() {
  srand(time(0));
  char respuesta[2][5], user[5], hint[5];
  generate_answer(respuesta[0]);
  printf("MASTERMIND\n\n");
  printf("Instrucciones del juego:\n");
  printf(
      "El objetivo del juego es adivinar la combinacion correcta de letras.\n");
  printf("Para ello tienes que escribir una combinacion de 4 letras entre la a "
         "y la f,\n");
  printf("despues de cada tiro te aparece una pista.\n\nLa pista consiste en "
         "el signo de ");
  printf("exclamacion (!), significando que tienes una\nletra correcta en la "
         "posicion ");
  printf("correcta.\n\nMientras que el simbolo de gato (#) significa que "
         "tienes una letra\n");
  printf("correcta pero en la posicion incorrecta.\n");
  printf("\nEn total tienes 10 tiros.\nBuena suerte.\n\n");
  int won = 0, k, returned, times = 0;
  while (times < 10 && !won) {
    k = 0;
    memset(hint, '\0', 5);
    strcpy(respuesta[1], respuesta[0]);
    printf("Ingresa respuesta: ");
    returned = get_input(user);
    if (returned == 4) {
      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] = '#';
      printf("Hint: %s\n\n", hint);
      times++;
    } else
      printf("\tIngresa una combinacion de 4 letras entre la a y la f\n\n");
  }
  if (!won)
    printf("Perdiste. La respuesta era: %s\n", respuesta[0]);
  else
    printf("Ganaste!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
lea    -0xe(%rbp),%rdi
call   1070 <generate_answer@plt>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x28(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x28(%rbp)
mov    %al,-0x2d(%rbp)
jge    126d <main+0xcd>
cmpl   $0x0,-0x1c(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
test   $0x1,%al
jne    127d <main+0xdd>
jmp    13b9 <main+0x219>
movl   $0x0,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1050 <memset@plt>
lea    -0xe(%rbp),%rdi
add    $0x5,%rdi
lea    -0xe(%rbp),%rsi
call   1030 <strcpy@plt>
lea    0xf4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x13(%rbp),%rdi
call   10c0 <get_input@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jne    13a6 <main+0x206>
lea    -0xe(%rbp),%rdi
add    $0x5,%rdi
lea    -0x13(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x21,%ecx
call   10a0 <intersection@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x4,-0x20(%rbp)
jne    12f7 <main+0x157>
movl   $0x1,-0x1c(%rbp)
lea    -0xe(%rbp),%rdi
add    $0x5,%rdi
mov    $0x4,%esi
call   10b0 <insertion_sort@plt>
lea    -0x13(%rbp),%rdi
mov    $0x4,%esi
call   10b0 <insertion_sort@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x34(%rbp)
lea    -0xe(%rbp),%rdi
add    $0x5,%rdi
lea    -0x13(%rbp),%rsi
mov    $0x4,%edx
call   1090 <merge@plt>
mov    -0x34(%rbp),%ecx
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2e(%rbp)
jge    1356 <main+0x1b6>
cmpl   $0x4,-0x20(%rbp)
setl   %al
mov    %al,-0x2e(%rbp)
mov    -0x2e(%rbp),%al
test   $0x1,%al
jne    1366 <main+0x1c6>
jmp    1386 <main+0x1e6>
movslq -0x20(%rbp),%rax
movb   $0x23,-0x18(%rbp,%rax,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    131e <main+0x17e>
lea    -0x18(%rbp),%rsi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13b4 <main+0x214>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1252 <main+0xb2>
cmpl   $0x0,-0x1c(%rbp)
jne    13da <main+0x23a>
lea    -0xe(%rbp),%rsi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13e8 <main+0x248>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0x9(%rsp),%rbp
mov    %rbp,%rdi
call   1080 <generate_answer@plt>
lea    0xef9(%rip),%rdi
call   1040 <puts@plt>
lea    0xef9(%rip),%rdi
call   1040 <puts@plt>
lea    0xf06(%rip),%rdi
call   1040 <puts@plt>
lea    0xf3f(%rip),%rdi
call   1040 <puts@plt>
lea    0xdf0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe30(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf64(%rip),%rdi
call   1040 <puts@plt>
lea    0xfa6(%rip),%rdi
call   1040 <puts@plt>
lea    0xfc3(%rip),%rdi
call   1040 <puts@plt>
lea    0xe(%rsp),%r13
lea    0x4(%rsp),%r15
lea    0x13(%rsp),%rbx
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1060 <memset@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
lea    0xe19(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   10d0 <get_input@plt>
cmp    $0x4,%eax
jne    1360 <main+0x1b0>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    $0x21,%ecx
call   10b0 <intersection@plt>
mov    %eax,%ebp
xor    %r12d,%r12d
cmp    $0x4,%eax
sete   0x3(%rsp)
mov    %r13,%rdi
mov    $0x4,%esi
call   10c0 <insertion_sort@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   10c0 <insertion_sort@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   10a0 <merge@plt>
test   %eax,%eax
jle    132a <main+0x17a>
cmp    $0x3,%ebp
jg     132a <main+0x17a>
movslq %ebp,%r15
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x23,0x4(%rsp,%r15,1)
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   10a0 <merge@plt>
cmp    %eax,%ebp
jge    132a <main+0x17a>
lea    0x1(%r15),%rax
add    $0x1,%ebp
cmp    $0x3,%r15
mov    %rax,%r15
jl     1300 <main+0x150>
mov    0x3(%rsp),%al
mov    %al,%r12b
lea    0xd76(%rip),%rdi
lea    0x4(%rsp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r14d
lea    0x9(%rsp),%rbp
cmp    $0x9,%r14d
jle    1375 <main+0x1c5>
jmp    137e <main+0x1ce>
nopl   0x0(%rax,%rax,1)
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
xor    %r12d,%r12d
cmp    $0x9,%r14d
jg     137e <main+0x1ce>
test   %r12d,%r12d
je     1260 <main+0xb0>
test   %r12d,%r12d
je     1391 <main+0x1e1>
lea    0xea7(%rip),%rdi
call   1040 <puts@plt>
jmp    13a4 <main+0x1f4>
lea    0xd21(%rip),%rdi
lea    0x9(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"MASTERMIND\0A\0A\00"
@.str.1 = [26 x i8] c"Instrucciones del juego:\0A\00"
@.str.2 = [70 x i8] c"El objetivo del juego es adivinar la combinacion correcta de letras.\0A\00"
@.str.3 = [78 x i8] c"Para ello tienes que escribir una combinacion de 4 letras entre la a y la f,\0A\00"
@.str.4 = [78 x i8] c"despues de cada tiro te aparece una pista.\0A\0ALa pista consiste en el signo de \00"
@.str.5 = [76 x i8] c"exclamacion (!), significando que tienes una\0Aletra correcta en la posicion \00"
@.str.6 = [79 x i8] c"correcta.\0A\0AMientras que el simbolo de gato (#) significa que tienes una letra\0A\00"
@.str.7 = [42 x i8] c"correcta pero en la posicion incorrecta.\0A\00"
@.str.8 = [43 x i8] c"\0AEn total tienes 10 tiros.\0ABuena suerte.\0A\0A\00"
@.str.9 = [20 x i8] c"Ingresa respuesta: \00"
@.str.10 = [11 x i8] c"Hint: %s\0A\0A\00"
@.str.11 = [57 x i8] c"\09Ingresa una combinacion de 4 letras entre la a y la f\0A\0A\00"
@.str.12 = [32 x i8] c"Perdiste. La respuesta era: %s\0A\00"
@.str.13 = [10 x i8] c"Ganaste!\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
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 @time(i32 0)
%11 = call i32 @srand(i32 %10)
%12 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 0
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %12, i64 0, i64 0
%14 = call i32 @generate_answer(i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.5, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %5
store i32 0, i32* %8
br label %24
24: ; preds = %89, %0
%25 = load i32, i32* %8
%26 = icmp slt i32 %25, 10
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = load i32, i32* %5
%29 = icmp ne i32 %28, 0
%30 = xor i1 %29, true
br label %31
31: ; preds = %27, %24
%32 = phi i1 [ false, %24 ], [ %30, %27 ]
br i1 %32, label %33, label %90
33: ; preds = %31
store i32 0, i32* %6
%34 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%35 = call i32 @memset(i8* %34, i8 signext 0, i32 5)
%36 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 1
%37 = getelementptr inbounds [5 x i8], [5 x i8]* %36, i64 0, i64 0
%38 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 0
%39 = getelementptr inbounds [5 x i8], [5 x i8]* %38, i64 0, i64 0
%40 = call i32 @strcpy(i8* %37, i8* %39)
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
%42 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%43 = call i32 @get_input(i8* %42)
store i32 %43, i32* %7
%44 = load i32, i32* %7
%45 = icmp eq i32 %44, 4
br i1 %45, label %46, label %87
46: ; preds = %33
%47 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 1
%48 = getelementptr inbounds [5 x i8], [5 x i8]* %47, i64 0, i64 0
%49 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%50 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%51 = call i32 @intersection(i8* %48, i8* %49, i8* %50, i8 signext 33)
store i32 %51, i32* %6
%52 = load i32, i32* %6
%53 = icmp eq i32 %52, 4
br i1 %53, label %54, label %55
54: ; preds = %46
store i32 1, i32* %5
br label %55
55: ; preds = %54, %46
%56 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 1
%57 = getelementptr inbounds [5 x i8], [5 x i8]* %56, i64 0, i64 0
%58 = call i32 @insertion_sort(i8* %57, i32 4)
%59 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%60 = call i32 @insertion_sort(i8* %59, i32 4)
store i32 0, i32* %9
br label %61
61: ; preds = %77, %55
%62 = load i32, i32* %9
%63 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 1
%64 = getelementptr inbounds [5 x i8], [5 x i8]* %63, i64 0, i64 0
%65 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%66 = call i32 @merge(i8* %64, i8* %65, i32 4)
%67 = icmp slt i32 %62, %66
br i1 %67, label %68, label %71
68: ; preds = %61
%69 = load i32, i32* %6
%70 = icmp slt i32 %69, 4
br label %71
71: ; preds = %68, %61
%72 = phi i1 [ false, %61 ], [ %70, %68 ]
br i1 %72, label %73, label %82
73: ; preds = %71
%74 = load i32, i32* %6
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 %75
store i8 35, i8* %76
br label %77
77: ; preds = %73
%78 = load i32, i32* %9
%79 = add nsw i32 %78, 1
store i32 %79, i32* %9
%80 = load i32, i32* %6
%81 = add nsw i32 %80, 1
store i32 %81, i32* %6
br label %61
82: ; preds = %71
%83 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %83)
%85 = load i32, i32* %8
%86 = add nsw i32 %85, 1
store i32 %86, i32* %8
br label %89
87: ; preds = %33
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.11, i64 0, i64 0))
br label %89
89: ; preds = %87, %82
br label %24
90: ; preds = %31
%91 = load i32, i32* %5
%92 = icmp ne i32 %91, 0
br i1 %92, label %97, label %93
93: ; preds = %90
%94 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %2, i64 0, i64 0
%95 = getelementptr inbounds [5 x i8], [5 x i8]* %94, i64 0, i64 0
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0), i8* %95)
br label %99
97: ; preds = %90
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0))
br label %99
99: ; preds = %97, %93
%100 = load i32, i32* %1
ret i32 %100
}

LLVM IR (-O2):
@.str.4 = [78 x i8] c"despues de cada tiro te aparece una pista.\0A\0ALa pista consiste en el signo de \00"
@.str.5 = [76 x i8] c"exclamacion (!), significando que tienes una\0Aletra correcta en la posicion \00"
@.str.9 = [20 x i8] c"Ingresa respuesta: \00"
@.str.10 = [11 x i8] c"Hint: %s\0A\0A\00"
@.str.12 = [32 x i8] c"Perdiste. La respuesta era: %s\0A\00"
@str = [12 x i8] c"MASTERMIND\0A\00"
@str.14 = [25 x i8] c"Instrucciones del juego:\00"
@str.15 = [69 x i8] c"El objetivo del juego es adivinar la combinacion correcta de letras.\00"
@str.16 = [77 x i8] c"Para ello tienes que escribir una combinacion de 4 letras entre la a y la f,\00"
@str.17 = [78 x i8] c"correcta.\0A\0AMientras que el simbolo de gato (#) significa que tienes una letra\00"
@str.18 = [41 x i8] c"correcta pero en la posicion incorrecta.\00"
@str.19 = [42 x i8] c"\0AEn total tienes 10 tiros.\0ABuena suerte.\0A\00"
@str.20 = [9 x i8] c"Ganaste!\00"
@str.21 = [56 x i8] c"\09Ingresa una combinacion de 4 letras entre la a y la f\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 @time(i32 0)
%5 = tail call i32 @srand(i32 %4)
%6 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %1, i64 0, i64 0, i64 0
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%9 = call i32 @generate_answer(i8* %6)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.14, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str.15, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.16, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.17, i64 0, i64 0))
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.18, i64 0, i64 0))
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.19, i64 0, i64 0))
%19 = getelementptr inbounds [2 x [5 x i8]], [2 x [5 x i8]]* %1, i64 0, i64 1, i64 0
br label %20
20: ; preds = %0, %54
%21 = phi i32 [ 0, %0 ], [ %56, %54 ]
%22 = call i32 @memset(i8* %8, i8 signext 0, i32 5)
%23 = call i32 @strcpy(i8* %19, i8* %6)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
%25 = call i32 @get_input(i8* %7)
%26 = icmp eq i32 %25, 4
br i1 %26, label %27, label %52
27: ; preds = %20
%28 = call i32 @intersection(i8* %19, i8* %7, i8* %8, i8 signext 33)
%29 = icmp eq i32 %28, 4
%30 = zext i1 %29 to i32
%31 = call i32 @insertion_sort(i8* %19, i32 4)
%32 = call i32 @insertion_sort(i8* %7, i32 4)
%33 = call i32 @merge(i8* %19, i8* %7, i32 4)
%34 = icmp sgt i32 %33, 0
%35 = icmp slt i32 %28, 4
%36 = select i1 %34, i1 %35, i1 false
br i1 %36, label %37, label %39
37: ; preds = %27
%38 = sext i32 %28 to i64
br label %42
39: ; preds = %42, %27
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %8)
%41 = add nsw i32 %21, 1
br label %54
42: ; preds = %37, %42
%43 = phi i64 [ %38, %37 ], [ %47, %42 ]
%44 = phi i32 [ 0, %37 ], [ %46, %42 ]
%45 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 %43
store i8 35, i8* %45
%46 = add nuw nsw i32 %44, 1
%47 = add nsw i64 %43, 1
%48 = call i32 @merge(i8* %19, i8* %7, i32 4)
%49 = icmp slt i32 %46, %48
%50 = icmp slt i64 %43, 3
%51 = select i1 %49, i1 %50, i1 false
br i1 %51, label %42, label %39
52: ; preds = %20
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.21, i64 0, i64 0))
br label %54
54: ; preds = %52, %39
%55 = phi i32 [ %30, %39 ], [ 0, %52 ]
%56 = phi i32 [ %41, %39 ], [ %21, %52 ]
%57 = icmp slt i32 %56, 10
%58 = icmp eq i32 %55, 0
%59 = select i1 %57, i1 %58, i1 false
br i1 %59, label %20, label %60
60: ; preds = %54
br i1 %58, label %61, label %63
61: ; preds = %60
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0), i8* %6)
br label %65
63: ; preds = %60
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.20, i64 0, i64 0))
br label %65
65: ; preds = %63, %61
ret i32 0
}