#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 */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int r, n;
  scanf("%d %d", &r, &n);
  int *rooms = (int *)calloc(100, sizeof(int));
  for (int i = 0; i < n; i++) {
    int room;
    scanf("%d", &room);
    *(rooms + (room - 1)) = 1;
  }
  int late = 1;
  for (int i = 0; i < r; i++) {
    if (!*(rooms + i)) {
      printf("%d\n", i + 1);
      late = 0;
      break;
    }
  }
  if (late)
    printf("too late\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x64,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11af <main+0x7f>
lea    0xe81(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116f <main+0x3f>
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    120e <main+0xde>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    11fb <main+0xcb>
mov    -0x28(%rbp),%esi
add    $0x1,%esi
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
jmp    120e <main+0xde>
jmp    1200 <main+0xd0>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11bd <main+0x8d>
cmpl   $0x0,-0x24(%rbp)
je     1226 <main+0xf6>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xeaf(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
mov    $0x64,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
cmpl   $0x0,0xc(%rsp)
jle    11b3 <main+0x73>
lea    0xe81(%rip),%r14
lea    0x10(%rsp),%r15
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movslq 0x10(%rsp),%rax
movl   $0x1,-0x4(%rbx,%rax,4)
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     1190 <main+0x50>
mov    0x14(%rsp),%eax
test   %eax,%eax
jle    11cf <main+0x8f>
xor    %esi,%esi
nopl   (%rax)
cmpl   $0x0,(%rbx,%rsi,4)
je     11dd <main+0x9d>
add    $0x1,%rsi
cmp    %rsi,%rax
jne    11c0 <main+0x80>
lea    0xe34(%rip),%rdi
call   1030 <puts@plt>
jmp    11ee <main+0xae>
add    $0x1,%esi
lea    0xe1f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [10 x i8] c"too late\0A\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
store i32 0, i32* %1
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%10 = call i64 @calloc(i32 100, i32 4)
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %4
store i32 0, i32* %5
br label %12
12: ; preds = %23, %0
%13 = load i32, i32* %5
%14 = load i32, i32* %3
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%18 = load i32*, i32** %4
%19 = load i32, i32* %6
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %18, i64 %21
store i32 1, i32* %22
br label %23
23: ; preds = %16
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %12
26: ; preds = %12
store i32 1, i32* %7
store i32 0, i32* %8
br label %27
27: ; preds = %43, %26
%28 = load i32, i32* %8
%29 = load i32, i32* %2
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %46
31: ; preds = %27
%32 = load i32*, i32** %4
%33 = load i32, i32* %8
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
%36 = load i32, i32* %35
%37 = icmp ne i32 %36, 0
br i1 %37, label %42, label %38
38: ; preds = %31
%39 = load i32, i32* %8
%40 = add nsw i32 %39, 1
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %40)
store i32 0, i32* %7
br label %46
42: ; preds = %31
br label %43
43: ; preds = %42
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %27
46: ; preds = %38, %27
%47 = load i32, i32* %7
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %51
51: ; preds = %49, %46
%52 = load i32, i32* %1
ret i32 %52
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [9 x i8] c"too late\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%7 = call i64 @calloc(i32 100, i32 4)
%8 = inttoptr i64 %7 to i32*
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = bitcast i32* %3 to i8*
br label %18
13: ; preds = %18, %0
%14 = load i32, i32* %1
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %40
16: ; preds = %13
%17 = zext i32 %14 to i64
br label %28
18: ; preds = %11, %18
%19 = phi i32 [ 0, %11 ], [ %25, %18 ]
%20 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%21 = load i32, i32* %3
%22 = add nsw i32 %21, -1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %8, i64 %23
store i32 1, i32* %24
%25 = add nuw nsw i32 %19, 1
%26 = load i32, i32* %2
%27 = icmp slt i32 %25, %26
br i1 %27, label %18, label %13
28: ; preds = %16, %37
%29 = phi i64 [ 0, %16 ], [ %38, %37 ]
%30 = getelementptr inbounds i32, i32* %8, i64 %29
%31 = load i32, i32* %30
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %28
%34 = trunc i64 %29 to i32
%35 = add nuw nsw i32 %34, 1
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %35)
br label %42
37: ; preds = %28
%38 = add nuw nsw i64 %29, 1
%39 = icmp eq i64 %38, %17
br i1 %39, label %40, label %28
40: ; preds = %37, %13
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %42
42: ; preds = %33, %40
ret i32 0
}