#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*/ compare(char *, char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ getline(char **, size_t *, int /*<<< orphan*/);
scalar_t__ malloc(int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stdin;
int strlen(char *);
char *strtok(char *, char *);
int main() {
  char *pi = "31415926535897932384626433833";
  size_t bytes = 500;
  char *message;
  char *token;
  int token_size;
  int t, i, count;
  scanf("%d", &t);
  getchar();
  char combined[t][30];
  message = (char *)malloc((int)bytes);
  i = 0;
  while (i < t) {
    getline(&message, &bytes, stdin);
    message[strlen(message) - 1] = '\0';
    token = strtok(message, " ");
    count = 0;
    while (token != NULL) {
      token_size = strlen(token);
      sprintf(&combined[i][count], "%d", token_size);
      token = strtok(NULL, " ");
      count++;
    }
    i++;
  }
  for (i = 0; i < t; i++) {
    puts(combined[i]);
    compare(combined[i], pi);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe5a(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x1f4,-0x18(%rbp)
lea    0xe65(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    -0x30(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rax,%rdx
shl    $0x5,%rdx
sub    %rax,%rdx
sub    %rax,%rdx
add    $0xf,%rdx
movabs $0x3ffffffff0,%rcx
and    %rcx,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    12e2 <main+0x152>
mov    0x2dbd(%rip),%rax
mov    (%rax),%edx
lea    -0x20(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1090 <getline@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
lea    0xdbb(%rip),%rsi
call   1080 <strtok@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x38(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     12d4 <main+0x144>
mov    -0x28(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x50(%rbp),%rdi
mov    %eax,-0x2c(%rbp)
movslq -0x34(%rbp),%rax
imul   $0x1e,%rax,%rax
add    %rax,%rdi
movslq -0x38(%rbp),%rax
add    %rax,%rdi
mov    -0x2c(%rbp),%edx
lea    0xd71(%rip),%rsi
call   10a0 <sprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xd64(%rip),%rsi
call   1080 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1276 <main+0xe6>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1218 <main+0x88>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    132f <main+0x19f>
mov    -0x50(%rbp),%rdi
movslq -0x34(%rbp),%rax
imul   $0x1e,%rax,%rax
add    %rax,%rdi
call   1030 <puts@plt>
mov    -0x50(%rbp),%rdi
movslq -0x34(%rbp),%rax
imul   $0x1e,%rax,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   10b0 <compare@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12e9 <main+0x159>
movl   $0x0,-0x4(%rbp)
mov    -0x40(%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    $0x28,%rsp
movq   $0x1f4,-0x50(%rbp)
lea    0xe6e(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %rsp,%r15
mov    -0x2c(%rbp),%eax
mov    %rax,%rcx
shl    $0x5,%rcx
sub    %rax,%rcx
sub    %rax,%rcx
add    $0xf,%rcx
movabs $0x3ffffffff0,%rax
and    %rcx,%rax
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
mov    $0x1f4,%edi
call   1060 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jle    12d4 <main+0x144>
mov    %r15,-0x48(%rbp)
xor    %r15d,%r15d
lea    0xe0e(%rip),%rbx
lea    0xe04(%rip),%r13
mov    %r12,-0x40(%rbp)
jmp    1231 <main+0xa1>
add    $0x1,%r15
movslq -0x2c(%rbp),%rax
add    $0x1e,%r12
cmp    %rax,%r15
jge    129a <main+0x10a>
mov    0x2db0(%rip),%rax
mov    (%rax),%edx
lea    -0x38(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1090 <getline@plt>
mov    -0x38(%rbp),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r14,1)
mov    -0x38(%rbp),%rdi
mov    %rbx,%rsi
call   1080 <strtok@plt>
test   %rax,%rax
je     1220 <main+0x90>
mov    %r12,%r14
nop
mov    %rax,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %eax,%edx
call   10a0 <sprintf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1080 <strtok@plt>
add    $0x1,%r14
test   %rax,%rax
jne    1270 <main+0xe0>
jmp    1220 <main+0x90>
test   %eax,%eax
mov    -0x48(%rbp),%r15
mov    -0x40(%rbp),%rbx
jle    12d4 <main+0x144>
xor    %r12d,%r12d
lea    0xd50(%rip),%r14
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10b0 <compare@plt>
add    $0x1,%r12
movslq -0x2c(%rbp),%rax
add    $0x1e,%rbx
cmp    %rax,%r12
jl     12b0 <main+0x120>
mov    %r15,%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 = [30 x i8] c"31415926535897932384626433833\00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
@.str.2 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i64
store i32 0, i32* %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8** %2
store i64 500, i64* %3
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%13 = call i32 (...) @getchar()
%14 = load i32, i32* %7
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %10
%17 = alloca [30 x i8], i64 %15
store i64 %15, i64* %11
%18 = load i64, i64* %3
%19 = trunc i64 %18 to i32
%20 = call i64 @malloc(i32 %19)
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %4
store i32 0, i32* %8
br label %22
22: ; preds = %54, %0
%23 = load i32, i32* %8
%24 = load i32, i32* %7
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %57
26: ; preds = %22
%27 = load i32, i32* @stdin
%28 = call i32 @getline(i8** %4, i64* %3, i32 %27)
%29 = load i8*, i8** %4
%30 = load i8*, i8** %4
%31 = call i32 @strlen(i8* %30)
%32 = sub nsw i32 %31, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %29, i64 %33
store i8 0, i8* %34
%35 = load i8*, i8** %4
%36 = call i8* @strtok(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i8* %36, i8** %5
store i32 0, i32* %9
br label %37
37: ; preds = %40, %26
%38 = load i8*, i8** %5
%39 = icmp ne i8* %38, null
br i1 %39, label %40, label %54
40: ; preds = %37
%41 = load i8*, i8** %5
%42 = call i32 @strlen(i8* %41)
store i32 %42, i32* %6
%43 = load i32, i32* %8
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [30 x i8], [30 x i8]* %17, i64 %44
%46 = load i32, i32* %9
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [30 x i8], [30 x i8]* %45, i64 0, i64 %47
%49 = load i32, i32* %6
%50 = call i32 @sprintf(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %49)
%51 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i8* %51, i8** %5
%52 = load i32, i32* %9
%53 = add nsw i32 %52, 1
store i32 %53, i32* %9
br label %37
54: ; preds = %37
%55 = load i32, i32* %8
%56 = add nsw i32 %55, 1
store i32 %56, i32* %8
br label %22
57: ; preds = %22
store i32 0, i32* %8
br label %58
58: ; preds = %74, %57
%59 = load i32, i32* %8
%60 = load i32, i32* %7
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %77
62: ; preds = %58
%63 = load i32, i32* %8
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [30 x i8], [30 x i8]* %17, i64 %64
%66 = getelementptr inbounds [30 x i8], [30 x i8]* %65, i64 0, i64 0
%67 = call i32 @puts(i8* %66)
%68 = load i32, i32* %8
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [30 x i8], [30 x i8]* %17, i64 %69
%71 = getelementptr inbounds [30 x i8], [30 x i8]* %70, i64 0, i64 0
%72 = load i8*, i8** %2
%73 = call i32 @compare(i8* %71, i8* %72)
br label %74
74: ; preds = %62
%75 = load i32, i32* %8
%76 = add nsw i32 %75, 1
store i32 %76, i32* %8
br label %58
77: ; preds = %58
store i32 0, i32* %1
%78 = load i8*, i8** %10
%79 = load i32, i32* %1
ret i32 %79
}

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