#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 *, short);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, short *, ...);
int main() {
  FILE *f = fopen("INP.TXT", "r");
  short m, n, i, a;
  char b[10000] = {};
  fscanf(f, "%hd %hd", &n, &m);
  for (i = 0; i < m; i++) {
    fscanf(f, "%hd", &a);
    b[a - 1] = 1;
  }
  fclose(f);
  f = fopen("OUT.TXT", "w");
  fprintf(f, "%hd\n", n - m);
  for (i = 0; i < n; i++)
    if (!b[i])
      fprintf(f, "%hd ", i + 1);
  fputc(10, f);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2730,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
lea    0xe88(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    -0x2730(%rbp),%rdi
xor    %esi,%esi
mov    $0x2710,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    0xe63(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x12(%rbp),%rcx
mov    $0x0,%al
call   1050 <fscanf@plt>
movw   $0x0,-0x16(%rbp)
movswl -0x16(%rbp),%eax
movswl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jge    1204 <main+0xa4>
mov    -0x10(%rbp),%rdi
lea    0xe37(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1050 <fscanf@plt>
movswl -0x18(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x1,-0x2730(%rbp,%rax,1)
01
mov    -0x16(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x16(%rbp)
jmp    11bc <main+0x5c>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xdfe(%rip),%rdi
lea    0xdff(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movswl -0x14(%rbp),%eax
movswl -0x12(%rbp),%ecx
sub    %ecx,%eax
lea    0xde3(%rip),%rsi
movswl %ax,%edx
call   1070 <fprintf@plt>
movw   $0x0,-0x16(%rbp)
movswl -0x16(%rbp),%eax
movswl -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    129a <main+0x13a>
movswq -0x16(%rbp),%rax
cmpb   $0x0,-0x2730(%rbp,%rax,1)
jne    1284 <main+0x124>
mov    -0x10(%rbp),%rdi
movswl -0x16(%rbp),%eax
add    $0x1,%eax
lea    0xda5(%rip),%rsi
movswl %ax,%edx
call   1070 <fprintf@plt>
jmp    1289 <main+0x129>
mov    -0x16(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x16(%rbp)
jmp    1247 <main+0xe7>
mov    -0x10(%rbp),%rsi
mov    $0xa,%edi
call   1060 <fputc@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x2730,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2720,%rsp
lea    0xe8a(%rip),%rdi
lea    0xe8b(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
lea    0x10(%rsp),%r14
mov    $0x2710,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xe6a(%rip),%rsi
lea    0xa(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <fscanf@plt>
cmpw   $0x0,0xc(%rsp)
jle    11f6 <main+0x96>
lea    0xe4b(%rip),%r15
lea    0xe(%rsp),%r12
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1050 <fscanf@plt>
movswq 0xe(%rsp),%rax
movb   $0x1,-0x1(%rax,%r14,1)
add    $0x1,%ebp
cmp    0xc(%rsp),%bp
jl     11d0 <main+0x70>
mov    %rbx,%rdi
call   1030 <fclose@plt>
lea    0xe0d(%rip),%rdi
lea    0xe0e(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r15
movzwl 0xa(%rsp),%eax
sub    0xc(%rsp),%ax
movswl %ax,%edx
lea    0xdf4(%rip),%rsi
mov    %r15,%rdi
call   1070 <fprintf@plt>
movzwl 0xa(%rsp),%eax
test   %ax,%ax
jle    127f <main+0x11f>
xor    %ecx,%ecx
lea    0xdde(%rip),%r14
jmp    125c <main+0xfc>
cs nopw 0x0(%rax,%rax,1)
nop
movswq %ax,%rdx
mov    %rbx,%rcx
cmp    %rdx,%rbx
jge    127f <main+0x11f>
lea    0x1(%rcx),%rbx
cmpb   $0x0,0x10(%rsp,%rcx,1)
jne    1250 <main+0xf0>
add    $0x1,%ecx
movswl %cx,%edx
mov    %r15,%rdi
mov    %r14,%rsi
call   1070 <fprintf@plt>
movzwl 0xa(%rsp),%eax
jmp    1250 <main+0xf0>
mov    $0xa,%edi
mov    %r15,%rsi
call   1060 <fputc@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x2720,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"INP.TXT\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [8 x i8] c"%hd %hd\00"
@.str.3 = [4 x i8] c"%hd\00"
@.str.4 = [8 x i8] c"OUT.TXT\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [5 x i8] c"%hd\0A\00"
@.str.7 = [5 x i8] c"%hd \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
%7 = alloca [10000 x i8]
store i32 0, i32* %1
%8 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %2
%9 = bitcast [10000 x i8]* %7 to i8*
%10 = load i32*, i32** %2
%11 = call i32 (i32*, i8*, i16*, ...) @fscanf(i32* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i16* %4, i16* %3)
store i16 0, i16* %5
br label %12
12: ; preds = %26, %0
%13 = load i16, i16* %5
%14 = sext i16 %13 to i32
%15 = load i16, i16* %3
%16 = sext i16 %15 to i32
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %29
18: ; preds = %12
%19 = load i32*, i32** %2
%20 = call i32 (i32*, i8*, i16*, ...) @fscanf(i32* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i16* %6)
%21 = load i16, i16* %6
%22 = sext i16 %21 to i32
%23 = sub nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10000 x i8], [10000 x i8]* %7, i64 0, i64 %24
store i8 1, i8* %25
br label %26
26: ; preds = %18
%27 = load i16, i16* %5
%28 = add i16 %27, 1
store i16 %28, i16* %5
br label %12
29: ; preds = %12
%30 = load i32*, i32** %2
%31 = call i32 @fclose(i32* %30)
%32 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 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* %32, i32** %2
%33 = load i32*, i32** %2
%34 = load i16, i16* %4
%35 = sext i16 %34 to i32
%36 = load i16, i16* %3
%37 = sext i16 %36 to i32
%38 = sub nsw i32 %35, %37
%39 = trunc i32 %38 to i16
%40 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i16 signext %39)
store i16 0, i16* %5
br label %41
41: ; preds = %61, %29
%42 = load i16, i16* %5
%43 = sext i16 %42 to i32
%44 = load i16, i16* %4
%45 = sext i16 %44 to i32
%46 = icmp slt i32 %43, %45
br i1 %46, label %47, label %64
47: ; preds = %41
%48 = load i16, i16* %5
%49 = sext i16 %48 to i64
%50 = getelementptr inbounds [10000 x i8], [10000 x i8]* %7, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = icmp ne i8 %51, 0
br i1 %52, label %60, label %53
53: ; preds = %47
%54 = load i32*, i32** %2
%55 = load i16, i16* %5
%56 = sext i16 %55 to i32
%57 = add nsw i32 %56, 1
%58 = trunc i32 %57 to i16
%59 = call i32 @fprintf(i32* %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i16 signext %58)
br label %60
60: ; preds = %53, %47
br label %61
61: ; preds = %60
%62 = load i16, i16* %5
%63 = add i16 %62, 1
store i16 %63, i16* %5
br label %41
64: ; preds = %41
%65 = load i32*, i32** %2
%66 = call i32 @fputc(i32 10, i32* %65)
%67 = load i32*, i32** %2
%68 = call i32 @fclose(i32* %67)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"INP.TXT\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [8 x i8] c"%hd %hd\00"
@.str.3 = [4 x i8] c"%hd\00"
@.str.4 = [8 x i8] c"OUT.TXT\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [5 x i8] c"%hd\0A\00"
@.str.7 = [5 x i8] c"%hd \00"
define i32 @main() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca i16
%4 = alloca [10000 x i8]
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = bitcast i16* %1 to i8*
%7 = bitcast i16* %2 to i8*
%8 = bitcast i16* %3 to i8*
%9 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 0
%10 = call i32 (i32*, i8*, i16*, ...) @fscanf(i32* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i16* %2, i16* %1)
%11 = load i16, i16* %1
%12 = icmp sgt i16 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %0, %13
%14 = phi i16 [ %20, %13 ], [ 0, %0 ]
%15 = call i32 (i32*, i8*, i16*, ...) @fscanf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i16* %3)
%16 = load i16, i16* %3
%17 = sext i16 %16 to i64
%18 = add nsw i64 %17, -1
%19 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 %18
store i8 1, i8* %19
%20 = add nuw nsw i16 %14, 1
%21 = load i16, i16* %1
%22 = icmp slt i16 %20, %21
br i1 %22, label %13, label %23
23: ; preds = %13, %0
%24 = call i32 @fclose(i32* %5)
%25 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%26 = load i16, i16* %2
%27 = load i16, i16* %1
%28 = sub i16 %26, %27
%29 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i16 signext %28)
%30 = load i16, i16* %2
%31 = icmp sgt i16 %30, 0
br i1 %31, label %32, label %47
32: ; preds = %23, %43
%33 = phi i16 [ %44, %43 ], [ %30, %23 ]
%34 = phi i64 [ %38, %43 ], [ 0, %23 ]
%35 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = icmp eq i8 %36, 0
%38 = add nuw nsw i64 %34, 1
br i1 %37, label %39, label %43
39: ; preds = %32
%40 = trunc i64 %38 to i16
%41 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i16 signext %40)
%42 = load i16, i16* %2
br label %43
43: ; preds = %32, %39
%44 = phi i16 [ %42, %39 ], [ %33, %32 ]
%45 = sext i16 %44 to i64
%46 = icmp slt i64 %38, %45
br i1 %46, label %32, label %47
47: ; preds = %43, %23
%48 = call i32 @fputc(i32 10, i32* %25)
%49 = call i32 @fclose(i32* %25)
ret i32 0
}