#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 *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int i, sum;
  char c[10000];
  while (1) {
    sum = 0;
    for (i = 0;; i++) {
      scanf("%c", &c[i]);
      if (c[i] == '\n') {
        c[i] = '\0';
        break;
      }
      if (i % 2)
        sum -= c[i] - 48;
      else
        sum += c[i] - 48;
    }
    if (c[0] == '0' && c[1] == '\0')
      break;
    if (sum % 11)
      printf("%s is not a multiple of 11.\n", c);
    else
      printf("%s is a multiple of 11.\n", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
lea    -0x2720(%rbp),%rsi
add    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x8(%rbp),%rax
movsbl -0x2720(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    1180 <main+0x60>
movslq -0x8(%rbp),%rax
movb   $0x0,-0x2720(%rbp,%rax,1)
jmp    11d8 <main+0xb8>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11b0 <main+0x90>
movslq -0x8(%rbp),%rax
movsbl -0x2720(%rbp,%rax,1),%ecx
ff
sub    $0x30,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    11c5 <main+0xa5>
movslq -0x8(%rbp),%rax
movsbl -0x2720(%rbp,%rax,1),%eax
ff
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11ca <main+0xaa>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
movsbl -0x2720(%rbp),%eax
cmp    $0x30,%eax
jne    11fd <main+0xdd>
movsbl -0x271f(%rbp),%eax
cmp    $0x0,%eax
jne    11fd <main+0xdd>
jmp    1241 <main+0x121>
mov    -0xc(%rbp),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1229 <main+0x109>
lea    -0x2720(%rbp),%rsi
lea    0xde4(%rip),%rdi
call   1030 <printf@plt>
jmp    123c <main+0x11c>
lea    -0x2720(%rbp),%rsi
lea    0xde9(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2718,%rsp
mov    %rsp,%r14
lea    0xec5(%rip),%r13
lea    0xec1(%rip),%r12
jmp    1176 <main+0x56>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
imul   $0xba2e8ba3,%ebp,%eax
add    $0xba2e8ba,%eax
cmp    $0x1745d175,%eax
mov    %r12,%rdi
lea    0xeb6(%rip),%rax
cmovb  %rax,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%al
xor    %ebp,%ebp
mov    %r14,%rcx
cmp    $0xa,%al
je     11d9 <main+0xb9>
xor    %r15d,%r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rbx
movsbl %al,%eax
mov    $0x30,%ecx
sub    %eax,%ecx
add    $0xffffffd0,%eax
test   $0x1,%bl
cmovne %ecx,%eax
add    %eax,%ebp
add    $0x1,%r15
lea    (%rsp,%rbx,1),%rsi
add    $0x1,%rsi
mov    %r13,%rdi
call   1040 <scanf@plt>
movzbl 0x1(%rsp,%rbx,1),%eax
cmp    $0xa,%al
jne    11a0 <main+0x80>
lea    (%rsp,%r15,1),%rcx
movb   $0x0,(%rcx)
cmpb   $0x30,(%rsp)
jne    1150 <main+0x30>
cmpb   $0x0,0x1(%rsp)
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x2718,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [29 x i8] c"%s is not a multiple of 11.\0A\00"
@.str.2 = [25 x i8] c"%s is a multiple of 11.\0A\00"
define i32 @main() {
%1 = alloca [10000 x i8]
%2 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 1
br label %4
4: ; preds = %32, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %16
8: ; preds = %16, %4
%9 = phi i32 [ 0, %4 ], [ %26, %16 ]
%10 = phi i8* [ %2, %4 ], [ %28, %16 ]
store i8 0, i8* %10
%11 = load i8, i8* %2
%12 = icmp eq i8 %11, 48
%13 = load i8, i8* %3
%14 = icmp eq i8 %13, 0
%15 = select i1 %12, i1 %14, i1 false
br i1 %15, label %37, label %32
16: ; preds = %4, %16
%17 = phi i64 [ %27, %16 ], [ 0, %4 ]
%18 = phi i8 [ %30, %16 ], [ %6, %4 ]
%19 = phi i32 [ %26, %16 ], [ 0, %4 ]
%20 = sext i8 %18 to i32
%21 = and i64 %17, 1
%22 = icmp eq i64 %21, 0
%23 = add nsw i32 %20, -48
%24 = sub nsw i32 48, %20
%25 = select i1 %22, i32 %23, i32 %24
%26 = add i32 %25, %19
%27 = add nuw nsw i64 %17, 1
%28 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 %27
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %28)
%30 = load i8, i8* %28
%31 = icmp eq i8 %30, 10
br i1 %31, label %8, label %16
32: ; preds = %8
%33 = srem i32 %9, 11
%34 = icmp eq i32 %33, 0
%35 = select i1 %34, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0)
%36 = call i32 @printf(i8* %35, i8* %2)
br label %4
37: ; preds = %8
ret i32 0
}