#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*/ bzero(char *, int);
int /*<<< orphan*/ normalizeString(char *, int);
int /*<<< orphan*/ recv(int, char *, int, int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int getType(int in) {
  char inputline[80];
  bzero(inputline, 80);
  recv(in, inputline, 80, 0);
  normalizeString(inputline, 1);
  if (strcmp(inputline, "SINGLE") == 0)
    return 1;
  else if (strcmp(inputline, "MULTI") == 0)
    return 2;
  else
    return 0;
}


x86 assembly (clang, -O0):
<getType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x50,%esi
call   1060 <bzero@plt>
mov    -0x8(%rbp),%edi
lea    -0x60(%rbp),%rsi
mov    $0x50,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
lea    -0x60(%rbp),%rdi
mov    $0x1,%esi
call   1040 <normalizeString@plt>
lea    -0x60(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11a0 <getType+0x60>
movl   $0x1,-0x4(%rbp)
jmp    11cd <getType+0x8d>
lea    -0x60(%rbp),%rdi
lea    0xe5c(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11c6 <getType+0x86>
movl   $0x2,-0x4(%rbp)
jmp    11cd <getType+0x8d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getType>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x50,%esi
call   1060 <bzero@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x50,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    $0x1,%ebx
mov    %r14,%rdi
mov    $0x1,%esi
call   1040 <normalizeString@plt>
lea    0xe7d(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11a9 <getType+0x69>
lea    0xe70(%rip),%rsi
mov    %rsp,%rdi
call   1050 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
add    %ebx,%ebx
mov    %ebx,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"SINGLE\00"
@.str.1 = [6 x i8] c"MULTI\00"
define i32 @getType(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [80 x i8]
store i32 %0, i32* %3
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%6 = call i32 @bzero(i8* %5, i32 80)
%7 = load i32, i32* %3
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%9 = call i32 @recv(i32 %7, i8* %8, i32 80, i32 0)
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%11 = call i32 @normalizeString(i8* %10, i32 1)
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %1
store i32 1, i32* %2
br label %22
16: ; preds = %1
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 2, i32* %2
br label %22
21: ; preds = %16
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@.str = [7 x i8] c"SINGLE\00"
@.str.1 = [6 x i8] c"MULTI\00"
define i32 @getType(i32 %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @bzero(i8* %3, i32 80)
%5 = call i32 @recv(i32 %0, i8* %3, i32 80, i32 0)
%6 = call i32 @normalizeString(i8* %3, i32 1)
%7 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i32 2, i32 0
br label %13
13: ; preds = %9, %1
%14 = phi i32 [ 1, %1 ], [ %12, %9 ]
ret i32 %14
}