#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*/ getchar();
int /*<<< orphan*/ myGets(char *);
int /*<<< orphan*/ myStrcat(char *, unsigned int);
int /*<<< orphan*/ printf(char *, char *);
int scanf(char *, unsigned int *);
int main(int argc, char const *argv[]) {
  unsigned n, i;
  char strings[10][81] = {0};
  while (scanf("%u", &n), getchar(), n && n < 10) {
    for (i = 0; i < n; ++i) {
      myGets(strings[i]);
    }
    myStrcat(*strings, n);
    printf("%s\n", *strings);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x360,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x350(%rbp),%rdi
xor    %esi,%esi
mov    $0x32a,%edx
call   1040 <memset@plt>
lea    0xe6d(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x351(%rbp)
je     11c2 <main+0x62>
cmpl   $0xa,-0x14(%rbp)
setb   %al
mov    %al,-0x351(%rbp)
mov    -0x351(%rbp),%al
test   $0x1,%al
jne    11d5 <main+0x75>
jmp    1233 <main+0xd3>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    120c <main+0xac>
mov    -0x18(%rbp),%eax
lea    -0x350(%rbp),%rdi
imul   $0x51,%rax,%rax
add    %rax,%rdi
call   1080 <myGets@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11dc <main+0x7c>
lea    -0x350(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <myStrcat@plt>
lea    -0x350(%rbp),%rsi
lea    0xdda(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <main+0x2c>
xor    %eax,%eax
add    $0x360,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x340,%rsp
lea    0x10(%rsp),%rdi
mov    $0x32a,%edx
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xe78(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x8,%eax
ja     1218 <main+0xb8>
lea    0x10(%rsp),%r13
lea    0xe52(%rip),%r14
lea    0xe48(%rip),%r15
lea    0xc(%rsp),%r12
xor    %ebx,%ebx
nop
lea    (%rbx,%rbx,8),%rax
lea    (%rax,%rax,8),%rax
lea    (%rsp,%rax,1),%rdi
add    $0x10,%rdi
call   1080 <myGets@plt>
add    $0x1,%rbx
mov    0xc(%rsp),%esi
cmp    %rsi,%rbx
jb     11c0 <main+0x60>
mov    %r13,%rdi
call   1060 <myStrcat@plt>
mov    %r14,%rdi
mov    %r13,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
mov    $0x0,%ebx
cmp    $0x9,%eax
jb     11c0 <main+0x60>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [10 x [81 x i8]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [10 x [81 x i8]]* %8 to i8*
br label %10
10: ; preds = %34, %2
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%12 = call i32 (...) @getchar()
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* %6
%17 = icmp ult i32 %16, 10
br label %18
18: ; preds = %15, %10
%19 = phi i1 [ false, %10 ], [ %17, %15 ]
br i1 %19, label %20, label %42
20: ; preds = %18
store i32 0, i32* %7
br label %21
21: ; preds = %31, %20
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = icmp ult i32 %22, %23
br i1 %24, label %25, label %34
25: ; preds = %21
%26 = load i32, i32* %7
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds [10 x [81 x i8]], [10 x [81 x i8]]* %8, i64 0, i64 %27
%29 = getelementptr inbounds [81 x i8], [81 x i8]* %28, i64 0, i64 0
%30 = call i32 @myGets(i8* %29)
br label %31
31: ; preds = %25
%32 = load i32, i32* %7
%33 = add i32 %32, 1
store i32 %33, i32* %7
br label %21
34: ; preds = %21
%35 = getelementptr inbounds [10 x [81 x i8]], [10 x [81 x i8]]* %8, i64 0, i64 0
%36 = getelementptr inbounds [81 x i8], [81 x i8]* %35, i64 0, i64 0
%37 = load i32, i32* %6
%38 = call i32 @myStrcat(i8* %36, i32 %37)
%39 = getelementptr inbounds [10 x [81 x i8]], [10 x [81 x i8]]* %8, i64 0, i64 0
%40 = getelementptr inbounds [81 x i8], [81 x i8]* %39, i64 0, i64 0
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %40)
br label %10
42: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [10 x [81 x i8]]
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds [10 x [81 x i8]], [10 x [81 x i8]]* %4, i64 0, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = call i32 (...) @getchar()
%9 = load i32, i32* %3
%10 = add i32 %9, -1
%11 = icmp ult i32 %10, 9
br i1 %11, label %12, label %30
12: ; preds = %2, %20
%13 = phi i64 [ %21, %20 ], [ 0, %2 ]
%14 = getelementptr inbounds [10 x [81 x i8]], [10 x [81 x i8]]* %4, i64 0, i64 %13, i64 0
%15 = call i32 @myGets(i8* %14)
%16 = add nuw nsw i64 %13, 1
%17 = load i32, i32* %3
%18 = zext i32 %17 to i64
%19 = icmp ult i64 %16, %18
br i1 %19, label %20, label %22
20: ; preds = %12, %22
%21 = phi i64 [ %16, %12 ], [ 0, %22 ]
br label %12
22: ; preds = %12
%23 = call i32 @myStrcat(i8* %6, i32 %17)
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%26 = call i32 (...) @getchar()
%27 = load i32, i32* %3
%28 = add i32 %27, -1
%29 = icmp ult i32 %28, 9
br i1 %29, label %20, label %30
30: ; preds = %22, %2
ret i32 0
}