#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 int *, unsigned int *);
int main() {
  unsigned n1, n2, carry, count;
  while (scanf("%u%u", &n1, &n2) != EOF) {
    if (n1 + n2 == 0) {
      break;
    }
    count = carry = 0;
    while (n1 > 0 || n2 > 0) {
      if (n1 % 10 + n2 % 10 + carry >= 10) {
        carry = 1;
        count++;
      } else {
        carry = 0;
      }
      n1 /= 10;
      n2 /= 10;
    }
    if (count == 0) {
      printf("No carry operation.\n");
    } else if (count == 1) {
      printf("1 carry operation.\n");
    } else {
      printf("%d carry operations.\n", count);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
je     125e <main+0x13e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x0,%eax
jne    1167 <main+0x47>
jmp    125e <main+0x13e>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x15(%rbp)
ja     118e <main+0x6e>
cmpl   $0x0,-0xc(%rbp)
seta   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    119e <main+0x7e>
jmp    1209 <main+0xe9>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x1c(%rbp),%eax
add    %edx,%eax
add    -0x10(%rbp),%eax
cmp    $0xa,%eax
jb     11df <main+0xbf>
movl   $0x1,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e6 <main+0xc6>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
jmp    1175 <main+0x55>
cmpl   $0x0,-0x14(%rbp)
jne    1226 <main+0x106>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1259 <main+0x139>
cmpl   $0x1,-0x14(%rbp)
jne    1243 <main+0x123>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1254 <main+0x134>
mov    -0x14(%rbp),%esi
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1259 <main+0x139>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x2e92(%rip),%r14
cmp    (%r14),%rax
jne    116c <main+0x3c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xcccccccd,%r15d
lea    0xe87(%rip),%r13
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
jmp    11af <main+0x7f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
cmp    (%r14),%rax
je     115b <main+0x2b>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
mov    %eax,%edx
add    %ecx,%edx
je     115b <main+0x2b>
mov    %eax,%edx
or     %ecx,%edx
je     1190 <main+0x60>
mov    %rbx,%r14
xor    %esi,%esi
xor    %edi,%edi
nopl   0x0(%rax)
mov    %ecx,%r8d
mov    %eax,%ebx
mov    %eax,%eax
imul   %r15,%rax
shr    $0x23,%rax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %ebx,%ebp
sub    %ecx,%ebp
add    %edi,%ebp
mov    %r8d,%ecx
imul   %r15,%rcx
shr    $0x23,%rcx
lea    (%rcx,%rcx,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %r8d,%edx
sub    %edi,%edx
add    %ebp,%edx
xor    %edi,%edi
cmp    $0xa,%edx
setae  %dil
add    %edi,%esi
cmp    $0x9,%ebx
ja     11d0 <main+0xa0>
cmp    $0x9,%r8d
ja     11d0 <main+0xa0>
mov    %eax,0x4(%rsp)
mov    %ecx,(%rsp)
cmp    $0x1,%esi
je     124a <main+0x11a>
test   %esi,%esi
mov    %r14,%rbx
mov    0x2db7(%rip),%r14
je     1190 <main+0x60>
lea    0xdc7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    119c <main+0x6c>
lea    0xdca(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rbx
mov    0x2d88(%rip),%r14
jmp    119c <main+0x6c>

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

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