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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    115c <main+0x3c>
cmpl   $0x0,-0xc(%rbp)
jne    115c <main+0x3c>
jmp    125b <main+0x13b>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x21(%rbp)
jne    1183 <main+0x63>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1193 <main+0x73>
jmp    1206 <main+0xe6>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x14(%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)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x9,-0x20(%rbp)
jbe    11fa <main+0xda>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    1201 <main+0xe1>
movl   $0x0,-0x1c(%rbp)
jmp    116a <main+0x4a>
cmpl   $0x0,-0x18(%rbp)
jne    1223 <main+0x103>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <main+0x136>
cmpl   $0x1,-0x18(%rbp)
jne    1240 <main+0x120>
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1251 <main+0x131>
mov    -0x18(%rbp),%esi
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <main+0x136>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x30,%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    0x4(%rsp),%eax
mov    (%rsp),%ecx
mov    %eax,%edx
or     %ecx,%edx
jne    116d <main+0x3d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xcccccccd,%r14d
lea    0xe86(%rip),%r12
lea    0x4(%rsp),%r13
mov    %rsp,%r15
jmp    11b7 <main+0x87>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
mov    %eax,%edx
or     %ecx,%edx
je     115c <main+0x2c>
mov    %eax,%edx
or     %ecx,%edx
je     1190 <main+0x60>
xor    %esi,%esi
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ecx,%r8d
mov    %eax,%ebx
mov    %eax,%eax
imul   %r14,%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   %r14,%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     1240 <main+0x110>
test   %esi,%esi
je     1190 <main+0x60>
lea    0xdd1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    119c <main+0x6c>
lea    0xdd4(%rip),%rdi
jmp    1197 <main+0x67>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%u%u\00"
@.str.3 = [22 x i8] c"%u 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 i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %48, label %11
11: ; preds = %0, %41
%12 = phi i32 [ %45, %41 ], [ %8, %0 ]
%13 = phi i32 [ %43, %41 ], [ %6, %0 ]
%14 = icmp ne i32 %13, 0
%15 = icmp ne i32 %12, 0
%16 = select i1 %14, i1 true, i1 %15
br i1 %16, label %17, label %35
17: ; preds = %11, %17
%18 = phi i32 [ %30, %17 ], [ 0, %11 ]
%19 = phi i32 [ %29, %17 ], [ 0, %11 ]
%20 = phi i32 [ %24, %17 ], [ %13, %11 ]
%21 = phi i32 [ %25, %17 ], [ %12, %11 ]
%22 = urem i32 %20, 10
%23 = urem i32 %21, 10
%24 = udiv i32 %20, 10
%25 = udiv i32 %21, 10
%26 = add nuw nsw i32 %22, %19
%27 = add nuw nsw i32 %26, %23
%28 = icmp ugt i32 %27, 9
%29 = zext i1 %28 to i32
%30 = add i32 %18, %29
%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 %24, i32* %1
store i32 %25, i32* %2
switch i32 %30, label %39 [
i32 0, label %35
i32 1, label %37
]
35: ; preds = %11, %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 %30)
br label %41
41: ; preds = %37, %39, %35
%42 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%43 = load i32, i32* %1
%44 = icmp eq i32 %43, 0
%45 = load i32, i32* %2
%46 = icmp eq i32 %45, 0
%47 = select i1 %44, i1 %46, i1 false
br i1 %47, label %48, label %11
48: ; preds = %41, %0
ret i32 0
}