#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*/ printf(char *, int);
int scanf(char *, int *, int *);
int main(void) {
  int a, b, i = 0, j, k, d, sum[200];
  while (scanf("%d %d", &a, &b) != -1) {
    sum[i] = a + b;
    i++;
  }
  for (j = 0; j < i; j++) {
    d = 10;
    for (k = 1;; k++) {
      if (sum[j] < d) {
        printf("%d\n", k);
        break;
      } else {
        d *= 10;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0xffffffff,%eax
je     1175 <main+0x55>
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
movslq -0x10(%rbp),%rax
mov    %ecx,-0x340(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1139 <main+0x19>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11eb <main+0xcb>
movl   $0xa,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x340(%rbp,%rax,4),%eax
cmp    -0x1c(%rbp),%eax
jge    11be <main+0x9e>
mov    -0x18(%rbp),%esi
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
jmp    11d8 <main+0xb8>
imul   $0xa,-0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11ca <main+0xaa>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1196 <main+0x76>
jmp    11dd <main+0xbd>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117c <main+0x5c>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x338,%rsp
lea    0xecb(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
cmp    $0xffffffff,%eax
je     11de <main+0xbe>
xor    %ebx,%ebx
lea    0xeaa(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r12
mov    0x8(%rsp),%eax
add    0xc(%rsp),%eax
mov    %eax,0x10(%rsp,%rbx,4)
add    $0x1,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <scanf@plt>
cmp    $0xffffffff,%eax
jne    1160 <main+0x40>
test   %ebx,%ebx
je     11de <main+0xbe>
mov    %ebx,%r15d
xor    %ebx,%ebx
lea    0xe73(%rip),%r14
jmp    11b1 <main+0x91>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %r15,%rbx
je     11de <main+0xbe>
mov    0x10(%rsp,%rbx,4),%eax
mov    $0x1,%esi
cmp    $0xa,%eax
jl     11a0 <main+0x80>
mov    $0x1,%esi
mov    $0xa,%ecx
nopl   0x0(%rax)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
add    $0x1,%esi
cmp    %ecx,%eax
jge    11d0 <main+0xb0>
jmp    11a0 <main+0x80>
xor    %eax,%eax
add    $0x338,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\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 [200 x i32]
store i32 0, i32* %1
store i32 0, i32* %4
br label %9
9: ; preds = %12, %0
%10 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%11 = icmp ne i32 %10, -1
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [200 x i32], [200 x i32]* %8, i64 0, i64 %17
store i32 %15, i32* %18
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %9
21: ; preds = %9
store i32 0, i32* %5
br label %22
22: ; preds = %45, %21
%23 = load i32, i32* %5
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %48
26: ; preds = %22
store i32 10, i32* %7
store i32 1, i32* %6
br label %27
27: ; preds = %41, %26
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [200 x i32], [200 x i32]* %8, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = load i32, i32* %7
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %37
34: ; preds = %27
%35 = load i32, i32* %6
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %35)
br label %44
37: ; preds = %27
%38 = load i32, i32* %7
%39 = mul nsw i32 %38, 10
store i32 %39, i32* %7
br label %40
40: ; preds = %37
br label %41
41: ; preds = %40
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
br label %27
44: ; preds = %34
br label %45
45: ; preds = %44
%46 = load i32, i32* %5
%47 = add nsw i32 %46, 1
store i32 %47, i32* %5
br label %22
48: ; preds = %22
ret i32 0
}

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