#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 *, ...);
scalar_t__ scanf(char *, unsigned long *, unsigned long *);
int main() {
  unsigned long int x, y;
  int dx, dy, pos, carry, ncrry;
  while (scanf("%lu %lu", &x, &y) && !(x == 0 && y == 0)) {
    carry = ncrry = 0;
    for (pos = 0; pos < 9; pos++) {
      dx = x % 10;
      dy = y % 10;
      x /= 10;
      y /= 10;
      if (dx + dy + carry >= 10) {
        carry = 1;
        ncrry++;
      } else
        carry = 0;
    }
    if (ncrry == 0)
      printf("No carry operation.\n");
    else
      printf("%d carry operation%s.\n", ncrry, ncrry == 1 ? "" : "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    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2d(%rbp)
je     1178 <main+0x58>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x2e(%rbp)
jne    1170 <main+0x50>
cmpq   $0x0,-0x18(%rbp)
sete   %al
mov    %al,-0x2e(%rbp)
mov    -0x2e(%rbp),%al
xor    $0xff,%al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
test   $0x1,%al
jne    1188 <main+0x68>
jmp    127d <main+0x15d>
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x9,-0x24(%rbp)
jge    1232 <main+0x112>
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x28(%rbp),%eax
cmp    $0xa,%eax
jl     1218 <main+0xf8>
movl   $0x1,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    121f <main+0xff>
movl   $0x0,-0x28(%rbp)
jmp    1224 <main+0x104>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    119d <main+0x7d>
cmpl   $0x0,-0x2c(%rbp)
jne    124f <main+0x12f>
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1278 <main+0x158>
mov    -0x2c(%rbp),%esi
mov    -0x2c(%rbp),%ecx
lea    0xdd8(%rip),%rdx
lea    0xdb9(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rdx
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
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
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
test   %rax,%rax
je     124c <main+0x11c>
movabs $0xcccccccccccccccd,%r14
cc cc cc
lea    0xe92(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%r13
jmp    11a3 <main+0x73>
nopw   0x0(%rax,%rax,1)
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1050 <scanf@plt>
test   %rax,%rax
je     124c <main+0x11c>
mov    0x10(%rsp),%rcx
mov    0x8(%rsp),%rdx
mov    %rcx,%rax
or     %rdx,%rax
je     124c <main+0x11c>
xor    %esi,%esi
mov    $0x9,%r8d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rdx,%rdi
mov    %rcx,%rbx
mov    %rcx,%rax
mul    %r14
mov    %rdx,%rcx
shr    $0x3,%rcx
lea    (%rcx,%rcx,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
add    %ebp,%ebx
mov    %rdi,%rax
mul    %r14
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edi
add    %ebx,%edi
xor    %ebp,%ebp
cmp    $0xa,%edi
setae  %bpl
add    %ebp,%esi
add    $0xffffffff,%r8d
jne    11d0 <main+0xa0>
mov    %rcx,0x10(%rsp)
mov    %rdx,0x8(%rsp)
test   %esi,%esi
je     1180 <main+0x50>
cmp    $0x1,%esi
lea    0xdf1(%rip),%rdx
lea    0xde9(%rip),%rax
cmove  %rax,%rdx
lea    0xdc8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118c <main+0x5c>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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