int get_codeword_type(line, char_p)
char *line;
int *char_p;
{
  char token[512];
  int token_type;
  token_type = get_token(line, char_p, token, 1);
  if (token_type != 2)
    return (0);
  token_type = get_token(line, char_p, token, 2);
  if (token_type != 4)
    return (0);
  if (strcmp(token, "H") == 0)
    return (1);
  else if (strcmp(token, "TN") == 0)
    return (2);
  else if (strcmp(token, "FN") == 0)
    return (3);
  else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<get_codeword_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x220(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1040 <get_token@plt>
mov    %eax,-0x224(%rbp)
cmpl   $0x2,-0x224(%rbp)
je     116d <get_codeword_type+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1226 <get_codeword_type+0x106>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x220(%rbp),%rdx
mov    $0x2,%ecx
mov    $0x0,%al
call   1040 <get_token@plt>
mov    %eax,-0x224(%rbp)
cmpl   $0x4,-0x224(%rbp)
je     11a7 <get_codeword_type+0x87>
movl   $0x0,-0x4(%rbp)
jmp    1226 <get_codeword_type+0x106>
lea    -0x220(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11cf <get_codeword_type+0xaf>
movl   $0x1,-0x4(%rbp)
jmp    1226 <get_codeword_type+0x106>
lea    -0x220(%rbp),%rdi
lea    0xe25(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11f7 <get_codeword_type+0xd7>
movl   $0x2,-0x4(%rbp)
jmp    1226 <get_codeword_type+0x106>
lea    -0x220(%rbp),%rdi
lea    0xe00(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    121f <get_codeword_type+0xff>
movl   $0x3,-0x4(%rbp)
jmp    1226 <get_codeword_type+0x106>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_codeword_type>:
push   %rbp
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %r14d,%r14d
mov    %rsp,%rdx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <get_token@plt>
cmp    $0x2,%eax
jne    1195 <get_codeword_type+0x85>
xor    %r14d,%r14d
mov    %rsp,%rdx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x2,%ecx
xor    %eax,%eax
call   1030 <get_token@plt>
cmp    $0x4,%eax
jne    1195 <get_codeword_type+0x85>
mov    $0x1,%r14d
cmpw   $0x48,(%rsp)
je     1195 <get_codeword_type+0x85>
mov    $0x4e54,%eax
xor    (%rsp),%eax
movzbl 0x2(%rsp),%ecx
or     %ax,%cx
je     118f <get_codeword_type+0x7f>
mov    $0x4e46,%eax
xor    (%rsp),%eax
movzbl 0x2(%rsp),%ecx
xor    %edx,%edx
or     %ax,%cx
sete   %dl
lea    (%rdx,%rdx,2),%r14d
jmp    1195 <get_codeword_type+0x85>
mov    $0x2,%r14d
mov    %r14d,%eax
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"H\00"
@.str.1 = [3 x i8] c"TN\00"
@.str.2 = [3 x i8] c"FN\00"
define i32 @get_codeword_type(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca [512 x i8]
%7 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
%8 = load i8*, i8** %4
%9 = load i32*, i32** %5
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%11 = call i32 (i8*, i32*, i8*, i32, ...) bitcast (i32 (...)* @get_token to i32 (i8*, i32*, i8*, i32, ...)*)(i8* %8, i32* %9, i8* %10, i32 1)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %39
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = load i32*, i32** %5
%18 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%19 = call i32 (i8*, i32*, i8*, i32, ...) bitcast (i32 (...)* @get_token to i32 (i8*, i32*, i8*, i32, ...)*)(i8* %16, i32* %17, i8* %18, i32 2)
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = icmp ne i32 %20, 4
br i1 %21, label %22, label %23
22: ; preds = %15
store i32 0, i32* %3
br label %39
23: ; preds = %15
%24 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 1, i32* %3
br label %39
28: ; preds = %23
%29 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%30 = call i32 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %28
store i32 2, i32* %3
br label %39
33: ; preds = %28
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%35 = call i32 @strcmp(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %33
store i32 3, i32* %3
br label %39
38: ; preds = %33
store i32 0, i32* %3
br label %39
39: ; preds = %38, %37, %32, %27, %22, %14
%40 = load i32, i32* %3
ret i32 %40
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"TN\00"
@.str.2 = [3 x i8] c"FN\00"
define i32 @get_codeword_type(i8* %0, i32* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i32*, i8*, i32, ...) bitcast (i32 (...)* @get_token to i32 (i8*, i32*, i8*, i32, ...)*)(i8* %0, i32* %1, i8* %4, i32 1)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %21
7: ; preds = %2
%8 = call i32 (i8*, i32*, i8*, i32, ...) bitcast (i32 (...)* @get_token to i32 (i8*, i32*, i8*, i32, ...)*)(i8* %0, i32* %1, i8* %4, i32 2)
%9 = icmp eq i32 %8, 4
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = bitcast [512 x i8]* %3 to i16*
%12 = load i16, i16* %11
%13 = icmp eq i16 %12, 72
br i1 %13, label %21, label %14
14: ; preds = %10
%15 = call i32 @bcmp(i8* dereferenceable(3) %4, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 3)
%16 = icmp eq i32 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %14
%18 = call i32 @bcmp(i8* dereferenceable(3) %4, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 3)
%19 = icmp eq i32 %18, 0
%20 = select i1 %19, i32 3, i32 0
br label %21
21: ; preds = %17, %14, %10, %7, %2
%22 = phi i32 [ 0, %2 ], [ 0, %7 ], [ 1, %10 ], [ 2, %14 ], [ %20, %17 ]
ret i32 %22
}