#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*/ print_data_set(char **, int /*<<< orphan*/, int,
                                  int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  int idx = 1;
  char buf[100];
  char data[100][100];
  int line = 0;
  while (1) {
    scanf("%s", buf);
    if (strcmp("*", buf) == 0) {
      printf("DATA SET %d:\nROOT\n", idx);
      print_data_set(data, 0, line, 0);
      printf("\n");
      line = 0;
      idx++;
    } else if (strcmp("#", buf) == 0) {
      break;
    } else {
      strcpy(data[line++], buf);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2790,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x2784(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11ea <main+0x9a>
mov    -0x8(%rbp),%esi
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x2780(%rbp),%rdi
mov    -0x2784(%rbp),%edx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1070 <print_data_set@plt>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x2784(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1238 <main+0xe8>
lea    -0x70(%rbp),%rsi
lea    0xe23(%rip),%rdi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1209 <main+0xb9>
jmp    123d <main+0xed>
mov    -0x2784(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x2784(%rbp)
cltq
lea    -0x2780(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
lea    -0x70(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    1238 <main+0xe8>
jmp    1173 <main+0x23>
xor    %eax,%eax
add    $0x2790,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2798,%rsp
movl   $0x1,0xc(%rsp)
lea    0x80(%rsp),%rax
lea    0xe78(%rip),%r12
lea    0x10(%rsp),%rbp
lea    0xe6f(%rip),%rbx
lea    0xe7d(%rip),%r13
mov    %rax,%r15
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbp,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11f0 <main+0x90>
mov    %r13,%rdi
mov    %rbp,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     123a <main+0xda>
add    $0x1,%r14d
mov    %r15,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
add    $0x64,%r15
jmp    11b0 <main+0x50>
lea    0xe0e(%rip),%rdi
mov    0xc(%rsp),%r15d
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x80(%rsp),%rdi
xor    %esi,%esi
mov    %r14d,%edx
xor    %ecx,%ecx
call   1080 <print_data_set@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x80(%rsp),%rax
add    $0x1,%r15d
mov    %r15d,0xc(%rsp)
jmp    119b <main+0x3b>
xor    %eax,%eax
add    $0x2798,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [19 x i8] c"DATA SET %d:\0AROOT\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [2 x i8] c"#\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i8]
%4 = alloca [100 x [100 x i8]]
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %5
br label %6
6: ; preds = %0, %36
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %6
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %4, i64 0, i64 0
%16 = bitcast [100 x i8]* %15 to i8**
%17 = load i32, i32* %5
%18 = call i32 @print_data_set(i8** %16, i32 0, i32 %17, i32 0)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %5
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %36
22: ; preds = %6
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%24 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* %23)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %22
br label %37
27: ; preds = %22
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %4, i64 0, i64 %30
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %31, i64 0, i64 0
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%34 = call i32 @strcpy(i8* %32, i8* %33)
br label %35
35: ; preds = %27
br label %36
36: ; preds = %35, %12
br label %6
37: ; preds = %26
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [19 x i8] c"DATA SET %d:\0AROOT\0A\00"
@.str.4 = [2 x i8] c"#\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x [100 x i8]]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %2, i64 0, i64 0, i64 0
%5 = bitcast [100 x [100 x i8]]* %2 to i8**
br label %6
6: ; preds = %13, %0
%7 = phi i32 [ %17, %13 ], [ 1, %0 ]
br label %8
8: ; preds = %6, %21
%9 = phi i32 [ %22, %21 ], [ 0, %6 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%11 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%15 = call i32 @print_data_set(i8** %5, i32 0, i32 %9, i32 0)
%16 = call i32 @putchar(i32 10)
%17 = add nuw nsw i32 %7, 1
br label %6
18: ; preds = %8
%19 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%20 = icmp eq i64 %19, 0
br i1 %20, label %26, label %21
21: ; preds = %18
%22 = add nuw nsw i32 %9, 1
%23 = zext i32 %9 to i64
%24 = getelementptr inbounds [100 x [100 x i8]], [100 x [100 x i8]]* %2, i64 0, i64 %23, i64 0
%25 = call i32 @strcpy(i8* %24, i8* %3)
br label %8
26: ; preds = %18
ret i32 0
}