#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*/ check_missing(int *, int *, int, int);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int *range_count(int, int *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int size_a, size_b;
  int i;
  scanf("%d", &size_a);
  int *ar_a = (int *)malloc(size_a * sizeof(int));
  for (i = 0; i < size_a; i++) {
    scanf("%d ", &ar_a[i]);
  }
  scanf("%d", &size_b);
  int *ar_b = (int *)malloc(size_b * sizeof(int));
  for (i = 0; i < size_b; i++) {
    scanf("%d ", &ar_b[i]);
  }
  int *a_count = range_count(size_a, ar_a, -10000, 10000);
  int *b_count = range_count(size_b, ar_b, -10000, 10000);
  check_missing(a_count, b_count, -10000, 10000);
  free(ar_a);
  free(ar_b);
  free(a_count);
  free(b_count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11be <main+0x6e>
mov    -0x18(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe58(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1189 <main+0x39>
lea    0xe3b(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1070 <scanf@plt>
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    121d <main+0xcd>
mov    -0x20(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdf9(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e8 <main+0x98>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0xffffd8f0,%edx
mov    $0x2710,%ecx
call   1050 <range_count@plt>
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0xffffd8f0,%edx
mov    $0x2710,%ecx
call   1050 <range_count@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    $0xffffd8f0,%edx
mov    $0x2710,%ecx
call   1040 <check_missing@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xe9c(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%edi
shl    $0x2,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
cmpl   $0x0,0xc(%rsp)
jle    11bd <main+0x6d>
xor    %r12d,%r12d
lea    0xe75(%rip),%r15
mov    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
add    $0x1,%r12
movslq 0xc(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%r12
jl     11a0 <main+0x50>
lea    0xe3c(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x8(%rsp),%edi
shl    $0x2,%edi
call   1060 <malloc@plt>
mov    %rax,%r15
cmpl   $0x0,0x8(%rsp)
jle    121d <main+0xcd>
xor    %r13d,%r13d
lea    0xe15(%rip),%r12
mov    %r15,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
add    $0x1,%r13
movslq 0x8(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%r13
jl     1200 <main+0xb0>
mov    0xc(%rsp),%edi
mov    %r14,%rsi
mov    $0xffffd8f0,%edx
mov    $0x2710,%ecx
call   1050 <range_count@plt>
mov    %rax,%r12
mov    0x8(%rsp),%edi
mov    %r15,%rsi
mov    $0xffffd8f0,%edx
mov    $0x2710,%ecx
call   1050 <range_count@plt>
mov    %rax,%rbx
mov    %r12,%rdi
mov    %rax,%rsi
mov    $0xffffd8f0,%edx
mov    $0x2710,%ecx
call   1040 <check_missing@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \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 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 4
%13 = trunc i64 %12 to i32
%14 = call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to i32*
store i32* %15, i32** %5
store i32 0, i32* %4
br label %16
16: ; preds = %26, %0
%17 = load i32, i32* %4
%18 = load i32, i32* %2
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %29
20: ; preds = %16
%21 = load i32*, i32** %5
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %24)
br label %26
26: ; preds = %20
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %16
29: ; preds = %16
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = mul i64 %32, 4
%34 = trunc i64 %33 to i32
%35 = call i64 @malloc(i32 %34)
%36 = inttoptr i64 %35 to i32*
store i32* %36, i32** %6
store i32 0, i32* %4
br label %37
37: ; preds = %47, %29
%38 = load i32, i32* %4
%39 = load i32, i32* %3
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %50
41: ; preds = %37
%42 = load i32*, i32** %6
%43 = load i32, i32* %4
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %42, i64 %44
%46 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %45)
br label %47
47: ; preds = %41
%48 = load i32, i32* %4
%49 = add nsw i32 %48, 1
store i32 %49, i32* %4
br label %37
50: ; preds = %37
%51 = load i32, i32* %2
%52 = load i32*, i32** %5
%53 = call i32* @range_count(i32 %51, i32* %52, i32 -10000, i32 10000)
store i32* %53, i32** %7
%54 = load i32, i32* %3
%55 = load i32*, i32** %6
%56 = call i32* @range_count(i32 %54, i32* %55, i32 -10000, i32 10000)
store i32* %56, i32** %8
%57 = load i32*, i32** %7
%58 = load i32*, i32** %8
%59 = call i32 @check_missing(i32* %57, i32* %58, i32 -10000, i32 10000)
%60 = load i32*, i32** %5
%61 = call i32 @free(i32* %60)
%62 = load i32*, i32** %6
%63 = call i32 @free(i32* %62)
%64 = load i32*, i32** %7
%65 = call i32 @free(i32* %64)
%66 = load i32*, i32** %8
%67 = call i32 @free(i32* %66)
ret i32 0
}

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