#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ quicksort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int *a = NULL;
  a = (int *)malloc(333333 * sizeof(int));
  int i;
  for (i = 0; i < 333333; ++i) {
    scanf("%d", &a[i]);
  }
  quicksort(a, 0, 333333 - 1);
  FILE *f1 = fopen("temp1", "w");
  for (i = 0; i < 333333; ++i) {
    fprintf(f1, "%d\n", a[i]);
  }
  fclose(f1);
  for (i = 0; i < 333333; ++i) {
    scanf("%d", &a[i]);
  }
  quicksort(a, 0, 333333 - 1);
  FILE *f2 = fopen("temp2", "w");
  for (i = 0; i < 333333; ++i) {
    fprintf(f2, "%d\n", a[i]);
  }
  fclose(f2);
  free(a);
  a = (int *)malloc(333334 * sizeof(int));
  for (i = 0; i < 333334; ++i) {
    scanf("%d", &a[i]);
  }
  quicksort(a, 0, 333334 - 1);
  f1 = fopen("temp1", "r");
  f2 = fopen("temp2", "r");
  FILE *f = fopen("temp", "w");
  int i1 = 0, i2 = 0;
  int check = 0;
  int i_f1, i_f2;
  fscanf(f1, "%d", &i_f1);
  fscanf(f2, "%d", &i_f2);
  while (i1 < 333333 && i2 < 333333) {
    if (i_f1 > i_f2) {
      fprintf(f, "%d\n", i_f2);
      fscanf(f2, "%d", &i_f2);
      ++i2;
    } else {
      fprintf(f, "%d\n", i_f1);
      fscanf(f1, "%d", &i_f1);
      ++i1;
    }
    if (i1 == 333333) {
      check = 1;
    }
    if (i2 == 333333) {
      check = 2;
    }
  }
  if (check == 1) {
    for (; i2 < 333333; ++i2) {
      fprintf(f, "%d\n", i_f2);
      fscanf(f2, "%d", &i_f2);
    }
  }
  if (check == 2) {
    for (; i1 < 333333; ++i1) {
      fprintf(f, "%d\n", i_f1);
      fscanf(f1, "%d", &i_f1);
    }
  }
  fclose(f1);
  fclose(f2);
  fclose(f);
  remove("temp1");
  remove("temp2");
  f = fopen("temp", "r");
  int i3 = 0, i4 = 0;
  int i_f;
  fscanf(f, "%d", &i_f);
  while (i3 < (333333 + 333333) && i4 < 333334) {
    if (i_f > a[i4]) {
      printf("%d\n", a[i4]);
      ++i4;
    } else {
      printf("%d\n", i_f);
      fscanf(f, "%d", &i_f);
      ++i3;
    }
    if (i3 == (333333 + 333333)) {
      check = 3;
    }
    if (i4 == 333334) {
      check = 4;
    }
  }
  if (check == 3) {
    for (; i4 < 333334; ++i4) {
      printf("%d\n", a[i4]);
    }
  }
  if (check == 4) {
    for (; i3 < (333333 + 333333); ++i3) {
      printf("%d\n", i_f);
      fscanf(f, "%d", &i_f);
    }
  }
  fclose(f);
  remove("temp");
  free(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x145854,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x51615,-0x14(%rbp)
jge    1202 <main+0x62>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe11(%rip),%rdi
call   10b0 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11cc <main+0x2c>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x51614,%edx
call   1060 <quicksort@plt>
lea    0xdea(%rip),%rdi
lea    0xde9(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x51615,-0x14(%rbp)
jge    1266 <main+0xc6>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xdb8(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1230 <main+0x90>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x51615,-0x14(%rbp)
jge    12ac <main+0x10c>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xd67(%rip),%rdi
call   10b0 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1276 <main+0xd6>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x51614,%edx
call   1060 <quicksort@plt>
lea    0xd4c(%rip),%rdi
lea    0xd3f(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x51615,-0x14(%rbp)
jge    1310 <main+0x170>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xd0e(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12da <main+0x13a>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x145858,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x51616,-0x14(%rbp)
jge    136d <main+0x1cd>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xca6(%rip),%rdi
call   10b0 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1337 <main+0x197>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x51615,%edx
call   1060 <quicksort@plt>
lea    0xc7f(%rip),%rdi
lea    0xc8a(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    0xc74(%rip),%rdi
lea    0xc73(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x28(%rbp)
lea    0xc65(%rip),%rdi
lea    0xc50(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc1e(%rip),%rsi
lea    -0x40(%rbp),%rdx
call   1080 <fscanf@plt>
mov    -0x28(%rbp),%rdi
lea    0xc0a(%rip),%rsi
lea    -0x44(%rbp),%rdx
call   1080 <fscanf@plt>
xor    %eax,%eax
cmpl   $0x51615,-0x34(%rbp)
mov    %al,-0x51(%rbp)
jge    141e <main+0x27e>
cmpl   $0x51615,-0x38(%rbp)
setl   %al
mov    %al,-0x51(%rbp)
mov    -0x51(%rbp),%al
test   $0x1,%al
jne    142e <main+0x28e>
jmp    14cc <main+0x32c>
mov    -0x40(%rbp),%eax
cmp    -0x44(%rbp),%eax
jle    146f <main+0x2cf>
mov    -0x30(%rbp),%rdi
mov    -0x44(%rbp),%edx
lea    0xbc3(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xba8(%rip),%rsi
lea    -0x44(%rbp),%rdx
call   1080 <fscanf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    149f <main+0x2ff>
mov    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%edx
lea    0xb8e(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xb73(%rip),%rsi
lea    -0x40(%rbp),%rdx
call   1080 <fscanf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x51615,-0x34(%rbp)
jne    14b3 <main+0x313>
movl   $0x1,-0x3c(%rbp)
cmpl   $0x51615,-0x38(%rbp)
jne    14c7 <main+0x327>
movl   $0x2,-0x3c(%rbp)
jmp    13ff <main+0x25f>
cmpl   $0x1,-0x3c(%rbp)
jne    1522 <main+0x382>
jmp    14db <main+0x33b>
cmpl   $0x51615,-0x38(%rbp)
jge    151d <main+0x37d>
mov    -0x30(%rbp),%rdi
mov    -0x44(%rbp),%edx
lea    0xb15(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xafa(%rip),%rsi
lea    -0x44(%rbp),%rdx
call   1080 <fscanf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    14db <main+0x33b>
jmp    1522 <main+0x382>
cmpl   $0x2,-0x3c(%rbp)
jne    1578 <main+0x3d8>
jmp    1531 <main+0x391>
cmpl   $0x51615,-0x34(%rbp)
jge    1573 <main+0x3d3>
mov    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%edx
lea    0xabf(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xaa4(%rip),%rsi
lea    -0x40(%rbp),%rdx
call   1080 <fscanf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1531 <main+0x391>
jmp    1578 <main+0x3d8>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x30(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xa69(%rip),%rdi
call   1040 <remove@plt>
lea    0xa69(%rip),%rdi
call   1040 <remove@plt>
lea    0xa65(%rip),%rdi
lea    0xa5c(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xa25(%rip),%rsi
lea    -0x50(%rbp),%rdx
call   1080 <fscanf@plt>
xor    %eax,%eax
cmpl   $0xa2c2a,-0x48(%rbp)
mov    %al,-0x52(%rbp)
jge    1603 <main+0x463>
cmpl   $0x51616,-0x4c(%rbp)
setl   %al
mov    %al,-0x52(%rbp)
mov    -0x52(%rbp),%al
test   $0x1,%al
jne    1613 <main+0x473>
jmp    16a5 <main+0x505>
mov    -0x50(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x4c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    164c <main+0x4ac>
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0x9d2(%rip),%rdi
call   1070 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1678 <main+0x4d8>
mov    -0x50(%rbp),%esi
lea    0x9b5(%rip),%rdi
call   1070 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    0x99a(%rip),%rsi
lea    -0x50(%rbp),%rdx
call   1080 <fscanf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
cmpl   $0xa2c2a,-0x48(%rbp)
jne    168c <main+0x4ec>
movl   $0x3,-0x3c(%rbp)
cmpl   $0x51616,-0x4c(%rbp)
jne    16a0 <main+0x500>
movl   $0x4,-0x3c(%rbp)
jmp    15e4 <main+0x444>
cmpl   $0x3,-0x3c(%rbp)
jne    16eb <main+0x54b>
jmp    16b4 <main+0x514>
cmpl   $0x51616,-0x4c(%rbp)
jge    16e6 <main+0x546>
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0x938(%rip),%rdi
call   1070 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    16b4 <main+0x514>
jmp    16eb <main+0x54b>
cmpl   $0x4,-0x3c(%rbp)
jne    173d <main+0x59d>
jmp    16fa <main+0x55a>
cmpl   $0xa2c2a,-0x48(%rbp)
jge    1738 <main+0x598>
mov    -0x50(%rbp),%esi
lea    0x8fa(%rip),%rdi
call   1070 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    0x8df(%rip),%rsi
lea    -0x50(%rbp),%rdx
call   1080 <fscanf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    16fa <main+0x55a>
jmp    173d <main+0x59d>
mov    -0x30(%rbp),%rdi
call   1050 <fclose@plt>
lea    0x8ca(%rip),%rdi
call   1040 <remove@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    $0x145854,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
xor    %ebp,%ebp
lea    0xe3c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rbx,%rbp,1),%rsi
mov    %r14,%rdi
call   10b0 <scanf@plt>
add    $0x4,%rbp
cmp    $0x145854,%rbp
jne    11d0 <main+0x30>
xor    %ebp,%ebp
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x51614,%edx
call   1060 <quicksort@plt>
lea    0xe02(%rip),%rdi
lea    0xe01(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%r15
lea    0xdf4(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,4),%edx
mov    %r15,%rdi
mov    %r14,%rsi
call   1090 <fprintf@plt>
add    $0x1,%rbp
cmp    $0x51615,%rbp
jne    1220 <main+0x80>
mov    %r15,%rdi
call   1050 <fclose@plt>
xor    %ebp,%ebp
lea    0xdb4(%rip),%r14
nopl   0x0(%rax)
lea    (%rbx,%rbp,1),%rsi
mov    %r14,%rdi
call   10b0 <scanf@plt>
add    $0x4,%rbp
cmp    $0x145854,%rbp
jne    1250 <main+0xb0>
xor    %ebp,%ebp
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x51614,%edx
call   1060 <quicksort@plt>
lea    0xd8e(%rip),%rdi
lea    0xd81(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%r15
lea    0xd74(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,4),%edx
mov    %r15,%rdi
mov    %r14,%rsi
call   1090 <fprintf@plt>
add    $0x1,%rbp
cmp    $0x51615,%rbp
jne    12a0 <main+0x100>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x145858,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
xor    %ebp,%ebp
lea    0xd1f(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%rbp,1),%rsi
mov    %r14,%rdi
call   10b0 <scanf@plt>
add    $0x4,%rbp
cmp    $0x145858,%rbp
jne    12f0 <main+0x150>
xor    %r15d,%r15d
mov    %rbx,0x18(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x51615,%edx
call   1060 <quicksort@plt>
lea    0xcdc(%rip),%rdi
lea    0xce7(%rip),%rbx
mov    %rbx,%rsi
call   10c0 <fopen@plt>
mov    %rax,%r14
lea    0xccf(%rip),%rdi
mov    %rbx,%rsi
call   10c0 <fopen@plt>
mov    %rax,%rbp
lea    0xcc5(%rip),%rdi
lea    0xcb0(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%rbx
lea    0xc98(%rip),%r12
lea    0xc(%rsp),%rdx
mov    %r14,0x20(%rsp)
mov    %r14,%rdi
mov    %r12,%rsi
call   1080 <fscanf@plt>
lea    0x8(%rsp),%rdx
mov    %rbp,0x10(%rsp)
mov    %rbp,%rdi
mov    %r12,%rsi
call   1080 <fscanf@plt>
mov    $0x1,%r12d
mov    $0x2,%ebp
xor    %r14d,%r14d
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%eax
mov    %rbx,%rdi
lea    0xc49(%rip),%rsi
cmp    %eax,%edx
jle    13f0 <main+0x250>
mov    %eax,%edx
call   1090 <fprintf@plt>
mov    0x10(%rsp),%rdi
lea    0xc27(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1080 <fscanf@plt>
add    $0x1,%r14d
jmp    140f <main+0x26f>
nopl   0x0(%rax)
call   1090 <fprintf@plt>
mov    0x20(%rsp),%rdi
lea    0xbff(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1080 <fscanf@plt>
add    $0x1,%r13d
cmp    $0x51615,%r13d
cmove  %r12d,%r15d
cmp    $0x51615,%r14d
cmove  %ebp,%r15d
cmp    $0x51614,%r13d
jg     143b <main+0x29b>
cmp    $0x51615,%r14d
jl     13b0 <main+0x210>
cmp    $0x1,%r15d
mov    0x10(%rsp),%r12
jne    149a <main+0x2fa>
cmp    $0x51614,%r14d
jg     149a <main+0x2fa>
mov    $0x51614,%ebp
cmovg  %r14d,%ebp
sub    %r14d,%ebp
add    $0x1,%ebp
lea    0x8(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
lea    0xb8d(%rip),%rsi
call   1090 <fprintf@plt>
mov    %r12,%rdi
lea    0xb73(%rip),%rsi
mov    %r14,%rdx
call   1080 <fscanf@plt>
add    $0xffffffff,%ebp
jne    1470 <main+0x2d0>
cmp    $0x2,%r15d
mov    0x20(%rsp),%r14
jne    14f6 <main+0x356>
cmp    $0x51614,%r13d
jg     14f6 <main+0x356>
mov    $0x51614,%ebp
cmovg  %r13d,%ebp
sub    %r13d,%ebp
add    $0x1,%ebp
lea    0xb3c(%rip),%r13
lea    0xc(%rsp),%r12
nopl   0x0(%rax)
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
lea    0xb2d(%rip),%rsi
call   1090 <fprintf@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
call   1080 <fscanf@plt>
add    $0xffffffff,%ebp
jne    14d0 <main+0x330>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xaec(%rip),%rdi
call   1040 <remove@plt>
lea    0xaec(%rip),%rdi
call   1040 <remove@plt>
lea    0xae8(%rip),%rdi
lea    0xadf(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%r12
lea    0xabb(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rax,%rdi
call   1080 <fscanf@plt>
xor    %r14d,%r14d
mov    $0x3,%ebx
mov    $0x4,%r13d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x4(%rsp),%esi
movslq %r14d,%rax
mov    0x18(%rsp),%rcx
mov    (%rcx,%rax,4),%eax
lea    0xa85(%rip),%rdi
cmp    %eax,%esi
jle    15a0 <main+0x400>
mov    %eax,%esi
call   1070 <printf@plt>
add    $0x1,%r14d
jmp    15bc <main+0x41c>
nopw   0x0(%rax,%rax,1)
call   1070 <printf@plt>
mov    %r12,%rdi
lea    0xa51(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1080 <fscanf@plt>
add    $0x1,%ebp
cmp    $0xa2c2a,%ebp
cmove  %ebx,%r15d
cmp    $0x51616,%r14d
cmove  %r13d,%r15d
cmp    $0xa2c29,%ebp
jg     15e2 <main+0x442>
cmp    $0x51616,%r14d
jl     1570 <main+0x3d0>
cmp    $0x3,%r15d
jne    162a <main+0x48a>
cmp    $0x51615,%r14d
jg     162a <main+0x48a>
movslq %r14d,%rax
mov    $0x51615,%ebx
cmovg  %r14d,%ebx
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,4),%r13
sub    %r14d,%ebx
add    $0x1,%ebx
xor    %r14d,%r14d
nop
mov    0x0(%r13,%r14,4),%esi
lea    0x9ef(%rip),%rdi
call   1070 <printf@plt>
add    $0x1,%r14
cmp    %r14d,%ebx
jne    1610 <main+0x470>
cmp    $0x4,%r15d
jne    167f <main+0x4df>
cmp    $0xa2c29,%ebp
jg     167f <main+0x4df>
mov    $0xa2c29,%ebx
cmovg  %ebp,%ebx
sub    %ebp,%ebx
add    $0x1,%ebx
lea    0x9bf(%rip),%r14
lea    0x9ad(%rip),%r15
lea    0x4(%rsp),%rbp
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1070 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1080 <fscanf@plt>
add    $0xffffffff,%ebx
jne    1660 <main+0x4c0>
mov    %r12,%rdi
call   1050 <fclose@plt>
lea    0x989(%rip),%rdi
call   1040 <remove@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"temp1\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [6 x i8] c"temp2\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [5 x i8] c"temp\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = tail call i64 @malloc(i32 1333332)
%5 = inttoptr i64 %4 to i32*
br label %6
6: ; preds = %0, %6
%7 = phi i64 [ 0, %0 ], [ %10, %6 ]
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, 333333
br i1 %11, label %12, label %6
12: ; preds = %6
%13 = tail call i32 @quicksort(i32* %5, i32 0, i32 333332)
%14 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %12, %15
%16 = phi i64 [ 0, %12 ], [ %20, %15 ]
%17 = getelementptr inbounds i32, i32* %5, i64 %16
%18 = load i32, i32* %17
%19 = tail call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = add nuw nsw i64 %16, 1
%21 = icmp eq i64 %20, 333333
br i1 %21, label %22, label %15
22: ; preds = %15
%23 = tail call i32 @fclose(i32* %14)
br label %24
24: ; preds = %22, %24
%25 = phi i64 [ 0, %22 ], [ %28, %24 ]
%26 = getelementptr inbounds i32, i32* %5, i64 %25
%27 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %26)
%28 = add nuw nsw i64 %25, 1
%29 = icmp eq i64 %28, 333333
br i1 %29, label %30, label %24
30: ; preds = %24
%31 = tail call i32 @quicksort(i32* %5, i32 0, i32 333332)
%32 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %30, %33
%34 = phi i64 [ 0, %30 ], [ %38, %33 ]
%35 = getelementptr inbounds i32, i32* %5, i64 %34
%36 = load i32, i32* %35
%37 = tail call i32 @fprintf(i32* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %36)
%38 = add nuw nsw i64 %34, 1
%39 = icmp eq i64 %38, 333333
br i1 %39, label %40, label %33
40: ; preds = %33
%41 = tail call i32 @fclose(i32* %32)
%42 = tail call i32 @free(i32* %5)
%43 = tail call i64 @malloc(i32 1333336)
%44 = inttoptr i64 %43 to i32*
br label %45
45: ; preds = %40, %45
%46 = phi i64 [ 0, %40 ], [ %49, %45 ]
%47 = getelementptr inbounds i32, i32* %44, i64 %46
%48 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %47)
%49 = add nuw nsw i64 %46, 1
%50 = icmp eq i64 %49, 333334
br i1 %50, label %51, label %45
51: ; preds = %45
%52 = tail call i32 @quicksort(i32* %44, i32 0, i32 333333)
%53 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%54 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%55 = tail call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%56 = bitcast i32* %1 to i8*
%57 = bitcast i32* %2 to i8*
%58 = call i32 @fscanf(i32* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%59 = call i32 @fscanf(i32* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %60
60: ; preds = %51, %75
%61 = phi i32 [ 0, %51 ], [ %81, %75 ]
%62 = phi i32 [ 0, %51 ], [ %77, %75 ]
%63 = phi i32 [ 0, %51 ], [ %76, %75 ]
%64 = load i32, i32* %1
%65 = load i32, i32* %2
%66 = icmp sgt i32 %64, %65
br i1 %66, label %67, label %71
67: ; preds = %60
%68 = call i32 @fprintf(i32* %55, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %65)
%69 = call i32 @fscanf(i32* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%70 = add nsw i32 %62, 1
br label %75
71: ; preds = %60
%72 = call i32 @fprintf(i32* %55, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %64)
%73 = call i32 @fscanf(i32* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%74 = add nsw i32 %63, 1
br label %75
75: ; preds = %71, %67
%76 = phi i32 [ %63, %67 ], [ %74, %71 ]
%77 = phi i32 [ %70, %67 ], [ %62, %71 ]
%78 = icmp eq i32 %76, 333333
%79 = select i1 %78, i32 1, i32 %61
%80 = icmp eq i32 %77, 333333
%81 = select i1 %80, i32 2, i32 %79
%82 = icmp slt i32 %76, 333333
%83 = icmp slt i32 %77, 333333
%84 = select i1 %82, i1 %83, i1 false
br i1 %84, label %60, label %85
85: ; preds = %75
%86 = icmp eq i32 %81, 1
%87 = select i1 %86, i1 %83, i1 false
br i1 %87, label %88, label %97
88: ; preds = %85
%89 = call i32 @llvm.smax.i32(i32 %77, i32 333332)
br label %90
90: ; preds = %88, %90
%91 = phi i32 [ %95, %90 ], [ %77, %88 ]
%92 = load i32, i32* %2
%93 = call i32 @fprintf(i32* %55, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %92)
%94 = call i32 @fscanf(i32* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%95 = add i32 %91, 1
%96 = icmp eq i32 %91, %89
br i1 %96, label %97, label %90
97: ; preds = %90, %85
%98 = icmp eq i32 %81, 2
%99 = select i1 %98, i1 %82, i1 false
br i1 %99, label %100, label %109
100: ; preds = %97
%101 = call i32 @llvm.smax.i32(i32 %76, i32 333332)
br label %102
102: ; preds = %100, %102
%103 = phi i32 [ %107, %102 ], [ %76, %100 ]
%104 = load i32, i32* %1
%105 = call i32 @fprintf(i32* %55, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %104)
%106 = call i32 @fscanf(i32* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%107 = add i32 %103, 1
%108 = icmp eq i32 %103, %101
br i1 %108, label %109, label %102
109: ; preds = %102, %97
%110 = call i32 @fclose(i32* %53)
%111 = call i32 @fclose(i32* %54)
%112 = call i32 @fclose(i32* %55)
%113 = call i32 @remove(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%114 = call i32 @remove(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%115 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%116 = bitcast i32* %3 to i8*
%117 = call i32 @fscanf(i32* %115, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %118
118: ; preds = %109, %134
%119 = phi i32 [ 0, %109 ], [ %136, %134 ]
%120 = phi i32 [ 0, %109 ], [ %135, %134 ]
%121 = phi i32 [ %81, %109 ], [ %140, %134 ]
%122 = load i32, i32* %3
%123 = sext i32 %119 to i64
%124 = getelementptr inbounds i32, i32* %44, i64 %123
%125 = load i32, i32* %124
%126 = icmp sgt i32 %122, %125
br i1 %126, label %127, label %130
127: ; preds = %118
%128 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %125)
%129 = add nsw i32 %119, 1
br label %134
130: ; preds = %118
%131 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %122)
%132 = call i32 @fscanf(i32* %115, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%133 = add nsw i32 %120, 1
br label %134
134: ; preds = %130, %127
%135 = phi i32 [ %120, %127 ], [ %133, %130 ]
%136 = phi i32 [ %129, %127 ], [ %119, %130 ]
%137 = icmp eq i32 %135, 666666
%138 = select i1 %137, i32 3, i32 %121
%139 = icmp eq i32 %136, 333334
%140 = select i1 %139, i32 4, i32 %138
%141 = icmp slt i32 %135, 666666
%142 = icmp slt i32 %136, 333334
%143 = select i1 %141, i1 %142, i1 false
br i1 %143, label %118, label %144
144: ; preds = %134
%145 = icmp eq i32 %140, 3
%146 = select i1 %145, i1 %142, i1 false
br i1 %146, label %147, label %159
147: ; preds = %144
%148 = sext i32 %136 to i64
%149 = call i32 @llvm.smax.i32(i32 %136, i32 333333)
%150 = add nuw nsw i32 %149, 1
br label %151
151: ; preds = %147, %151
%152 = phi i64 [ %148, %147 ], [ %156, %151 ]
%153 = getelementptr inbounds i32, i32* %44, i64 %152
%154 = load i32, i32* %153
%155 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %154)
%156 = add nsw i64 %152, 1
%157 = trunc i64 %156 to i32
%158 = icmp eq i32 %150, %157
br i1 %158, label %159, label %151
159: ; preds = %151, %144
%160 = icmp eq i32 %140, 4
%161 = select i1 %160, i1 %141, i1 false
br i1 %161, label %162, label %171
162: ; preds = %159
%163 = call i32 @llvm.smax.i32(i32 %135, i32 666665)
br label %164
164: ; preds = %162, %164
%165 = phi i32 [ %169, %164 ], [ %135, %162 ]
%166 = load i32, i32* %3
%167 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %166)
%168 = call i32 @fscanf(i32* %115, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%169 = add i32 %165, 1
%170 = icmp eq i32 %165, %163
br i1 %170, label %171, label %164
171: ; preds = %164, %159
%172 = call i32 @fclose(i32* %115)
%173 = call i32 @remove(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%174 = call i32 @free(i32* %44)
ret i32 0
}