#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 /*<<< orphan*/ scanf(char *, char *, int *);
int main() {
  char sex;
  int age;
  scanf("%c %d", &sex, &age);
  if (sex == 'F')
    printf(age >= 18 ? "WOMAN" : "GIRL");
  else if (sex == 'M')
    printf(age >= 18 ? "MAN" : "BOY");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jne    1172 <main+0x52>
mov    -0xc(%rbp),%ecx
lea    0xeb2(%rip),%rdi
lea    0xea5(%rip),%rax
cmp    $0x12,%ecx
cmovge %rax,%rdi
call   1030 <printf@plt>
jmp    11a1 <main+0x81>
movsbl -0x5(%rbp),%eax
cmp    $0x4d,%eax
jne    119c <main+0x7c>
mov    -0xc(%rbp),%ecx
lea    0xe88(%rip),%rdi
lea    0xe78(%rip),%rax
cmp    $0x12,%ecx
cmovge %rax,%rdi
call   1030 <printf@plt>
jmp    11a1 <main+0x81>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x3(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x3(%rsp),%al
cmp    $0x4d,%al
je     1158 <main+0x38>
cmp    $0x46,%al
jne    1174 <main+0x54>
cmpl   $0x12,0x4(%rsp)
lea    0xeb7(%rip),%rax
lea    0xeb6(%rip),%rdi
jmp    116b <main+0x4b>
cmpl   $0x12,0x4(%rsp)
lea    0xea4(%rip),%rax
lea    0xea6(%rip),%rdi
cmovge %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%c %d\00"
@.str.1 = [6 x i8] c"WOMAN\00"
@.str.2 = [5 x i8] c"GIRL\00"
@.str.3 = [4 x i8] c"MAN\00"
@.str.4 = [4 x i8] c"BOY\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i32* %3)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 70
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 18
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%13 = call i32 @printf(i8* %12)
br label %25
14: ; preds = %0
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 77
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i32, i32* %3
%20 = icmp sge i32 %19, 18
%21 = zext i1 %20 to i64
%22 = select i1 %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0)
%23 = call i32 @printf(i8* %22)
br label %24
24: ; preds = %18, %14
br label %25
25: ; preds = %24, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%c %d\00"
@.str.1 = [6 x i8] c"WOMAN\00"
@.str.2 = [5 x i8] c"GIRL\00"
@.str.3 = [4 x i8] c"MAN\00"
@.str.4 = [4 x i8] c"BOY\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i32* %2)
%5 = load i8, i8* %1
switch i8 %5, label %17 [
i8 70, label %6
i8 77, label %10
]
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 17
%9 = select i1 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
br label %14
10: ; preds = %0
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 17
%13 = select i1 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0)
br label %14
14: ; preds = %6, %10
%15 = phi i8* [ %13, %10 ], [ %9, %6 ]
%16 = call i32 @printf(i8* dereferenceable(1) %15)
br label %17
17: ; preds = %14, %0
ret i32 0
}