#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 *, unsigned long *, unsigned long *);
int main() {
  unsigned long left, right, carry;
  unsigned long left_digit, right_digit;
  unsigned long nCarry;
  while (scanf("%lu %lu", &left, &right) != EOF) {
    if (left == 0 && right == 0) {
      break;
    }
    nCarry = 0;
    carry = 0;
    while (left != 0 || right != 0) {
      left_digit = left % 10;
      left = (left > 0) ? left / 10 : 0;
      right_digit = right % 10;
      right = (right > 0) ? right / 10 : 0;
      if (carry + left_digit + right_digit >= 10) {
        carry = 1;
        nCarry++;
      } else {
        carry = 0;
      }
    }
    switch (nCarry) {
    case 0:
      printf("No carry operation.\n");
      break;
    case 1:
      printf("%lu carry operation.\n", nCarry);
      break;
    default:
      printf("%lu carry operations.\n", nCarry);
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
je     12dd <main+0x1bd>
cmpq   $0x0,-0x10(%rbp)
jne    116e <main+0x4e>
cmpq   $0x0,-0x18(%rbp)
jne    116e <main+0x4e>
jmp    12dd <main+0x1bd>
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x39(%rbp)
jne    1199 <main+0x79>
cmpq   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    11a9 <main+0x89>
jmp    1273 <main+0x153>
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    11dd <main+0xbd>
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x48(%rbp)
jmp    11e8 <main+0xc8>
xor    %eax,%eax
mov    %rax,-0x48(%rbp)
jmp    11e8 <main+0xc8>
mov    -0x48(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x30(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    1224 <main+0x104>
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x50(%rbp)
jmp    122f <main+0x10f>
xor    %eax,%eax
mov    %rax,-0x50(%rbp)
jmp    122f <main+0x10f>
mov    -0x50(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
add    -0x30(%rbp),%rax
cmp    $0xa,%rax
jb     1266 <main+0x146>
movq   $0x1,-0x20(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    126e <main+0x14e>
movq   $0x0,-0x20(%rbp)
jmp    117e <main+0x5e>
mov    -0x38(%rbp),%rax
mov    %rax,-0x58(%rbp)
test   %rax,%rax
je     129c <main+0x17c>
jmp    1289 <main+0x169>
mov    -0x58(%rbp),%rax
sub    $0x1,%rax
je     12af <main+0x18f>
jmp    12c6 <main+0x1a6>
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d8 <main+0x1b8>
mov    -0x38(%rbp),%rsi
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d8 <main+0x1b8>
mov    -0x38(%rbp),%rsi
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x60,%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),%r15
cmp    (%r15),%rax
jne    1171 <main+0x41>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0xcccccccccccccccd,%r14
cc cc cc
lea    0xe7e(%rip),%r13
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%rbx
jmp    11af <main+0x7f>
xchg   %ax,%ax
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
cmp    (%r15),%rax
je     1160 <main+0x30>
mov    0x10(%rsp),%r9
mov    0x8(%rsp),%rdx
mov    %r9,%rax
or     %rdx,%rax
je     1160 <main+0x30>
je     1190 <main+0x60>
mov    %rbx,%r15
xor    %esi,%esi
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rdx,%r8
mov    %r9,%rbp
mov    %r9,%rax
mul    %r14
mov    %rdx,%r9
shr    $0x3,%r9
lea    (%r9,%r9,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rbp,%rcx
sub    %rax,%rcx
add    %rbx,%rcx
mov    %r8,%rax
mul    %r14
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %r8,%rdi
sub    %rax,%rdi
add    %rcx,%rdi
xor    %ebx,%ebx
cmp    $0xa,%rdi
setae  %bl
add    %rbx,%rsi
cmp    $0x9,%rbp
ja     11d0 <main+0xa0>
cmp    $0x9,%r8
ja     11d0 <main+0xa0>
mov    %r9,0x10(%rsp)
mov    %rdx,0x8(%rsp)
cmp    $0x1,%rsi
je     125d <main+0x12d>
test   %rsi,%rsi
mov    %r15,%rbx
mov    0x2da4(%rip),%r15
je     1190 <main+0x60>
lea    0xdcd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    119c <main+0x6c>
mov    $0x1,%esi
lea    0xd9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rbx
mov    0x2d6e(%rip),%r15
jmp    119c <main+0x6c>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%lu %lu\00"
@EOF = global i64 0
@.str.2 = [22 x i8] c"%lu carry operation.\0A\00"
@.str.3 = [23 x i8] c"%lu 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 ([8 x i8], [8 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 %46, label %8
8: ; preds = %0, %42
%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 %46, 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 %36
18: ; preds = %14, %18
%19 = phi i64 [ %31, %18 ], [ 0, %14 ]
%20 = phi i64 [ %30, %18 ], [ 0, %14 ]
%21 = phi i64 [ %24, %18 ], [ %9, %14 ]
%22 = phi i64 [ %26, %18 ], [ %11, %14 ]
%23 = urem i64 %21, 10
%24 = udiv i64 %21, 10
%25 = urem i64 %22, 10
%26 = udiv i64 %22, 10
%27 = add nuw nsw i64 %23, %20
%28 = add nuw nsw i64 %27, %25
%29 = icmp ugt i64 %28, 9
%30 = zext i1 %29 to i64
%31 = add i64 %19, %30
%32 = icmp ugt i64 %21, 9
%33 = icmp ugt i64 %22, 9
%34 = select i1 %32, i1 true, i1 %33
br i1 %34, label %18, label %35
35: ; preds = %18
store i64 %24, i64* %1
store i64 %26, i64* %2
switch i64 %31, label %40 [
i64 0, label %36
i64 1, label %38
]
36: ; preds = %14, %35
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %42
38: ; preds = %35
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i64 1)
br label %42
40: ; preds = %35
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 %31)
br label %42
42: ; preds = %40, %38, %36
%43 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%44 = load i64, i64* @EOF
%45 = icmp eq i64 %43, %44
br i1 %45, label %46, label %8
46: ; preds = %42, %8, %0
ret i32 0
}