#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*/ arr;

/* Variables and functions */
int /*<<< orphan*/ memset(int **, int /*<<< orphan*/, int);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int N, M, C;
  scanf("%d %d %d", &N, &M, &C);
  int arr[N][C];
  memset(arr, 0, sizeof(arr));
  for (int i = 0; i < N; ++i) {
    int total;
    scanf("%d", &total);
    for (int j = 0; j < total; ++j) {
      int color;
      scanf("%d", &color);
      arr[j][color] = 1;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
xor    %eax,%eax
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    %rcx,-0x48(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rax,%rdx
imul   %rcx,%rdx
lea    0xf(,%rdx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rdi
sub    %rdx,%rdi
mov    %rdi,-0x40(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
imul   %rcx,%rax
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1220 <main+0x100>
lea    0xe59(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    120d <main+0xed>
lea    0xe34(%rip),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x48(%rbp),%rdx
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x38(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11bf <main+0x9f>
jmp    1212 <main+0xf2>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    119a <main+0x7a>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xec8(%rip),%rdi
lea    -0x2c(%rbp),%rsi
lea    -0x54(%rbp),%rdx
lea    -0x3c(%rbp),%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rsp,-0x48(%rbp)
mov    -0x2c(%rbp),%edx
mov    -0x3c(%rbp),%r13d
imul   %r13,%rdx
lea    0xf(,%rdx,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rdi
sub    %rax,%rdi
mov    %rdi,%rsp
shl    $0x2,%edx
mov    %rdi,-0x50(%rbp)
xor    %esi,%esi
call   1030 <memset@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    11fb <main+0xdb>
shl    $0x2,%r13
lea    0xe78(%rip),%rbx
lea    -0x38(%rbp),%r12
xor    %eax,%eax
jmp    11ab <main+0x8b>
cs nopw 0x0(%rax,%rax,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cmp    -0x2c(%rbp),%eax
jge    11fb <main+0xdb>
mov    %eax,-0x34(%rbp)
mov    %rbx,%rdi
lea    -0x30(%rbp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,-0x30(%rbp)
jle    11a0 <main+0x80>
mov    -0x50(%rbp),%r14
xor    %r15d,%r15d
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movslq -0x38(%rbp),%rax
movl   $0x1,(%r14,%rax,4)
add    $0x1,%r15
movslq -0x30(%rbp),%rax
add    %r13,%r14
cmp    %rax,%r15
jl     11d0 <main+0xb0>
jmp    11a0 <main+0x80>
mov    -0x48(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %4
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %5
%18 = mul nuw i64 %14, %16
%19 = alloca i32, i64 %18
store i64 %14, i64* %6
store i64 %16, i64* %7
%20 = bitcast i32* %19 to i32**
%21 = mul nuw i64 %14, %16
%22 = mul nuw i64 4, %21
%23 = trunc i64 %22 to i32
%24 = call i32 @memset(i32** %20, i32 0, i32 %23)
store i32 0, i32* %8
br label %25
25: ; preds = %48, %0
%26 = load i32, i32* %8
%27 = load i32, i32* %2
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %51
29: ; preds = %25
%30 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
store i32 0, i32* %10
br label %31
31: ; preds = %44, %29
%32 = load i32, i32* %10
%33 = load i32, i32* %9
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %47
35: ; preds = %31
%36 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %11)
%37 = load i32, i32* %10
%38 = sext i32 %37 to i64
%39 = mul nsw i64 %38, %16
%40 = getelementptr inbounds i32, i32* %19, i64 %39
%41 = load i32, i32* %11
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i32, i32* %40, i64 %42
store i32 1, i32* %43
br label %44
44: ; preds = %35
%45 = load i32, i32* %10
%46 = add nsw i32 %45, 1
store i32 %46, i32* %10
br label %31
47: ; preds = %31
br label %48
48: ; preds = %47
%49 = load i32, i32* %8
%50 = add nsw i32 %49, 1
store i32 %50, i32* %8
br label %25
51: ; preds = %25
%52 = load i8*, i8** %5
%53 = load i32, i32* %1
ret i32 %53
}

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