#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__ EOF;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, int *, ...);
int main() {
  int a, b, c, x, i = 1, flag;
  while (scanf("%d", &a) != EOF) {
    flag = 0;
    scanf("%d %d", &b, &c);
    printf("Case %d: ", i++);
    for (x = 10; x <= 100; x++) {
      if (x % 3 == a && x % 5 == b && x % 7 == c) {
        flag = 1;
        printf("%d\n", x);
        break;
      }
    }
    if (!flag) {
      printf("No answer\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x18(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
je     1228 <main+0x108>
movl   $0x0,-0x1c(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x18(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     120b <main+0xeb>
mov    -0x14(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    -0x8(%rbp),%edx
jne    11f8 <main+0xd8>
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    -0xc(%rbp),%edx
jne    11f8 <main+0xd8>
mov    -0x14(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    -0x10(%rbp),%edx
jne    11f8 <main+0xd8>
movl   $0x1,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120b <main+0xeb>
jmp    11fd <main+0xdd>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1195 <main+0x75>
cmpl   $0x0,-0x1c(%rbp)
jne    1223 <main+0x103>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%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    0xebe(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%rax
jne    116e <main+0x3e>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%r15d
mov    $0xcccccccd,%r12d
mov    $0xaaaaaaab,%ebx
lea    0xc(%rsp),%r13
jmp    11b9 <main+0x89>
cs nopw 0x0(%rax,%rax,1)
lea    0xe7d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe60(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e34(%rip),%rcx
cmp    (%rcx),%rax
je     115d <main+0x2d>
mov    %r15d,%r14d
lea    0xe3d(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x1(%r14),%r15d
lea    0xe27(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %r8d,%r8d
sub    0x10(%rsp),%r8d
xor    %ecx,%ecx
sub    0x14(%rsp),%ecx
xor    %eax,%eax
sub    0xc(%rsp),%eax
mov    $0xa,%esi
jmp    121c <main+0xec>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%esi
cmp    $0x65,%esi
je     1190 <main+0x60>
mov    %esi,%ebp
mov    %rbp,%rdi
imul   %rbx,%rdi
shr    $0x21,%rdi
lea    (%rdi,%rdi,2),%edi
mov    %eax,%edx
sub    %edi,%edx
add    %esi,%edx
jne    1210 <main+0xe0>
mov    %rbp,%rdx
imul   %r12,%rdx
shr    $0x22,%rdx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%edi
sub    %edx,%edi
add    %esi,%edi
jne    1210 <main+0xe0>
imul   $0x24924925,%rbp,%rdx
shr    $0x20,%rdx
mov    %esi,%edi
sub    %edx,%edi
shr    %edi
add    %edx,%edi
shr    $0x2,%edi
lea    0x0(,%rdi,8),%edx
sub    %edx,%edi
add    %r8d,%edi
add    %esi,%edi
jne    1210 <main+0xe0>
lea    0xd99(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    119c <main+0x6c>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [10 x i8] c"Case %d: \00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [11 x i8] c"No answer\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
store i32 0, i32* %1
store i32 1, i32* %6
br label %8
8: ; preds = %47, %0
%9 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %48
12: ; preds = %8
store i32 0, i32* %7
%13 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %14)
store i32 10, i32* %5
br label %17
17: ; preds = %39, %12
%18 = load i32, i32* %5
%19 = icmp sle i32 %18, 100
br i1 %19, label %20, label %42
20: ; preds = %17
%21 = load i32, i32* %5
%22 = srem i32 %21, 3
%23 = load i32, i32* %2
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %38
25: ; preds = %20
%26 = load i32, i32* %5
%27 = srem i32 %26, 5
%28 = load i32, i32* %3
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %38
30: ; preds = %25
%31 = load i32, i32* %5
%32 = srem i32 %31, 7
%33 = load i32, i32* %4
%34 = icmp eq i32 %32, %33
br i1 %34, label %35, label %38
35: ; preds = %30
store i32 1, i32* %7
%36 = load i32, i32* %5
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %36)
br label %42
38: ; preds = %30, %25, %20
br label %39
39: ; preds = %38
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %17
42: ; preds = %35, %17
%43 = load i32, i32* %7
%44 = icmp ne i32 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %47
47: ; preds = %45, %42
br label %8
48: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [10 x i8] c"Case %d: \00"
@.str.3 = [4 x i8] c"%d\0A\00"
@str = [10 x i8] c"No answer\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %43, label %10
10: ; preds = %0, %39
%11 = phi i32 [ %13, %39 ], [ 1, %0 ]
%12 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%13 = add nuw nsw i32 %11, 1
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = load i32, i32* %3
br label %18
18: ; preds = %10, %34
%19 = phi i32 [ 10, %10 ], [ %35, %34 ]
%20 = trunc i32 %19 to i8
%21 = urem i8 %20, 3
%22 = zext i8 %21 to i32
%23 = icmp eq i32 %15, %22
br i1 %23, label %24, label %34
24: ; preds = %18
%25 = urem i8 %20, 5
%26 = zext i8 %25 to i32
%27 = icmp eq i32 %16, %26
br i1 %27, label %28, label %34
28: ; preds = %24
%29 = urem i8 %20, 7
%30 = zext i8 %29 to i32
%31 = icmp eq i32 %17, %30
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %19)
br label %39
34: ; preds = %18, %24, %28
%35 = add nuw nsw i32 %19, 1
%36 = icmp eq i32 %35, 101
br i1 %36, label %37, label %18
37: ; preds = %34
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %39
39: ; preds = %32, %37
%40 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%41 = load i64, i64* @EOF
%42 = icmp eq i64 %40, %41
br i1 %42, label %43, label %10
43: ; preds = %39, %0
ret i32 0
}