#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, long long *, long long *);
int main() {
  long long a, b, c, d, ans = 0, i = 0;
  long long carry;
  while (scanf("%lld %lld", &a, &b) != EOF) {
    if (a == 0 && b == 0)
      break;
    while (a != 0 || b != 0) {
      c = a % 10;
      d = b % 10;
      carry = (c + d + i);
      if (carry >= 10) {
        ans++;
        i = 1;
      } else
        i = 0;
      a /= 10;
      b /= 10;
    }
    if (ans == 1)
      printf("%lld carry operation.\n", ans);
    else if (ans > 1)
      printf("%lld carry operations.\n", ans);
    else
      printf("No carry operation.\n");
    ans = carry = i = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%rax
je     12ab <main+0x18b>
cmpq   $0x0,-0x10(%rbp)
jne    117e <main+0x5e>
cmpq   $0x0,-0x18(%rbp)
jne    117e <main+0x5e>
jmp    12ab <main+0x18b>
jmp    1183 <main+0x63>
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x41(%rbp)
jne    119e <main+0x7e>
cmpq   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    11ae <main+0x8e>
jmp    1237 <main+0x117>
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
add    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
cmpq   $0xa,-0x40(%rbp)
jl     1206 <main+0xe6>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
movq   $0x1,-0x38(%rbp)
jmp    120e <main+0xee>
movq   $0x0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
jmp    1183 <main+0x63>
cmpq   $0x1,-0x30(%rbp)
jne    1259 <main+0x139>
mov    -0x30(%rbp),%rsi
lea    0xdbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    128e <main+0x16e>
cmpq   $0x1,-0x30(%rbp)
jle    127b <main+0x15b>
mov    -0x30(%rbp),%rsi
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1289 <main+0x169>
lea    0xdb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    128e <main+0x16e>
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x30(%rbp)
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x2e8d(%rip),%r12
cmp    (%r12),%rax
jne    1172 <main+0x42>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0x6666666666666667,%r13
66 66 66
lea    0xe7d(%rip),%rbp
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%r15
jmp    11b0 <main+0x80>
nop
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <scanf@plt>
cmp    (%r12),%rax
je     1161 <main+0x31>
mov    0x10(%rsp),%rbx
mov    0x8(%rsp),%rdi
mov    %rbx,%rax
or     %rdi,%rax
je     1161 <main+0x31>
je     1190 <main+0x60>
mov    %rbp,%r10
xor    %r8d,%r8d
xor    %esi,%esi
nopl   0x0(%rax)
mov    %rbx,%rbp
mov    %rbx,%rax
imul   %r13
mov    %rdi,%r9
mov    %rdx,%rbx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rbx
add    %rax,%rbx
lea    (%rbx,%rbx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rbp,%rcx
sub    %rax,%rcx
add    %r8,%rcx
mov    %rdi,%rax
imul   %r13
mov    %rdx,%rdi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdi
add    %rax,%rdi
lea    (%rdi,%rdi,1),%rax
lea    (%rax,%rax,4),%rax
mov    %r9,%rdx
sub    %rax,%rdx
add    %rcx,%rdx
xor    %r8d,%r8d
cmp    $0xa,%rdx
setge  %r8b
add    %r8,%rsi
add    $0xfffffffffffffff6,%rbp
add    $0xfffffffffffffff6,%r9
cmp    $0xffffffffffffffed,%rbp
jb     11d0 <main+0xa0>
cmp    $0xffffffffffffffed,%r9
jb     11d0 <main+0xa0>
mov    %rbx,0x10(%rsp)
mov    %rdi,0x8(%rsp)
test   %rsi,%rsi
mov    %r10,%rbp
je     1190 <main+0x60>
cmp    $0x1,%rsi
jne    1272 <main+0x142>
mov    $0x1,%esi
lea    0xd9a(%rip),%rdi
jmp    1279 <main+0x149>
lea    0xda8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    119c <main+0x6c>

LLVM IR (-O0):
@.str = [10 x i8] c"%lld %lld\00"
@EOF = global i64 0
@.str.1 = [23 x i8] c"%lld carry operation.\0A\00"
@.str.2 = [24 x i8] c"%lld carry operations.\0A\00"
@.str.3 = [21 x i8] c"No carry operation.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %6
store i64 0, i64* %7
br label %9
9: ; preds = %65, %0
%10 = call i64 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
%11 = load i64, i64* @EOF
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %66
13: ; preds = %9
%14 = load i64, i64* %2
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* %3
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16
br label %66
20: ; preds = %16, %13
br label %21
21: ; preds = %45, %20
%22 = load i64, i64* %2
%23 = icmp ne i64 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = load i64, i64* %3
%26 = icmp ne i64 %25, 0
br label %27
27: ; preds = %24, %21
%28 = phi i1 [ true, %21 ], [ %26, %24 ]
br i1 %28, label %29, label %50
29: ; preds = %27
%30 = load i64, i64* %2
%31 = srem i64 %30, 10
store i64 %31, i64* %4
%32 = load i64, i64* %3
%33 = srem i64 %32, 10
store i64 %33, i64* %5
%34 = load i64, i64* %4
%35 = load i64, i64* %5
%36 = add nsw i64 %34, %35
%37 = load i64, i64* %7
%38 = add nsw i64 %36, %37
store i64 %38, i64* %8
%39 = load i64, i64* %8
%40 = icmp sge i64 %39, 10
br i1 %40, label %41, label %44
41: ; preds = %29
%42 = load i64, i64* %6
%43 = add nsw i64 %42, 1
store i64 %43, i64* %6
store i64 1, i64* %7
br label %45
44: ; preds = %29
store i64 0, i64* %7
br label %45
45: ; preds = %44, %41
%46 = load i64, i64* %2
%47 = sdiv i64 %46, 10
store i64 %47, i64* %2
%48 = load i64, i64* %3
%49 = sdiv i64 %48, 10
store i64 %49, i64* %3
br label %21
50: ; preds = %27
%51 = load i64, i64* %6
%52 = icmp eq i64 %51, 1
br i1 %52, label %53, label %56
53: ; preds = %50
%54 = load i64, i64* %6
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 %54)
br label %65
56: ; preds = %50
%57 = load i64, i64* %6
%58 = icmp sgt i64 %57, 1
br i1 %58, label %59, label %62
59: ; preds = %56
%60 = load i64, i64* %6
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 %60)
br label %64
62: ; preds = %56
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %64
64: ; preds = %62, %59
br label %65
65: ; preds = %64, %53
store i64 0, i64* %7
store i64 0, i64* %8
store i64 0, i64* %6
br label %9
66: ; preds = %19, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%lld %lld\00"
@EOF = global i64 0
@.str.1 = [23 x i8] c"%lld carry operation.\0A\00"
@.str.2 = [24 x i8] c"%lld carry operations.\0A\00"
@str = [20 x i8] c"No carry operation.\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %48, label %8
8: ; preds = %0, %44
%9 = load i64, i64* %1
%10 = icmp eq i64 %9, 0
%11 = load i64, i64* %2
%12 = icmp eq i64 %11, 0
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %48, label %14
14: ; preds = %8
%15 = icmp ne i64 %9, 0
%16 = icmp ne i64 %11, 0
%17 = select i1 %15, i1 true, i1 %16
br i1 %17, label %18, label %42
18: ; preds = %14, %18
%19 = phi i64 [ %28, %18 ], [ 0, %14 ]
%20 = phi i64 [ %29, %18 ], [ 0, %14 ]
%21 = phi i64 [ %30, %18 ], [ %9, %14 ]
%22 = phi i64 [ %31, %18 ], [ %11, %14 ]
%23 = srem i64 %21, 10
%24 = srem i64 %22, 10
%25 = add nsw i64 %23, %19
%26 = add nsw i64 %25, %24
%27 = icmp sgt i64 %26, 9
%28 = zext i1 %27 to i64
%29 = add nuw nsw i64 %20, %28
%30 = sdiv i64 %21, 10
%31 = sdiv i64 %22, 10
%32 = add i64 %21, -10
%33 = icmp ult i64 %32, -19
%34 = add i64 %22, -10
%35 = icmp ult i64 %34, -19
%36 = select i1 %33, i1 true, i1 %35
br i1 %36, label %18, label %37
37: ; preds = %18
store i64 %30, i64* %1
store i64 %31, i64* %2
switch i64 %29, label %40 [
i64 1, label %38
i64 0, label %42
]
38: ; preds = %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 1)
br label %44
40: ; preds = %37
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i64 %29)
br label %44
42: ; preds = %14, %37
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %44
44: ; preds = %40, %42, %38
%45 = call i64 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%46 = load i64, i64* @EOF
%47 = icmp eq i64 %45, %46
br i1 %47, label %48, label %8
48: ; preds = %44, %8, %0
ret i32 0
}