#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 */
char *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  char *input;
  int i = 1;
  input = malloc(sizeof(char) * 31);
  scanf("%s", input);
  while (strcmp(input, "*") != 0) {
    if (strcmp(input, "Hajj") == 0)
      printf("Case %d: Hajj-e-Akbar\n", i);
    else
      printf("Case %d: Hajj-e-Asghar\n", i);
    i += 1;
    scanf("%s", input);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    $0x1f,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11f0 <main+0xb0>
mov    -0x18(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c3 <main+0x83>
mov    -0x1c(%rbp),%esi
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
jmp    11d2 <main+0x92>
mov    -0x1c(%rbp),%esi
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe1a(%rip),%rdi
call   1060 <scanf@plt>
jmp    117b <main+0x3b>
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
push   %rax
mov    $0x1f,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xea1(%rip),%rdi
mov    %rax,%rsi
call   1060 <scanf@plt>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11de <main+0x9e>
mov    $0x1,%ebp
lea    0xe83(%rip),%r13
lea    0xe93(%rip),%r14
lea    0xe6b(%rip),%r15
lea    0xe67(%rip),%r12
nopl   0x0(%rax)
mov    %rbx,%rdi
lea    0xe5b(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
mov    %r14,%rdi
cmove  %r13,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11a0 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [5 x i8] c"Hajj\00"
@.str.3 = [23 x i8] c"Case %d: Hajj-e-Akbar\0A\00"
@.str.4 = [24 x i8] c"Case %d: Hajj-e-Asghar\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
%8 = call i8* @malloc(i32 31)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %25, %2
%12 = load i8*, i8** %6
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %30
15: ; preds = %11
%16 = load i8*, i8** %6
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* %7
%21 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %20)
br label %25
22: ; preds = %15
%23 = load i32, i32* %7
%24 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %22, %19
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
%28 = load i8*, i8** %6
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %28)
br label %11
30: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [5 x i8] c"Hajj\00"
@.str.3 = [23 x i8] c"Case %d: Hajj-e-Akbar\0A\00"
@.str.4 = [24 x i8] c"Case %d: Hajj-e-Asghar\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(31) i8* @malloc(i32 31)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %13, %7 ], [ 1, %2 ]
%9 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0)
%12 = tail call i32 @printf(i8* %11, i32 %8)
%13 = add nuw nsw i32 %8, 1
%14 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%15 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %2
ret i32 0
}