#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__ IsEleven(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ *gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char number[1000];
  fflush(stdin);
  while (gets(number) != NULL) {
    if (!strcmp(number, "0"))
      break;
    printf("%s ", number);
    if (IsEleven(number))
      printf("is a multiple of 11.\n");
    else
      printf("is not a multiple of 11.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
lea    -0x400(%rbp),%rdi
call   1060 <gets@plt>
cmp    $0x0,%rax
je     11ff <main+0xaf>
lea    -0x400(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11ae <main+0x5e>
jmp    11ff <main+0xaf>
lea    -0x400(%rbp),%rsi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <IsEleven@plt>
cmp    $0x0,%rax
je     11ec <main+0x9c>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fa <main+0xaa>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1177 <main+0x27>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x3e8,%rsp
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    %rsp,%rdi
call   1060 <gets@plt>
test   %rax,%rax
je     11d8 <main+0x88>
cmpw   $0x30,(%rsp)
je     11d8 <main+0x88>
lea    0xe79(%rip),%r14
mov    %rsp,%rbx
lea    0xe73(%rip),%r15
lea    0xe85(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <IsEleven@plt>
test   %rax,%rax
mov    %r12,%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <gets@plt>
test   %rax,%rax
je     11d8 <main+0x88>
cmpw   $0x30,(%rsp)
jne    11a0 <main+0x50>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [2 x i8] c"0\00"
@.str.1 = [4 x i8] c"%s \00"
@.str.2 = [22 x i8] c"is a multiple of 11.\0A\00"
@.str.3 = [26 x i8] c"is not a multiple of 11.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1000 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @stdin
%8 = call i32 @fflush(i32 %7)
br label %9
9: ; preds = %28, %2
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%11 = call i32* @gets(i8* %10)
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %29
13: ; preds = %9
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%15 = call i32 @strcmp(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13
br label %29
18: ; preds = %13
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%22 = call i64 @IsEleven(i8* %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %28
26: ; preds = %18
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %26, %24
br label %9
29: ; preds = %17, %9
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [4 x i8] c"%s \00"
@str = [25 x i8] c"is not a multiple of 11.\00"
@str.4 = [21 x i8] c"is a multiple of 11.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = tail call i32 @fflush(i32 %5)
%7 = call i32* @gets(i8* %4)
%8 = icmp eq i32* %7, null
%9 = bitcast [1000 x i8]* %3 to i16*
%10 = load i16, i16* %9
%11 = icmp eq i16 %10, 48
%12 = select i1 %8, i1 true, i1 %11
br i1 %12, label %24, label %13
13: ; preds = %2, %13
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%15 = call i64 @IsEleven(i8* %4)
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0)
%18 = call i32 @puts(i8* dereferenceable(1) %17)
%19 = call i32* @gets(i8* %4)
%20 = icmp eq i32* %19, null
%21 = load i16, i16* %9
%22 = icmp eq i16 %21, 48
%23 = select i1 %20, i1 true, i1 %22
br i1 %23, label %24, label %13
24: ; preds = %13, %2
ret i32 0
}