#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);
int scanf(char *, int *);
int main() {
  int a;
  while (scanf("%d", &a) == 1) {
    if (a == 0)
      break;
    if (a % 11 == 0)
      printf("%d is a multiple of 11.\n", a);
    else
      printf("%d is not a multiple of 11.", a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1193 <main+0x73>
cmpl   $0x0,-0x8(%rbp)
jne    1157 <main+0x37>
jmp    1193 <main+0x73>
mov    -0x8(%rbp),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117f <main+0x5f>
mov    -0x8(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    118e <main+0x6e>
mov    -0x8(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1195 <main+0x75>
mov    0x4(%rsp),%esi
test   %esi,%esi
je     1195 <main+0x75>
lea    0xeb6(%rip),%r15
lea    0xec8(%rip),%r12
lea    0xea5(%rip),%r14
lea    0x4(%rsp),%rbx
imul   $0xba2e8ba3,%esi,%eax
add    $0xba2e8ba,%eax
mov    %r15,%rdi
cmp    $0x1745d175,%eax
jb     1178 <main+0x58>
mov    %r12,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1195 <main+0x75>
mov    0x4(%rsp),%esi
test   %esi,%esi
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [25 x i8] c"%d is a multiple of 11.\0A\00"
@.str.2 = [28 x i8] c"%d is not a multiple of 11.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %20, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %21
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
br label %21
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %20
17: ; preds = %10
%18 = load i32, i32* %2
%19 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %14
br label %3
21: ; preds = %9, %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [25 x i8] c"%d is a multiple of 11.\0A\00"
@.str.2 = [28 x i8] c"%d is not a multiple of 11.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp ne i32 %3, 1
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %19, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %16, %8 ], [ %5, %0 ]
%10 = srem i32 %9, 11
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0)
%13 = call i32 @printf(i8* %12, i32 %9)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%15 = icmp ne i32 %14, 1
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 0
%18 = select i1 %15, i1 true, i1 %17
br i1 %18, label %19, label %8
19: ; preds = %8, %0
ret i32 0
}