#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__ is_funny(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int T;
  char string[10000 + 1];
  scanf("%d", &T);
  while (T-- > 0) {
    scanf("%s", string);
    if (is_funny(string)) {
      printf("Funny\n");
    } else {
      printf("Not Funny\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    11b5 <main+0x85>
lea    -0x2720(%rbp),%rsi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x2720(%rbp),%rdi
call   1040 <is_funny@plt>
cmp    $0x0,%rax
je     11a4 <main+0x74>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
jmp    11b0 <main+0x80>
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
jmp    1154 <main+0x24>
xor    %eax,%eax
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2728,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
test   %eax,%eax
jle    11b3 <main+0x83>
lea    0xe9c(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xe93(%rip),%r15
lea    0xe90(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <is_funny@plt>
test   %rax,%rax
mov    %r12,%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
test   %eax,%eax
jg     1180 <main+0x50>
xor    %eax,%eax
add    $0x2728,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [7 x i8] c"Funny\0A\00"
@.str.3 = [11 x i8] c"Not Funny\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10001 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %5
5: ; preds = %19, %0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, -1
store i32 %7, i32* %2
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %20
9: ; preds = %5
%10 = getelementptr inbounds [10001 x i8], [10001 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [10001 x i8], [10001 x i8]* %3, i64 0, i64 0
%13 = call i64 @is_funny(i8* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %19
17: ; preds = %9
%18 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
br label %5
20: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@str = [10 x i8] c"Not Funny\00"
@str.4 = [6 x i8] c"Funny\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10001 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [10001 x i8], [10001 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, -1
store i32 %7, i32* %1
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %18
9: ; preds = %0, %9
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%11 = call i64 @is_funny(i8* %4)
%12 = icmp eq i64 %11, 0
%13 = select i1 %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0)
%14 = call i32 @puts(i8* dereferenceable(1) %13)
%15 = load i32, i32* %1
%16 = add nsw i32 %15, -1
store i32 %16, i32* %1
%17 = icmp sgt i32 %15, 0
br i1 %17, label %9, label %18
18: ; preds = %9, %0
ret i32 0
}